API reference

Messages

Send (asynchronous), check the status and list the history.

View this page as Markdown

Send a message (accepted immediately, sent asynchronously)#

POST/messages

Authentication
API key (Bearer pk_…), or console session (Bearer ses_… with the X-Environment-Id header)
Required scope
messages:send

Parameters

NameLocationTypeDescription
Idempotency-KeyheaderstringReplaying the same request with the same key never sends the message twice.

Request body (JSON)

FieldTypeDescription
phoneNumberIdstringrequiredID of the number (returned by /connected-businesses/:id/phone-numbers)
tostringrequiredRecipient, international format
typestringrequiredMessage type: text, template, image, video, audio, document or location.Values: text, template, image, document, video, audio, location
textobjectoptionalFor type: text: { body, previewUrl? }. The body is 1 to 4,096 characters. Requires an open conversation (24-hour window).
templateobjectoptionalFor type: template: { name, language, components? }. The template must be approved by Meta.
imageobjectoptionalFor type: image: { link | id, caption? }. link is a public https URL, id is a media already hosted by Meta.
videoobjectoptionalFor type: video: { link | id, caption? }.
audioobjectoptionalFor type: audio: { link | id }.
documentobjectoptionalFor type: document: { link | id, caption?, filename? }.
locationobjectoptionalFor type: location: { latitude, longitude, name?, address? }.

Example

bash
curl -X POST "$INBOX_API/messages" \
  -H "Authorization: Bearer $INBOX_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: rdv-2026-11-14-client-42" \
  -d '{
    "phoneNumberId": "4d8e654e-d744-4bf3-8211-9ceffcccfe87",
    "to": "+237600000000",
    "type": "template",
    "template": {
      "name": "appointment_reminder",
      "language": "en",
      "components": [
        {
          "type": "body",
          "parameters": [
            {
              "type": "text",
              "text": "Awa"
            },
            {
              "type": "text",
              "text": "November 14 at 10 am"
            }
          ]
        }
      ]
    }
  }'
Response · 202 Accepted
{
  "id": "d5ad1e3e-6ab9-4f7f-8e4e-b17104a7bd00",
  "direction": "outbound",
  "status": "queued",
  "type": "template",
  "phoneNumberId": "4d8e654e-d744-4bf3-8211-9ceffcccfe87",
  "to": "237600000000",
  "waMessageId": null,
  "content": {
    "type": "template",
    "template": {
      "name": "appointment_reminder",
      "language": "en",
      "components": [
        {
          "type": "body",
          "parameters": [
            {
              "type": "text",
              "text": "Awa"
            },
            {
              "type": "text",
              "text": "November 14 at 10 am"
            }
          ]
        }
      ]
    }
  },
  "error": null,
  "createdAt": "2026-11-12T08:33:45.855Z",
  "sentAt": null,
  "deliveredAt": null,
  "readAt": null
}

Message history (paginated, newest first)#

GET/messages

Authentication
API key (Bearer pk_…), or console session (Bearer ses_… with the X-Environment-Id header)
Required scope
messages:read

Parameters

NameLocationTypeDescription
phoneNumberIdquerystringID of the sending number (the id field of a number, returned by /connected-businesses/{id}/phone-numbers).
directionquerystringFilter by direction: inbound (received) or outbound (sent).Values: inbound, outbound
statusquerystringFilter by status: queued, sent, delivered, read, failed or received.Values: queued, sent, delivered, read, failed, received
limitquerynumberNumber of items per page, from 1 to 100.
cursorquerystringnextCursor value from the previous page

Example

bash
curl "$INBOX_API/messages" \
  -H "Authorization: Bearer $INBOX_KEY"
Response · 200 OK
{
  "data": [
    {
      "id": "a9691d7a-ee51-4da9-87b2-24cce79a9313",
      "direction": "outbound",
      "status": "sent",
      "type": "location",
      "phoneNumberId": "4d8e654e-d744-4bf3-8211-9ceffcccfe87",
      "to": "237611111111",
      "waMessageId": "wamid.HBgMXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "content": {
        "type": "location",
        "location": {
          "name": "Cabinet Dentaire Zokem",
          "address": "Akwa, Douala",
          "latitude": 4.0511,
          "longitude": 9.7679
        }
      },
      "error": null,
      "createdAt": "2026-11-12T08:33:46.131Z",
      "sentAt": "2026-11-12T08:33:46.251Z",
      "deliveredAt": null,
      "readAt": null
    },
    {
      "id": "9e09a76b-537b-4d5f-8454-4305ba8748a6",
      "direction": "outbound",
      "status": "sent",
      "type": "document",
      "phoneNumberId": "4d8e654e-d744-4bf3-8211-9ceffcccfe87",
      "to": "237611111111",
      "waMessageId": "wamid.HBgMXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "content": {
        "type": "document",
        "media": {
          "link": "https://example.com/ordonnance.pdf",
          "caption": "Your prescription",
          "filename": "ordonnance.pdf"
        }
      },
      "error": null,
      "createdAt": "2026-11-12T08:33:46.098Z",
      "sentAt": "2026-11-12T08:33:46.221Z",
      "deliveredAt": null,
      "readAt": null
    }
  ],
  "nextCursor": "MjAyNi0xMS0xMlQwODozMzo0Ni4wOThafGMwYmU4NDdlLWQyNDQtNGUyOS04N2M1LTAyNTE3ODk1Yzg5OQ"
}

Get a message's status#

GET/messages/{id}

Authentication
API key (Bearer pk_…), or console session (Bearer ses_… with the X-Environment-Id header)
Required scope
messages:read

Parameters

NameLocationTypeDescription
idrequiredpathstringMessage ID.

Example

bash
curl "$INBOX_API/messages/ID" \
  -H "Authorization: Bearer $INBOX_KEY"
Response · 200 OK
{
  "id": "d5ad1e3e-6ab9-4f7f-8e4e-b17104a7bd00",
  "direction": "outbound",
  "status": "sent",
  "type": "template",
  "phoneNumberId": "4d8e654e-d744-4bf3-8211-9ceffcccfe87",
  "to": "237600000000",
  "waMessageId": "wamid.HBgMXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "content": {
    "type": "template",
    "template": {
      "name": "appointment_reminder",
      "language": "en",
      "components": [
        {
          "type": "body",
          "parameters": [
            {
              "text": "Awa",
              "type": "text"
            },
            {
              "text": "November 14 at 10 am",
              "type": "text"
            }
          ]
        }
      ]
    }
  },
  "error": null,
  "createdAt": "2026-11-12T08:33:45.855Z",
  "sentAt": "2026-11-12T08:33:45.891Z",
  "deliveredAt": null,
  "readAt": null
}