Messages
Send a template
# Send a template
A template Meta approved: the way to start a conversation when the customer has not written for 24 hours. The values in `parameters` go in the order of the template's placeholders, and for a template with named placeholders they may be an object. The values are strings, up to 100 of them, each up to 1,024 characters. A number that has not written needs recorded consent. Templates exist only on WhatsApp, so `channel` is `whatsapp`.
## Headers
- `Idempotency-Key` (string): Makes a retry safe: the same key with the same body within 24 hours returns the first response and sends nothing again. Use an id of your own for the message, for example the order number. Up to 255 characters, not blank.
## Body
- `to` (string, required): The customer's number in E.164, for example `+77011234567`. Up to 32 characters.
- `channel` (string, required): `whatsapp`: templates exist only there.
- `type` (string, required): `template`.
- `template.name` (string, required): The template's name, as `GET /v1/templates` lists it. Up to 512 characters.
- `template.language` (string, required): The template's language code, as `GET /v1/templates` lists it. Up to 15 characters.
- `template.parameters` (array or object): The values for the template's placeholders in their order, or an object by name for named placeholders. Up to 100 strings of up to 1,024 characters.
## Errors
| Code | HTTP | What it means |
| --- | --- | --- |
| `invalid_request` | 422 | The request is not filled in correctly. |
| `invalid_phone` | 422 | Give the number in international format, for example +77011234567. |
| `channel_unavailable` | 422 | The channel is unavailable: it is not connected to the workspace or was disconnected. Connect it on the workspace's Channels page. |
| `payment_required` | 402 | The channel is unpaid, so sending on it is stopped. |
| `channel_unresolved` | 422 | The customer has not written to you on any connected channel, so auto cannot choose one. Name the channel, for example whatsapp. |
| `template_unsupported` | 422 | Templates exist only on WhatsApp. On this channel send text, or send the template with channel whatsapp. |
| `template_not_found` | 422 | There is no approved template with this name and language. GET /v1/templates lists the approved ones. |
| `template_parameters` | 422 | The values do not fit the template: it needs one value, not empty, for each placeholder. |
| `no_consent` | 422 | The customer has not agreed to hear from you. Once they agree, record it with POST /v1/contacts/{phone}/consent. |
| `opted_out` | 422 | The customer asked not to be written to, so you may not write to them first. |
| `messaging_limit` | 422 | The number has used up its daily WhatsApp limit: in the last 24 hours it has already written first to as many customers as Meta allows, from 50 to 100,000 depending on the number's tier. You can write to new customers again once the first of those messages are 24 hours old, and you can answer anyone who wrote to you in the last 24 hours right now. Meta raises the limit on its own while message quality stays high. |
| `meta_payment` | 422 | Meta is not sending messages: the WhatsApp account has no working card. Add a card at Meta and try again. |
| `idempotency_mismatch` | 422 | This Idempotency-Key came with a different request before. Use a new key for a new message. |
| `idempotency_in_progress` | 409 | A request with this Idempotency-Key is still running. Try again in a moment. |
## Response 201
```json
{
"id": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
"to": "+77011234567",
"contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
"channel": "whatsapp",
"type": "template",
"template": {
"name": "order_ready",
"language": "ru",
"parameters": [
"Asel",
"1042"
]
},
"status": "sent",
"error": null,
"sent_by": "api",
"created_at": "2026-10-09T09:30:00+00:00",
"sent_at": "2026-10-09T09:30:00+00:00",
"delivered_at": null,
"read_at": null
}
```
POST /v1/messages
WhatsApp onlyA template Meta approved: the way to start a conversation when the customer has not written for 24 hours. The values in parameters go in the order of the template's placeholders, and for a template with named placeholders they may be an object. The values are strings, up to 100 of them, each up to 1,024 characters. A number that has not written needs recorded consent. Templates exist only on WhatsApp, so channel is whatsapp.
A template to a number that has not written yet needs the customer's consent first, recorded with POST /v1/contacts/{phone}/consent.
Returns the message object.
Headers
-
Idempotency-Keystring - Makes a retry safe: the same key with the same body within 24 hours returns the first response and sends nothing again. Use an id of your own for the message, for example the order number. Up to 255 characters, not blank.
Body
-
tostring required - The customer's number in E.164, for example
+77011234567. Up to 32 characters. -
channelstring required whatsapp: templates exist only there.-
typestring required template.-
template.namestring required - The template's name, as GET /v1/templates lists it. Up to 512 characters.
-
template.languagestring required - The template's language code, as GET /v1/templates lists it. Up to 15 characters.
-
template.parametersarray or object - The values for the template's placeholders in their order, or an object by name for named placeholders. Up to 100 strings of up to 1,024 characters.
Errors
| Code | HTTP | What it means |
|---|---|---|
invalid_request | 422 | The request is not filled in correctly. |
invalid_phone | 422 | Give the number in international format, for example +77011234567. |
channel_unavailable | 422 | The channel is unavailable: it is not connected to the workspace or was disconnected. Connect it on the workspace's Channels page. |
payment_required | 402 | The channel is unpaid, so sending on it is stopped. |
channel_unresolved | 422 | The customer has not written to you on any connected channel, so auto cannot choose one. Name the channel, for example whatsapp. |
template_unsupported | 422 | Templates exist only on WhatsApp. On this channel send text, or send the template with channel whatsapp. |
template_not_found | 422 | There is no approved template with this name and language. GET /v1/templates lists the approved ones. |
template_parameters | 422 | The values do not fit the template: it needs one value, not empty, for each placeholder. |
no_consent | 422 | The customer has not agreed to hear from you. Once they agree, record it with POST /v1/contacts/{phone}/consent. |
opted_out | 422 | The customer asked not to be written to, so you may not write to them first. |
messaging_limit | 422 | The number has used up its daily WhatsApp limit: in the last 24 hours it has already written first to as many customers as Meta allows, from 50 to 100,000 depending on the number's tier. You can write to new customers again once the first of those messages are 24 hours old, and you can answer anyone who wrote to you in the last 24 hours right now. Meta raises the limit on its own while message quality stays high. |
meta_payment | 422 | Meta is not sending messages: the WhatsApp account has no working card. Add a card at Meta and try again. |
idempotency_mismatch | 422 | This Idempotency-Key came with a different request before. Use a new key for a new message. |
idempotency_in_progress | 409 | A request with this Idempotency-Key is still running. Try again in a moment. |
Any request can also get the codes on Errors, such as unauthenticated and rate_limited.