Messages
Send text
# Send text
Free text to a customer who wrote to you in the last 24 hours, on the channel named in `channel`: `whatsapp`, `instagram`, or `auto` for the one the customer last wrote on. `to` is the customer's number on WhatsApp, or the `from` of their message on Instagram. The text is up to 4,096 characters. A 201 response means the message was accepted and handed to the channel, and 202 with status `queued` that it waits its turn within Meta's limits and goes on its own. If it did not go, the response is 422 with the reason in `error.code` and the `message_id`.
## 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: an E.164 number on WhatsApp, or the `from` of their message on Instagram. Up to 32 characters.
- `channel` (string, required): `whatsapp`, `instagram`, or `auto` for the channel the customer last wrote on.
- `type` (string, required): `text`.
- `text.body` (string, required): The text, up to 4,096 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. |
| `recipient_unknown` | 422 | This person has not written on Instagram yet. Put the `from` of their message in `to`. |
| `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. |
| `outside_window` | 422 | The customer has not written to you in the last 24 hours, and WhatsApp lets free text through only as a reply. Send an approved template. |
| `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": "text",
"text": {
"body": "Hello! Your order #1042 is ready, and you can pick it up today until 8 pm."
},
"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
Free text to a customer who wrote to you in the last 24 hours, on the channel named in channel: whatsapp, instagram, or auto for the one the customer last wrote on. to is the customer's number on WhatsApp, or the from of their message on Instagram. The text is up to 4,096 characters. A 201 response means the message was accepted and handed to the channel, and 202 with status queued that it waits its turn within Meta's limits and goes on its own. If it did not go, the response is 422 with the reason in error.code and the message_id.
Free text reaches a customer only within 24 hours of their last message. Otherwise the response is 422 outside_window and a template is needed.
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: an E.164 number on WhatsApp, or the
fromof their message on Instagram. Up to 32 characters. -
channelstring required whatsapp,instagram, orautofor the channel the customer last wrote on.-
typestring required text.-
text.bodystring required - The text, up to 4,096 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. |
recipient_unknown | 422 | This person has not written on Instagram yet. Put the from of their message in to.
|
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. |
outside_window | 422 | The customer has not written to you in the last 24 hours, and WhatsApp lets free text through only as a reply. Send an approved template. |
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.