API Docs
All API sections

Errors

Error response format and HTTP status codes.

All failed API calls return a non-2xx HTTP status code with a JSON body whose detail field describes the error. For most errors detail is an object with message and error_type; use error_type in your code, not the human-readable message. A few errors (some chat and form errors) return detail as a plain text message, and invalid request bodies return 422 with a list of the fields that are wrong.

Copy this section as context for your AI coding agent

json
{
  "detail": {
    "success": false,
    "message": "Template 'order_update' not found.",
    "error_type": "TEMPLATE_NOT_FOUND"
  }
}

Read detail.error_type in your code, not the human-readable message. Some chat and form errors return detail as plain text, and invalid request bodies return 422 with a list of field errors.

400Bad request: missing or invalid value
401Unauthorized: missing, invalid or revoked API key
402Plan required: the plan for the API or this feature is not active
403Forbidden: called from a browser (call from your server)
404Not found: template, campaign, chat or form missing
409Conflict: template not approved, reply window closed, or wrong campaign state
422Invalid request body, or Meta refused to send the message
429Rate limited: slow down requests
502Meta API error: retry with backoff
500Server error: retry with backoff