API and webhooks

API errors

The format of XBASE API errors, what each HTTP status means and the list of stable codes for your integration to handle.

Updated on

Every API error response has the same format. Handle the error by the HTTP status and the code: the message text explains the problem, but it can change.

Format

{
  "statusCode": 401,
  "timestamp": "2026-11-04T16:03:56.074Z",
  "path": "/api/external/v1/me",
  "method": "GET",
  "message": "Chave de API inválida ou revogada.",
  "code": "INVALID_API_KEY"
}
FieldDescription
statusCodeHTTP status
messageWhat went wrong, as text
codeStable error code. Validation errors (400) have no code
detailsExtra data for some errors, like details.metaCode (the error code at Meta) and details.reason
timestamp · path · methodWhen and on which route

HTTP status

StatusMeans
200 · 204It worked (204 has no body)
400Invalid request: a field is missing or breaks a rule. The message lists the fields
401Key missing, invalid or revoked
403The key does not have the route's scope
404The resource does not exist in this workspace
422Meta rejected it, the action breaks a WhatsApp rule (like the 24-hour window) or the resource is not ready for it
5xxError in XBASE. Try again after a few seconds

Codes

codeStatusWhen
INVALID_API_KEY401No Authorization header, or the key has the wrong format, does not exist or was revoked
MISSING_SCOPE403The key does not have the route's scope
NOT_INCOMING_MESSAGE400Only a message received from the contact can be marked as read
NUMBER_NOT_FOUND404The WhatsApp number (numberId) is not from this workspace
TEMPLATE_NOT_FOUND404The template does not exist for this number
MESSAGE_NOT_FOUND404The message (messageId) is not from a WhatsApp conversation in this workspace
FLOW_NOT_FOUND404The Flow does not belong to the number's WhatsApp account
NOT_FOUND404The Instagram account (connectionId) is not from this workspace
NUMBER_DISCONNECTED422The WhatsApp number is disconnected
WINDOW_CLOSED422WhatsApp free-form message outside the 24-hour window. details.reason says why
UNSUPPORTED_FOR_NUMBER422The number does not accept this kind of send
SEND_REJECTED422XBASE refused the send before Meta, for example, missing template variables. The message says why
META_ERROR422Meta rejected the action on WhatsApp or Instagram. On WhatsApp, details.metaCode has Meta's code

Good practices

  • Handle errors by code and status, not by the message text.
  • On 5xx, try again with increasing waits (for example, 2, 10 and 30 seconds).
  • Do not repeat a WhatsApp send that returned 200: the contact already received it. The API does not prevent duplicate sends.
  • On WINDOW_CLOSED, do not retry the same message: send a template and wait for the contact to reply.
  • On 401, check that the key was not revoked in Integrations → API keys.

Frequently asked questions

See also

On this page