/whatsappScope: whatsapp:sendSend a transactional WhatsApp message
Sends one approved WhatsApp template of your organization (an order update, an appointment reminder, a verification code) to a phone number or to a subscriber, from your connected WhatsApp number. Only **utility** and **authentication** templates: a marketing template is refused with `422 template_category_not_allowed` (advertising goes as a campaign, where its legal hours and frequency limits apply). Pick the template by `template` (its name) and `language` (required only when the template exists in several languages). `values` fill its variables: `header` (text), `body` (one string per `{{n}}`, in order) and `buttons` (the end of a URL button with a variable, keyed by the button position); for an authentication template, only `code` (at most 15 characters), which WhatsApp shows with its copy button. **Opt-in.** WhatsApp requires that the person agreed to receive messages from your business before you write first. A utility template goes only to a number with WhatsApp permission recorded in your organization: a subscriber whose `channels.whatsapp` is `active` (record it with `channels.whatsapp.consent` in `POST /lists/{id}/subscribers` or `PATCH /subscribers/{id}`); otherwise `422 consent_required`. An authentication template may go to any number, because the person has just asked for the code; then the phone number is not stored. A number that opted out of your WhatsApp messages receives nothing, not even a code (`422 recipient_suppressed`). Status updates (`delivered`, `read`, `failed`) arrive with `GET /whatsapp/{id}` and as the webhook events `whatsapp.delivered`, `whatsapp.read` and `whatsapp.failed`. WhatsApp bills each delivered message to your WhatsApp account, as in campaigns. Limits (`429 rate_limited`): per organization and minute, per number and hour (lower for authentication) and the number of people your WhatsApp number may contact in 24 hours. Only available to organizations with WhatsApp in their plan and a connected number.
Accepts Idempotency-Key.
Request body (application/json)
Responses
202Accepted by WhatsApp. The delivery and read receipts arrive later.400`invalid_request` — `param` names the field (`to`, `contact_id`, `template`, `language`, `values`, or the value, such as `values.body.0` or `values.code`); also when WhatsApp rejected the values or the number cannot receive the message. Nothing was sent.403`channel_not_available` — WhatsApp is not enabled for your organization (it comes with paid plans); `sending_paused` — sending is paused for your organization (while Tellwing reviews its activity, because of its bounce or complaint rate, or until updated legal documents are accepted), nothing was sent; `forbidden_scope` — the key lacks `whatsapp:send`.404`not_found` — no template with that name (`param: template`) or language (`param: language`), or no subscriber with that `contact_id`.409`template_not_approved` — the template is pending, rejected, paused or disabled in WhatsApp; `channel_not_available` — no WhatsApp number connected and ready, WhatsApp restricted the account, or WhatsApp is not letting the account start conversations (for example, a payment method or display name pending in WhatsApp Manager; Settings → WhatsApp shows why). Nothing was sent.422`template_category_not_allowed` — a marketing template (send it as a campaign); `consent_required` — the number or subscriber has no WhatsApp permission recorded in your organization (utility templates); `recipient_suppressed` — the number opted out of your WhatsApp messages. Nothing was sent.429`rate_limited` — too many WhatsApp messages for your organization in the last minute or to that number in the last hour, your number reached the people it may contact in 24 hours, too many requests, or WhatsApp asked to slow down. Nothing was sent.502`internal_error` — WhatsApp did not accept the message for an unexpected reason. Nothing was sent.503`channel_not_available` — WhatsApp is not accepting messages from your account right now for another account reason. Nothing was sent.