REST API Reference

Every endpoint exposed by the ixblix public API. Base URL: https://api.ixblix.app. All paths are prefixed with /api. Responses are JSON. Errors follow the standard error format.

Authentication

X-API-Key company-scoped endpoints. HTTP Basic integrator-scoped endpoints. Token customer-facing endpoints (no header needed). Public unauthenticated.

Table of contents

Integrators

POST /integrators/register HTTP Basic

Register a new integrator platform. Three-way handshake via callbackUrl.

POST /integrators/register
// Request
{
  "name": "My CRM",
  "hostname": "mycrm.example.com",
  "callbackUrl": "https://mycrm.example.com/ixblix/callback",
  "force": false,
  "subscriptionId": "asaas:sub_xxx"
}

// Response 200
{ "success": true, "message": "Registration challenge sent" }
GET /integrators/profile HTTP Basic

Fetch the authenticated integrator's profile.

Companies — onboarding

POST /companies/register HTTP Basic

Register a company (keyless). Returns payment instructions.

POST /companies/register
// Request
{
  "name": "Acme Support",
  "planId": "plan_starter",
  "email": "billing@acme.example",
  "taxId": "12345678000199",
  "confirmationWebhookUrl": "https://mycrm.example.com/ixblix/activated"
}

// Response 200
{
  "company": { "id": "...", "name": "...", "status": "PENDING_PAYMENT" },
  "payment": {
    "transactionId": "txn_xxx",
    "provider": "asaas",
    "amountCents": 4990,
    "currency": "BRL",
    "confirmationUrl": "...",
    "checkoutUrl": "https://checkout.asaas.com/...",
    "status": "PENDING"
  }
}
POST /companies/{id}/activate/{transactionId} HTTP Basic

Activate a company after payment confirmation. Returns the API key.

POST /companies/{id}/activate/{transactionId}
// Response 200
{ "apiKey": "smci_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "status": "ACTIVE" }
GET /companies/payment/{transactionId} Public

Fetch payment status for a transaction. Safe — the transactionId is in the URL.

GET /companies HTTP Basic

List all companies under the authenticated integrator.

Companies — profile & customization

GET /companies/profile X-API-Key

Fetch the authenticated company's profile, including white-label customization.

GET /companies/profile
// Response 200
{
  "id": "...",
  "name": "Acme Support",
  "status": "ACTIVE",
  "websiteUrl": "https://acme.example",
  "customizations": {
    "id": "...",
    "brandName": "Acme",
    "logoUrl": "...",
    "rectangularLogoUrl": "...",
    "squareIconUrl": "...",
    "primaryColor": "#2563eb",
    "faviconUrl": "...",
    "websiteUrl": "https://acme.example",
    "welcomeMessage": "Hello! How can we help?"
  }
}
GET /companies/balance X-API-Key

Fetch the company's prepaid balance and plan state.

PUT /companies/customization X-API-Key

Update white-label customization (brand name, logos, colors, welcome message).

POST /companies/branding X-API-Key

Upload branding assets (square icon and/or rectangular logo) as multipart/form-data.

PUT /companies/webhook X-API-Key

Set or rotate the webhook endpoint. Returns the HMAC secret once.

PUT /companies/webhook
// Request
{ "webhookUrl": "https://mycrm.example.com/ixblix/webhook", "rotateSecret": true }

// Response 200
{ "webhookUrl": "...", "webhookSecret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }
PUT /companies/configuration X-API-Key

Update company configuration (name, website URL, etc.).

GET /companies/public/{id} Public

Fetch a company's public profile by ID (used by the customer web app).

Encryption keys

PUT /companies/encryption-key X-API-Key

Register or rotate the company's RSA public key for E2EE.

PUT /companies/encryption-key
// Request
{ "keyId": "xxxxxxxxxxxxxxxx", "publicKey": "base64-spki-der..." }

// Response 200
{
  "id": "...",
  "keyId": "xxxxxxxxxxxxxxxx",
  "publicKey": "...",
  "status": "ACTIVE",
  "activatedAt": "...",
  "retiredAt": null,
  "createdAt": "..."
}
GET /companies/encryption-key X-API-Key

Fetch the currently active company encryption key.

Conversations

POST /conversations X-API-Key

Create an overflow conversation for a contact. Returns a deeplink to share.

POST /conversations
// Request
{
  "contact": {
    "externalId": "whatsapp_5511999999999",
    "name": "Jane Doe",
    "metadata": { "phone": "+55 11 99999-9999" }
  },
  "operator": {
    "uuid": "agent-42",
    "name": "Maria Silva",
    "image": "https://cdn.example.com/avatars/maria.png"
  }
}

// Response 200
{
  "conversation": { "id": "...", "token": "...", "status": "ACTIVE", "keyStatus": "AWAITING_CUSTOMER", "createdAt": "..." },
  "contact": { "id": "...", "externalId": "...", "name": "Jane Doe", "consentStatus": "PENDING" },
  "deeplink": "https://app.ixblix.app/c/...",
  "company": { "id": "...", "name": "Acme", "customizations": { "brandName": "..." } },
  "operator": { "uuid": "agent-42", "name": "Maria Silva" }
}
POST /conversations/by-key Public

List conversations by customer public key (used during key transfer).

GET /conversations/{token} Token

Fetch a conversation by its token (customer-facing).

POST /conversations/{token}/close Token

Close a conversation (customer-side).

POST /conversations/{token}/key Token

Register the customer's public key (called when the customer opens the deeplink).

POST /conversations/{token}/erase Token

Erase the encrypted content of a conversation (LGPD/data retention).

POST /conversations/{ref}/presence Mixed

Unified presence route. With X-API-Key (ref = conversation id), emits a Socket.io presence event to the customer. Without API key (ref = deeplink token), emits a TYPING/RECORDING/CHAT_CLOSED webhook to the operator.

GET /conversations/{conversationId}/keys X-API-Key

Fetch the E2EE key state of a conversation (operator view).

PUT /conversations/{conversationId}/operator X-API-Key

Update the operator identity attached to a conversation.

Messages

POST /messages/company X-API-Key

Send an encrypted message from the company to the contact. The operator identity (name, image, gravatarHash) is embedded in the encrypted attachments JSON as { "operator": { ... } } so the customer client can render the correct avatar per message.

POST /messages/company
// Request
{
  "conversationId": "...",
  "content": "base64-ciphertext...",
  "contentType": "text",
  "iv": "base64-iv",
  "authTag": "base64-auth-tag",
  "encryptedKey": "base64-wrapped-key",
  "selfEncryptedKey": "base64-wrapped-key",
  "keyId": "xxxxxxxxxxxxxxxx",
  "operatorUuid": "550e8400-e29b-41d4-a716-446655440000",
  "replyToId": "...",
  "attachments": "encrypted-json-blob"
}

// Response 200
{ "id": "...", "conversationId": "...", "senderType": "COMPANY", "content": "...", "contentEncrypted": true }
POST /messages/contact Token

Send an encrypted message from the contact to the company.

POST /messages/company/delivered X-API-Key

Marca uma mensagem enviada pelo contato como entregue ao operador. Emite o evento Socket.io message_delivered. Sem efeito quando a mensagem já foi lida.

POST /messages/company/read X-API-Key

Marca uma mensagem enviada pelo contato como lida pelo operador. Emite o evento Socket.io message_read. Só reporte leitura quando a janela estiver em foco e a mensagem estiver na viewport.

POST /messages/contact/delivered Token

Marca uma mensagem enviada pela empresa como entregue ao contato. Emite o webhook MESSAGE_DELIVERED. Sem efeito quando a mensagem já foi lida.

POST /messages/contact/read Token

Marca uma mensagem enviada pela empresa como lida pelo contato. Emite o webhook MESSAGE_READ. Só é reportado quando a janela está em foco e a mensagem está na viewport.

GET /messages/{conversationId} X-API-Key

List all messages of a conversation (content is always ciphertext when encrypted).

Media

POST /media/company X-API-Key

Upload encrypted media from the company (multipart/form-data).

Upload media
curl -X POST https://api.ixblix.app/api/media/company \
  -H "X-API-Key: smci_xxxx" \
  -F "conversationId=..." \
  -F "file=@invoice.pdf" \
  -F "iv=..." \
  -F "authTag=..." \
  -F "encryptedKey=..." \
  -F "selfEncryptedKey=..." \
  -F "keyId=..." \
  -F "operatorUuid=550e8400-e29b-41d4-a716-446655440000"
POST /media/contact Token

Upload encrypted media from the contact.

GET /media/{mediaId} X-API-Key

Fetch media metadata (envelope + file info).

GET /media/contact/{mediaId} Token

Fetch media metadata (customer-facing).

GET /media/{mediaId}/content X-API-Key

Download the raw encrypted bytes of a media file.

GET /media/contact/{mediaId}/content Token

Download the raw encrypted bytes (customer-facing).

Contacts

GET /contacts/{token} Token

Fetch a contact by conversation token.

POST /contacts/{token}/consent Token

Update the contact's consent status (LGPD).

POST /contacts/{token}/consent
// Request
{ "consentStatus": "GRANTED" }

// Response 200
{ "id": "...", "externalId": "...", "consentStatus": "GRANTED", "consentedAt": "..." }

Payments & credits

GET /payment/providers Public

List available payment providers.

GET /payment/checkout/{transactionId}/options Public

Fetch available payment instruments for a checkout.

POST /payment/checkout/{transactionId}/card Public

Pay a checkout with a credit card.

POST /payment/checkout/{transactionId}/pix-automatic Public

Pay a checkout with Pix Automático.

GET /payment/checkout/{transactionId}/status Public

Fetch the status of a checkout transaction.

POST /payment/webhooks/{provider} Public

Gateway callback endpoint. Mounted with express.raw for signature verification.

POST /companies/credits/purchase X-API-Key

Purchase prepaid credits for the authenticated company.

GET /companies/credits/purchases X-API-Key

List the company's credit purchases.

POST /companies/payment-methods/setup X-API-Key

Start a payment method setup flow (e.g. add a card).

POST /companies/payment-methods X-API-Key

Register a payment method after setup.

GET /companies/payment-methods X-API-Key

List stored payment methods (default first).

PUT /companies/payment-methods/{id}/default X-API-Key

Set a payment method as the default.

DELETE /companies/payment-methods/{id} X-API-Key

Delete a payment method.

GET /companies/payment-change/options X-API-Key

Fetch available payment instruments for re-subscribing or switching methods.

POST /companies/payment-change/start X-API-Key

Start a payment change checkout. Returns a hosted checkout URL.

Plans

GET /plans HTTP Basic

List all active subscription plans.

GET /plans
// Response 200
[
  {
    "id": "plan_starter",
    "name": "Starter",
    "description": "Up to 100 conversations/month",
    "billingType": "CONVERSATIONS",
    "includedConversations": 100,
    "includedMessages": null,
    "durationDays": 30,
    "priceCents": 4990,
    "overagePriceCents": 50,
    "isActive": true,
    "isPublic": true,
    "createdAt": "..."
  }
]

Key transfer

Key transfer allows a customer to migrate their encryption key to a new device. The flow is unauthenticated and rate-limited.

POST /key-transfer Public

Create a new key transfer request.

GET /key-transfer/{transferId} Public

Fetch a key transfer request.

DELETE /key-transfer/{transferId} Public

Delete a key transfer request.

POST /key-transfer/{transferId}/confirm Public

Confirm a key transfer (customer approves on the new device).

GET /key-transfer/{transferId}/status Public

Fetch the status of a key transfer.

Webhooks relay

POST /webhooks/original-channel X-API-Key

Relay a message from the original channel (WhatsApp, Instagram, etc.) into ixblix.

POST /webhooks/original-channel
// Request
{
  "conversationId": "...",
  "content": "base64-ciphertext",
  "iv": "...",
  "authTag": "...",
  "encryptedKey": "...",
  "selfEncryptedKey": "...",
  "keyId": "...",
  "metadata": { "channelMessageId": "..." }
}

Installation

GET /installation Public

Fetch the installation configuration (used by the customer web app to discover the API).

Interactive documentation

The full OpenAPI spec is served at ixblix.app/pt/docs/api with interactive try-it-out. The spec auto-detects the browser language (English, Portuguese, Spanish).