v1

latestOpenAPI 3.0.02026-07-24378968.5 KB
Chat

/chat/{id}/messages

Send a message to a open chat

post/chat/{id}/messages

Path parameters

idstring required

Headers

octa-agent-emailstring

Request body

chatIdstring

Id of the chat that this message will be included

type'public' | 'internal' required

Indicate whether the message is intended for internal or public communication

bodystring

Message content

channel'whatsapp' | 'web' | 'facebook-messenger' | 'instagram' | 'email' | 'widget' required

Channel that this message is from

Example request

{
  "attachments": [
    {
      "name": "image.png",
      "base64": "iVBORw0KGgoAAAANSUhEUgAA...",
      "mimeType": "image/png",
      "url": "https://storage.googleapis.com/octadesk-bucket/files/document.pdf"
    }
  ],
  "mentions": [
    {
      "phoneContacts": {
        "number": "119999999999",
        "countryCode": "55"
      }
    }
  ]
}

Response

idstring required

Message identifier

chatIdstring required

Chat identifier

timestring date-time required

Message sending date

type'public' | 'internal' required

Indicate whether the message is intended for internal or public communication

bodystring required

Message content

readAtstring date-time

Date the message was read

status'sending' | 'sended' | 'received' | 'read' | 'error' | 'deleted' | 'scheduled' | 'spam' required

Message status

quotedobject

Message that was quoted

externalLinkstring

External links sent in the message

errorSourcestring

Source of the error (e.g. "meta", "platform") when status is "error"

errorCodestring

Error code returned by the provider (e.g. Meta/WhatsApp) when status is "error"

errorMessagestring

Detailed error message from the provider when status is "error"

Example response

{
  "sentBy": {
    "phoneContacts": {
      "number": "119999999999",
      "countryCode": "55"
    }
  },
  "mentions": [
    {
      "phoneContacts": {
        "number": "119999999999",
        "countryCode": "55"
      }
    }
  ]
}