Skip to main content
POST
Send a template message

Authorizations

Authorization
string
header
required

Authorization: Bearer

Headers

Idempotency-Key
string

A 1 to 128 printable-ASCII-character key you generate, scoped to your API key. Replaying the same key returns the original 202 response unchanged, with the response header Idempotent-Replayed: true: nothing is sent or charged again. A send that fails with 502 releases the key. Use one key per business event (order-1042-received) and retry a 502 or a network error with the same key.

Body

application/json
to
string
required

The destination: a Saudi mobile in any of the accepted formats, stored as E.164.

template
string
required

The template name exactly as WhatsApp Manager lists it, 1 to 512 characters. It must be approved on the number's WhatsApp Business Account; authentication templates are refused (one-time codes go through Verify).

lang
string

The template language as Meta lists it (ar, en, en_US). Required when the template exists in more than one language.

params
object

Placeholder values for the body: the keys are the placeholder names of a named template ({{name}}), or "1", "2" for a positional one ({{1}}). Every placeholder is required, extra keys are refused, values are strings of 1 to 1024 characters. GET /v1/whatsapp/templates lists the placeholders of each template.

header
object

{ "text": "…" }: the value of the text header's placeholder. Required when the template has one, refused otherwise; no newlines. Media headers are not supported yet.

buttons
array

[{ "index": 0, "parameter": "…" }]: the dynamic suffix of each URL button, one entry per button that has a placeholder; index is the button's position among the template's buttons.

reference
string

Your own reference (order id, event id), 1 to 64 printable characters. Echoed back, and searchable in the Messages log of the console.

application
string

Partner keys only: which of your provisioned applications is sending, as on start.

Response

Accepted

id
string
status
string
to
string
template
string
lang
string
reference
string
price_halalas
integer
created_at
string<date-time>