Send a free-form WhatsApp text message
POST/v1/whatsapp/messages
x-scope: "whatsapp:send"
Free-form text is restricted to Meta's 24-hour customer-service window
(the customer must have messaged the agent within the last 24 hours).
Outside the window, use POST /v1/whatsapp/templates instead.
Name the customer with exactly one of to (their phone, E.164) or recipient_username
(their WhatsApp username, for a customer who hides their number behind one): neither is
422 recipient_required, both is 422 recipient_conflict. WhatsApp only
lets a business reach a username after its owner has written first, so a username is found
among the customers who messaged this WhatsApp number, or another of the agent's numbers on
the same WhatsApp Business Account; one that never did is 422 recipient_not_found.
The agent is the body's agent_id, judged as on every agent endpoint: an API key needs it on
its agent list; an AI assistant needs full access, and the person it acts for must have that
agent as a member, admin or owner. An agent_id that is missing or not a UUID is
422 invalid_agent_id.
Request
Responses
- 202
- 401
- 402
- 403
- 404
- 409
- 413
- 422
- 429
- 500
Accepted for asynchronous processing. The message is queued; final
delivery happens via the WhatsApp Business Cloud API. Poll
GET /v1/whatsapp/messages/{id} to track status.
Response Headers
Correlation id for this request — paste into support tickets.
Present and true when the response is a replay of a prior request.
Authentication failed. Single code (invalid_api_key) covers every
sub-case: missing header, wrong scheme, malformed, unknown, revoked or
expired key. The message field disambiguates for humans debugging.
One exception: when the key could not be checked because of a server-side
fault, the status is still 401 but type is internal_error and code
is internal_server_error; retry with backoff.
Response Headers
Correlation id for this request — paste into support tickets.
Reserved. The organization's monthly message quota is exhausted. Quota
enforcement for API sends is switched off today, so this response does
not occur yet; it is documented so clients handle it once enforcement is
enabled. limit, used and resets_at carry the numbers.
Response Headers
Correlation id for this request — paste into support tickets.
insufficient_scope (the key lacks whatsapp:send, or the AI assistant was connected with
read-only access), agent_not_authorized (the key is limited to agents other than agent_id),
agent_not_granted (the person an AI assistant acts for has no access to that agent) or
insufficient_role (that person is a rep: sending to any number is beyond their own chats).
Response Headers
Correlation id for this request — paste into support tickets.
agent_not_found when agent_id is not one of your company's agents (the API never
confirms whether another company's agent exists).
Response Headers
Correlation id for this request — paste into support tickets.
A request with this Idempotency-Key is still running, or one with it
that was refused or failed after claiming the key (for example a
422 messaging_window_closed on sendConversationMessage) started less
than 60 seconds ago (whatever the body). Wait Retry-After seconds and
retry, or send a corrected request with a new key.
Response Headers
Correlation id for this request — paste into support tickets.
Seconds to wait before retrying.
The request body is larger than 1 MB.
Response Headers
Correlation id for this request — paste into support tickets.
invalid_request_body when the body isn't valid JSON, a field has the wrong type or
format, or a field breaks a limit in its schema; param names the field.
invalid_agent_id (agent_id isn't a UUID), invalid_from_phone (from isn't
E.164), recipient_required (neither to nor recipient_username),
recipient_conflict (both to and recipient_username),
invalid_phone_number (to isn't E.164), from_phone_not_found_for_agent
(from isn't one of the agent's active WhatsApp numbers; available_phones lists
them), recipient_not_found (no customer with recipient_username has messaged the
agent's WhatsApp numbers on this account), media_url_invalid (media_url can't be read, isn't a file a message carries, or
names no upload of the agent), template_header_media_url_invalid (a template's
header_media_url names no usable upload) and idempotency_key_in_use_with_different_params
(an Idempotency-Key reused with another body or on another endpoint).
Response Headers
Correlation id for this request — paste into support tickets.
Per-key rate limit hit. Default is 60/min/key; an endpoint with an
x-rate-limit-per-minute of its own counts in a budget of its own
(today the WhatsApp template endpoints, sendBroadcast, retryBroadcast, inviteMember,
resendInvitation, uploadAttachmentMedia, importAttachmentMedia, createUpload and
importSavedReplyMedia, which share one that allows 10/min/key,
sendConversationMessage, which allows 20/min/key; putUploadContent takes no key and
allows the default 60/min per IP address), and its 429
reports that limit in X-RateLimit-Limit. Retry-After tells you when to retry;
X-RateLimit-Reset is the Unix timestamp of the next window.
Per-success-response
X-RateLimit-*headers are a known gap; on 2xx responses these headers are NOT currently emitted. Customers should rely on 429 +Retry-Afterfor backoff signals.
Response Headers
Correlation id for this request — paste into support tickets.
Seconds to wait before retrying.
The per-minute request limit of the endpoint called. Every key has the same limits today.
Remaining requests in the current window. 0 on rejection.
Unix timestamp at which the current window resets.
Unexpected server-side failure. Retry with exponential backoff. If
the failure persists, send us the correlation_id.
Response Headers
Correlation id for this request — paste into support tickets.