Skip to content
Whats91

Understand the Whats91 error envelope, the request correlation header, and how to react to each class of failure.

Errors

Summary

Understand the Whats91 error envelope, the request correlation header, and how to react to each class of failure.

Prerequisites

  • A Whats91 account

Whats91 public API endpoints use one error envelope. Meta-compatible endpoints are the single exception: they return Meta-shaped error bodies so existing Cloud API clients keep working unchanged.

Error Envelope

Every non-Meta-compatible failure returns this body. success is always false, error_code is the stable machine-readable identifier to branch on, and message is human-readable text that may change.

Error response
{
  "success": false,
  "message": "Missing public API token",
  "error_code": "MISSING_AUTH_TOKEN",
  "details": {},
  "metadata": {
    "apiVersion": "v2",
    "requestId": "request-uuid"
  }
}
FieldTypeDescription
successbooleanAlways false on an error response.
messagestringHuman-readable summary. Do not branch on this value.
error_codestringStable identifier to branch on. Defaults to REQUEST_FAILED when no specific code applies.
detailsobjectEndpoint-specific context. Empty object when there is nothing extra to report.
metadata.apiVersionstringThe API version that produced the response, for example v2.
metadata.requestIdstring | nullCorrelation id. Quote this when contacting support.

Response Headers

HeaderMeaning
X-Whats91-Request-IdRequest correlation id. Present on success and error responses, and mirrored in metadata.requestId.
X-Whats91-Phone-Number-IdSender phone number id, when a sender was resolved.
X-Whats91-Message-IdMeta message id, when Meta accepted the send.
X-Whats91-QueuedQueue status, when the sender was reconnecting and the message entered the reconnect queue.
X-Whats91-Template-UidLocal template UID, after a successful template create.

Tip

Log X-Whats91-Request-Id for every request. It is the fastest way for Whats91 support to locate a specific call in platform logs.

Authentication and Authorization

HTTPerror_codeMeaning and action
401MISSING_AUTH_TOKENNo bearer token and no compatibility fallback token was supplied. Add the Authorization header.
401INVALID_AUTH_TOKENThe token is invalid, expired, or revoked. Generate a new token from the dashboard.
403CUSTOMER_TOKEN_REQUIREDThe token does not belong to a customer account. Use a customer public API token.
403TOKEN_SCOPE_NOT_ALLOWEDA number-scoped token requested another sender. Use the bound sender or a global token.
403FEATURE_NOT_AVAILABLEThe subscription plan does not include the requested feature.
404SENDER_NOT_FOUNDThe requested sender is not connected to this customer.
400WHATSAPP_SETUP_INCOMPLETEThe sender has no usable WhatsApp number context. Finish WhatsApp setup in the dashboard.

Request Shape

HTTPerror_codeMeaning and action
400VALIDATION_FAILEDA required field is missing or a supplied field is invalid. Inspect details and message.
404NOT_FOUNDThe route is not exposed on this mount, or the referenced record does not exist in your tenant scope.
415UNSUPPORTED_CONTENT_TYPEA JSON-only endpoint was called without Content-Type: application/json.

Rate Limiting

HTTP 429 means a Whats91 platform limit window was exhausted. It is produced before the request reaches a handler and carries no Meta error code. Back off, then resume. Meta throughput limits are reported separately as Meta error codes inside a successful HTTP exchange with the provider.

SignalSourceAction
HTTP 429Whats91 platform limitRetry with exponential backoff after the window resets.
Meta 130429Cloud API throughput exceededQueue and spread sends across time and senders.
Meta 131056Pair rate limit for one recipientSlow down messages to that specific recipient.
Meta 131057Throughput upgrade in progressRetry with backoff; the sender is being scaled.

Meta-Compatible Endpoints

POST /api/v2/messages and POST /api/v2/{phoneNumberId}/messages return Meta-shaped errors rather than the Whats91 envelope, so a Cloud API client can be repointed at Whats91 without changing its error handling. The X-Whats91-Request-Id header is still present.

Meta-shaped error
{
  "error": {
    "message": "Invalid parameter",
    "type": "OAuthException",
    "code": 100,
    "error_subcode": null,
    "fbtrace_id": "trace-id"
  }
}

Retry Guidance

  • Never retry a 4xx other than 429 without changing the request; the same input produces the same result.
  • Retry 429 and 5xx with exponential backoff and jitter.
  • For sends, prefer idempotency-protected endpoints or a deduplication key in your own system: a retried send that already reached Meta creates a duplicate WhatsApp message.
  • When a send returns an ambiguous provider outcome, read the message report before resending rather than sending again blindly.
  • Treat a send response as an acceptance receipt, not a delivery receipt. Delivery, read, and failure arrive through webhooks and reports.

Related Documentation