InboboDocsMenu

Channels

WhatsApp

Send approved templates any time, and free text inside the 24-hour customer-service window.

Recipient

Address the customer with to.wa_id: their international number as digits only, 8 to 15 digits, no + and no leading zero.

to
{ "wa_id": "255712345678" }

The contact and conversation are found or created for you. A number you have messaged before reuses its existing conversation as long as that conversation is still open.

Template messages

Templates are the only way to start a conversation, or to reach someone who has not written to you in the last 24 hours. The template must be approved on the channel in the exact language you request, otherwise the call fails with 400 VALIDATION_ERROR.

message
{
  "type": "template",
  "template": {
    "name": "order_shipped",
    "language": "en_US",
    "parameters": [
      { "name": "1", "value": "Amina" },
      { "name": "2", "value": "1042" }
    ]
  }
}
FieldTypeDescription
template.namerequiredstringThe approved template name.
template.languagerequiredstringThe exact template language code, for example en_US or sw. en does not match en_US.
template.parametersarrayValues for the template variables. Use "1", "2" for positional templates, or the variable name for named templates. Omit name to fill positionally in array order.
template.processed_paramsobjectHeader, body and button parameters (header, body, buttons), used instead of parameters for templates with media headers or buttons.

Text messages and the 24-hour window

Free text is only allowed when the customer has messaged you within the last 24 hours. Send it like this:

message
{ "type": "text", "text": "Your invoice is ready." }

Outside the window the call returns 422 WINDOW_CLOSED and nothing is created or sent. Catch that code and send a template instead:

422 Unprocessable Entity
{ "code": "WINDOW_CLOSED", "message": "The 24-hour service window is closed. Send an approved template instead." }

A new contact who has never written to you is always outside the window, so the first message to them must be a template. text is limited to 4,096 characters.

Delivery status

WhatsApp reports sent, delivered and read, or failed with an error. You receive these as callbacks, or can read them with GET /messages/:id.