Responses and errors
Successful responses
Most calls answer with HTTP 200 and this envelope:
{
"message": "Success",
"data": { }
}
data is an object or an array, depending on the call. Sending a WhatsApp message answers 202 Accepted
(the message is queued). Media downloads return the file itself.
Error responses
Errors use the same envelope with an error object:
{
"message": "Authentication Failed.",
"error": {
"code": "UNAUTHORIZED",
"detail": "A valid API key or authentication token is required to access this resource."
}
}
| Field | Meaning |
|---|---|
message | Short human-readable summary |
error.code | Stable code for your program to check |
error.detail | More detail for a developer. Some older endpoints send error.details; read both. |
POST /v1/messages reports validation errors inside data:
{
"message": "One or more validation errors occurred.",
"data": [
{ "error": "Bad Request", "error_detail": "You can have a maximum of 3 reply buttons." }
]
}
HTTP status codes
| Status | Meaning | Retry? |
|---|---|---|
| 200 | Success | |
| 202 | Accepted and queued (WhatsApp send) | |
| 400 | Invalid request: missing field, wrong format, invalid JSON | No, fix the request |
| 401 | Missing or invalid API key or client token | No, fix the credential |
| 402 | Not enough credits | After a top-up |
| 403 | Plan does not include this feature, plan limit reached, account suspended, or resource not yours | No |
| 404 | Resource not found | No |
| 409 | Conflict, for example the resource already exists | No |
| 429 | Too many requests | Yes, with back-off |
| 500, 502, 503, 504 | Server or upstream (Meta) problem | Yes, with back-off |
Error codes
error.code | Typical status | Meaning |
|---|---|---|
UNAUTHORIZED | 401 | No valid API key or client token |
FORBIDDEN | 403 | Valid credential, action not allowed |
PLAN_FEATURE_NOT_INCLUDED | 403 | Your plan does not include this feature (for example API access, webhooks, MCP servers) |
WHATSAPP_NUMBER_LIMIT_REACHED | 403 | Your plan's WhatsApp number limit is reached |
ORG_ID_REQUIRED | 400 | The credential has no organization (contact support) |
INVALID_JSON_FORMAT | 400 | The request body is not valid JSON |
BAD_REQUEST | 400 | Invalid parameters |
VALIDATION_FAILED | 400 | One or more fields failed validation |
MISSING_REQUIRED_FIELD | 400 | A required field is missing |
INVALID_PARAMETER | 400 | A parameter has a wrong value |
RESOURCE_NOT_FOUND | 404 | The resource does not exist in your organization |
RESOURCE_ALREADY_EXISTS | 409 | A resource with the same key exists |
INSUFFICIENT_CREDITS | 402 | Not enough credits |
INTERNAL_SERVER_ERROR | 500 | Unexpected error; retry, then contact support with the time of the call |
Errors returned by Meta (for example an unapproved template, or a number that is not on WhatsApp) are passed
through in error.detail with Meta's own code and text.
Good practice
- Check the HTTP status first, then
error.code. Do not parsemessagetext. - Log the full response body of failed calls; support needs it.
- Retry only
429and5xx, with exponential back-off. POST /v1/messagesis not idempotent: a retry after a timeout can send the message twice.