Rich Messages

Send interactive content: quick-reply buttons, URL buttons, copy-to-clipboard, Pix codes, vCards, and locations.

Only the operator (company side) may send rich messages. The customer can reply to them as regular text.

Attachments Format

The attachments field holds an encrypted JSON string describing interactive elements. Encrypt it with the same per-message AES key used for content. The operator identity is also embedded here so the customer client can render the correct avatar per message.

Attachments JSON
{
  "operator": {
    "uuid": "agent-42",
    "name": "Maria Silva",
    "image": "https://cdn.example.com/avatars/maria.png",
    "gravatarHash": "md5-of-operator-email"
  },
  "buttons": [
    { "type": "reply", "label": "Yes" },
    { "type": "reply", "label": "No" },
    { "type": "url", "label": "Open site", "url": "https://example.com" },
    { "type": "copy", "label": "Copy code", "value": "ABC-1234" },
    { "type": "pix", "label": "Copy Pix", "value": "00020126..." }
  ],
  "vcard": {
    "name": "John Doe",
    "phone": "+5511999998888",
    "organization": "Acme Inc."
  },
  "location": {
    "latitude": -23.5505,
    "longitude": -46.6333,
    "name": "São Paulo",
    "address": "Av. Paulista, 1000"
  }
}

Button Types

TypeRequired FieldsDescription
replylabelQuick-reply button. Sends label text as a reply.
urllabel, urlOpens the URL in the browser.
copylabel, valueCopies value to clipboard.
pixlabel, valueSame as copy but with a Pix icon.

Rendering Rules

  • Up to 3 buttons: render inline under the message.
  • More than 3: render a "More" button that opens a modal.
  • Location: renders name/address with a link to open in a map app.
  • vCard: renders a contact card with name, phone, and organization.

Sending a Rich Message

cURL
curl -X POST https://api.ixblix.app/api/messages/company \
  -H "X-API-Key: smci_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "conversationId": "conv_xxxx",
    "content": "<encrypted text>",
    "iv": "...",
    "authTag": "...",
    "encryptedKey": "...",
    "selfEncryptedKey": "...",
    "keyId": "...",
    "attachments": "<encrypted JSON string>"
  }'

The backend stores the ciphertext verbatim. It never decrypts or inspects the attachments.