Errors and rate limits
The shape of an error
Section titled “The shape of an error”{ "error": { "code": "WINDOW_CLOSED", "message": "Free-form messages are only delivered within 24 hours of the recipient's last message. Send a template instead." } }A validation failure adds details — the offending fields, one entry each.
| HTTP | Code | Means |
|---|---|---|
| 400 | BAD_REQUEST |
the body or query did not validate; see details |
| 400 | MISSING_VARIABLES |
a template variable was omitted or blank |
| 400 | MISSING_HEADER_MEDIA |
the template’s header takes a file and headerMedia was not given |
| 400 | MISSING_BUTTON_PARAMS |
a URL button ends in {{1}} and urlButtonParams has no value for it |
| 400 | BAD_BUTTON_PARAMS |
a campaign’s button value is not usable: an Any link (tracked) button needs a full https link, any other an ending without spaces |
| 400 | BUTTON_NOT_TRACKABLE |
a campaign tracks a button whose domain is fixed; only an Any link (tracked) button can be tracked |
| 400 | UNEXPECTED_HEADER_MEDIA |
headerMedia on a template whose header takes no file |
| 400 | UNSUPPORTED_MEDIA_TYPE |
WhatsApp does not accept that file type |
| 400 | MEDIA_TOO_LARGE |
the file is past WhatsApp’s size limit for its kind |
| 400 | WRONG_HEADER_MEDIA_TYPE |
the file is not the kind the template’s header takes |
| 400 | HEADER_MEDIA_GONE |
Meta no longer has the file a campaign attached; it keeps an upload for 30 days |
| 400 | HEADER_MEDIA_WRONG_NUMBER |
the campaign’s file was uploaded for a number it no longer sends from |
| 401 | UNAUTHORIZED |
no key on the request |
| 401 | INVALID_API_KEY |
unknown, revoked or expired key |
| 403 | FORBIDDEN |
the key lacks the scope this route needs |
| 403 | TENANT_SUSPENDED |
the workspace is suspended |
| 404 | NOT_FOUND |
no such message, or not yours |
| 404 | TEMPLATE_NOT_FOUND |
no template with that name and language |
| 404 | NUMBER_NOT_FOUND |
from is not one of your numbers |
| 409 | WINDOW_CLOSED |
free text or media with no open 24-hour window |
| 409 | TEMPLATE_NOT_APPROVED |
Meta has not approved that template |
| 409 | TEMPLATE_NOT_ENABLED |
that template is switched off for this workspace in the console |
| 409 | SEND_IN_PROGRESS |
a send with this idempotencyKey is still in flight. Retry shortly with the same key to get its result |
| 409 | CALL_ALREADY_ANSWERED |
somebody answered that call first. Not a failure, and never retry it |
| 400 | CALL_PERMISSION_REQUIRED |
they have not agreed to be called from this number |
| 409 | NUMBER_NOT_REGISTERED |
that number has not finished registering with Meta |
| 409 | CHANNEL_NOT_CONFIGURED |
no number of yours can send yet |
| 409 | MEDIA_NOT_ARCHIVED |
sent as a link, and the copy has not been taken yet |
| 410 | MEDIA_EXPIRED |
the attachment was never archived and Meta’s 30 days have run out |
| 410 | MEDIA_UNAVAILABLE |
the attachment is not archived yet and Meta would not serve it |
| 429 | TOO_MANY_REQUESTS |
over the per-key rate limit |
| 500 | INTERNAL_ERROR |
our fault. Retry with the same idempotencyKey |
| 502 | MEDIA_UNAVAILABLE |
Meta could not be reached for those bytes |
| 502 | META_UPLOAD_FAILED |
Meta refused the upload. The message says why |
What to retry
Section titled “What to retry”429, 500 and 502 are worth retrying with backoff — always with the same
idempotencyKey, so a retry of a send that actually succeeded does not send twice.
409 SEND_IN_PROGRESS is the exception among 4xx: the first send with that key has not
finished. It carries Retry-After: 1; retry with the same key after that and you get its
result. The client library does this for you.
4xx other than 429 and SEND_IN_PROGRESS will not improve on a second attempt. Fix the request.
A message that comes back FAILED with the code SEND_OUTCOME_UNKNOWN was interrupted
while it was being sent, so it is not known whether it reached the recipient. It is never
sent again on its own; check before you send a new one under a different key.
Rate limits
Section titled “Rate limits”Per key, not per IP address, so one workspace’s traffic is its own.
| Surface | Limit |
|---|---|
| sending and template preview | 60 requests / minute |
| building and running campaigns | 60 requests / minute |
| every read — message log, media, discovery, calls, campaigns | 240 requests / minute |
GET /key |
30 requests / minute, per IP address |
Over the limit answers 429 TOO_MANY_REQUESTS. The counter is keyed on the key’s prefix,
so spreading your traffic across more servers does not buy more of it, and another
workspace behind the same egress cannot spend yours.
GET /key is the exception, and is counted per address: a route that confirms whether a
credential is real is the natural target for guessing at them, and a per-key limit buys
nothing against a caller who tries a different key every time. Call it on boot or on a
health check, not per request — and read the two limits above out of its response rather
than hard-coding them.