API reference
Send a message
Queue a WhatsApp, SMS or email message on a channel bound to your consumer.
POST
https://inbobo.im/transport/api/v1/messagesFinds or creates the contact and conversation, then queues delivery. Idempotent per consumer and Idempotency-Key.
Headers
| Field | Type | Description |
|---|---|---|
Authorizationrequired | string | Bearer token: Bearer tpt_... |
Idempotency-Keyrequired | string | 16 to 128 characters. Reuse the same value when retrying. |
Content-Typerequired | string | application/json |
X-Request-Id | string | Optional trace id, echoed back. |
Body
| Field | Type | Description |
|---|---|---|
channel_idrequired | string | A channel id from GET /channels, for example ch_12. |
torequired | object | The recipient. { "wa_id": "..." } for WhatsApp, { "phone": "..." } for SMS, { "email": "..." } for email. |
messagerequired | object | The content. text, template or email depending on the channel. |
purposerequired | string | Why you are sending, for example utility, service_update, authentication. Stored for audit. |
consent_referencerequired | string | Your reference for the recipient's consent, such as an opt-in or checkout id. Stored for audit. |
attribution | object | { "app_id": "invoice" }. Stored for audit. |
correlation | object | Any JSON object. Returned unchanged on every status callback for this message. |
to
| Channel | Shape |
|---|---|
{ "wa_id": "255712345678" } digits only, 8 to 15, no + | |
| SMS | { "phone": "+255712345678" } |
{ "email": "a@b.com", "name": "Amina", "cc": [], "bcc": [] } |
message
| Type | Channels | Fields |
|---|---|---|
text | WhatsApp (inside 24h), SMS | text (required, up to 4,096 characters) |
template | template.name, template.language, template.parameters | |
email | subject, text (required), html |
See the channel guides for details: WhatsApp, SMS, Email.
Example
curl -X POST https://inbobo.im/transport/api/v1/messages \
-H "Authorization: Bearer $INBOBO_TOKEN" \
-H "Idempotency-Key: order-1042-shipped-v1" \
-H "Content-Type: application/json" \
-d '{
"channel_id": "ch_12",
"to": { "wa_id": "255712345678" },
"message": {
"type": "template",
"template": {
"name": "order_shipped",
"language": "en_US",
"parameters": [{ "name": "1", "value": "Amina" }, { "name": "2", "value": "1042" }]
}
},
"purpose": "utility",
"consent_reference": "checkout-1042"
}'Response
202 Accepted. The same body is returned when a retry replays an earlier request.
{
"message_id": "msg_981",
"status": "accepted",
"channel_id": "ch_12",
"provider_message_id": null,
"request_id": "req_3f1c2a64-7d0e-4b0b-9e55-1f6a0c0a9b21"
}| Field | Type | Description |
|---|---|---|
message_id | string | Use it with GET /messages/:id. It appears on every callback. |
status | string | accepted on a first call. On a replay, the current status. |
channel_id | string | The channel used. |
provider_message_id | string | null | The provider's id once known. |
request_id | string | The request id, for tracing and support. |
Errors
400 VALIDATION_ERRORinvalid or missing field, unapproved template, wrong message type for the channel401 UNAUTHORIZEDbad token403 CHANNEL_NOT_FOUNDchannel not bound to your consumer409 IDEMPOTENCY_MISMATCHkey reused with a different payload422 WINDOW_CLOSEDWhatsApp text outside the 24-hour window
See Errors for what to do about each.