Skip to main content

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."
}
}
FieldMeaning
messageShort human-readable summary
error.codeStable code for your program to check
error.detailMore 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​

StatusMeaningRetry?
200Success
202Accepted and queued (WhatsApp send)
400Invalid request: missing field, wrong format, invalid JSONNo, fix the request
401Missing or invalid API key or client tokenNo, fix the credential
402Not enough creditsAfter a top-up
403Plan does not include this feature, plan limit reached, account suspended, or resource not yoursNo
404Resource not foundNo
409Conflict, for example the resource already existsNo
429Too many requestsYes, with back-off
500, 502, 503, 504Server or upstream (Meta) problemYes, with back-off

Error codes​

error.codeTypical statusMeaning
UNAUTHORIZED401No valid API key or client token
FORBIDDEN403Valid credential, action not allowed
PLAN_FEATURE_NOT_INCLUDED403Your plan does not include this feature (for example API access, webhooks, MCP servers)
WHATSAPP_NUMBER_LIMIT_REACHED403Your plan's WhatsApp number limit is reached
ORG_ID_REQUIRED400The credential has no organization (contact support)
INVALID_JSON_FORMAT400The request body is not valid JSON
BAD_REQUEST400Invalid parameters
VALIDATION_FAILED400One or more fields failed validation
MISSING_REQUIRED_FIELD400A required field is missing
INVALID_PARAMETER400A parameter has a wrong value
RESOURCE_NOT_FOUND404The resource does not exist in your organization
RESOURCE_ALREADY_EXISTS409A resource with the same key exists
INSUFFICIENT_CREDITS402Not enough credits
INTERNAL_SERVER_ERROR500Unexpected 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 parse message text.
  • Log the full response body of failed calls; support needs it.
  • Retry only 429 and 5xx, with exponential back-off.
  • POST /v1/messages is not idempotent: a retry after a timeout can send the message twice.