API reference

Sandbox

Simulate incoming messages and status changes, without WhatsApp.

View this page as Markdown

Simulate a message received from a customer (sandbox keys only). Triggers the `message.received` webhook.#

POST/sandbox/simulate/inbound-message

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

Request body (JSON)

FieldTypeDescription
phoneNumberIdstringrequiredID of a number in the sandbox environment.
fromstringrequiredNumber of the simulated sender, international format with “+”.
textstringrequiredText of the simulated message.

Example

bash
curl -X POST "$INBOX_API/sandbox/simulate/inbound-message" \
  -H "Authorization: Bearer $INBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumberId": "4d8e654e-d744-4bf3-8211-9ceffcccfe87",
    "from": "+237611111111",
    "text": "Hello, I'\''d like to reschedule my appointment"
  }'
Response · 201 Created
{
  "messageId": "3f3baf5a-f93e-42e8-8263-ce62dc4aadd6",
  "from": "237611111111",
  "status": "received",
  "simulated": true
}

Advance the status of an outbound message (sandbox keys only). Triggers the matching webhook.#

POST/sandbox/simulate/message-status

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

Request body (JSON)

FieldTypeDescription
messageIdstringrequiredID of an outbound message in the sandbox environment.
statusstringrequiredNew status: sent, delivered, read or failed. A status never goes backwards, as with Meta.Values: sent, delivered, read, failed

Example

bash
curl -X POST "$INBOX_API/sandbox/simulate/message-status" \
  -H "Authorization: Bearer $INBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messageId": "d5ad1e3e-6ab9-4f7f-8e4e-b17104a7bd00",
    "status": "delivered"
  }'
Response · 200 OK
{
  "messageId": "d5ad1e3e-6ab9-4f7f-8e4e-b17104a7bd00",
  "status": "delivered",
  "simulated": true
}