InboboDocsMenu

API reference

Send a message

Queue a WhatsApp, SMS or email message on a channel bound to your consumer.

POSThttps://inbobo.im/transport/api/v1/messages

Finds or creates the contact and conversation, then queues delivery. Idempotent per consumer and Idempotency-Key.

Headers

FieldTypeDescription
AuthorizationrequiredstringBearer token: Bearer tpt_...
Idempotency-Keyrequiredstring16 to 128 characters. Reuse the same value when retrying.
Content-Typerequiredstringapplication/json
X-Request-IdstringOptional trace id, echoed back.

Body

FieldTypeDescription
channel_idrequiredstringA channel id from GET /channels, for example ch_12.
torequiredobjectThe recipient. { "wa_id": "..." } for WhatsApp, { "phone": "..." } for SMS, { "email": "..." } for email.
messagerequiredobjectThe content. text, template or email depending on the channel.
purposerequiredstringWhy you are sending, for example utility, service_update, authentication. Stored for audit.
consent_referencerequiredstringYour reference for the recipient's consent, such as an opt-in or checkout id. Stored for audit.
attributionobject{ "app_id": "invoice" }. Stored for audit.
correlationobjectAny JSON object. Returned unchanged on every status callback for this message.

to

ChannelShape
WhatsApp{ "wa_id": "255712345678" } digits only, 8 to 15, no +
SMS{ "phone": "+255712345678" }
Email{ "email": "a@b.com", "name": "Amina", "cc": [], "bcc": [] }

message

TypeChannelsFields
textWhatsApp (inside 24h), SMStext (required, up to 4,096 characters)
templateWhatsApptemplate.name, template.language, template.parameters
emailEmailsubject, 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.

202 Accepted
{
  "message_id": "msg_981",
  "status": "accepted",
  "channel_id": "ch_12",
  "provider_message_id": null,
  "request_id": "req_3f1c2a64-7d0e-4b0b-9e55-1f6a0c0a9b21"
}
FieldTypeDescription
message_idstringUse it with GET /messages/:id. It appears on every callback.
statusstringaccepted on a first call. On a replay, the current status.
channel_idstringThe channel used.
provider_message_idstring | nullThe provider's id once known.
request_idstringThe request id, for tracing and support.

Errors

  • 400 VALIDATION_ERROR invalid or missing field, unapproved template, wrong message type for the channel
  • 401 UNAUTHORIZED bad token
  • 403 CHANNEL_NOT_FOUND channel not bound to your consumer
  • 409 IDEMPOTENCY_MISMATCH key reused with a different payload
  • 422 WINDOW_CLOSED WhatsApp text outside the 24-hour window

See Errors for what to do about each.