Using the API well
Errors
Every error has the same shape, a stable code you can branch on, and a docUrl that links to its entry on this page.
The error object
HTTP/1.1 422 Unprocessable Entity
{
"error": {
"code": "SERVICE_WINDOW_CLOSED",
"type": "policy_error",
"message": "Free-form messages require an open 24-hour service window.",
"retryable": false,
"retryAfterSeconds": null,
"docUrl": "https://toutye.com/docs/errors#SERVICE_WINDOW_CLOSED",
"requestId": "req_FjLKGlzDxsiDKsIz",
"providerCode": 131047,
"details": [{ "path": "type", "issue": "…" }]
}
}retryableis the only thing that says whether retrying can help. When it is true, waitretryAfterSeconds(or theRetry-Afterheader) and retry with the same Idempotency-Key.providerCodeis WhatsApp’s own error code, when the refusal came from WhatsApp.detailslists each invalid field for validation errors.- Quote
requestIdwhen you contact support; it also finds the call in your request log.
The same list is available as JSON at GET /v1/errors (no key needed). Failed messages carry the same codes in data.error on message.failed.
Error codes
API error messages below are shown exactly as returned by the API. The explanations are translated.
| Code | Message and what to do |
|---|---|
SIGNING_UNAVAILABLE | Signature checking is briefly unavailable. Retry after a short wait; nothing was processed. |
PROVIDER_TEMPORARY_ERROR | WhatsApp had a temporary failure. Retrying is safe; queued messages are retried automatically. |
PROVIDER_PERMANENT_ERROR | WhatsApp refused the request for good. |
PROVIDER_RESULT_UNKNOWN | WhatsApp did not say whether it accepted the message. Toutye does not resend it blindly; the final status arrives as an event, or the message is reported as unknown. |
PROVIDER_TOKEN_INVALID | The WhatsApp connection's credential is no longer valid. Reconnect the WhatsApp Business Account. |
WABA_RESTRICTED | WhatsApp has restricted the business account. The console shows the reason and any appeal path. |
PAYMENT_REQUIRED | WhatsApp needs a payment method on the WhatsApp Business Account before it will send. |
REGISTRATION_ERROR | WhatsApp refused to register the phone number. Check the number and its verification code. |
MEDIA_PROVIDER_ERROR | WhatsApp could not process the media file. Try another format or a smaller file. |
FLOW_ERROR | WhatsApp blocked or throttled the Flow. |
MARKETING_MESSAGES_ERROR | The Marketing Messages API refused the message; |
RECIPIENT_UNREACHABLE | The number does not have WhatsApp or cannot receive messages. Do not retry. |
RECIPIENT_IN_EXPERIMENT | WhatsApp is holding back marketing messages to this person as part of its own experiment. Nothing to fix. |
TEMPLATE_PROVIDER_ERROR | WhatsApp rejected the template message, usually for wrong or missing parameters. Compare the parameters with the template. |
DISPLAY_NAME_NOT_APPROVED | The sender's display name is not approved by WhatsApp yet, so it cannot send. |
INTERNAL_TEMPORARY_ERROR | A temporary failure inside Toutye, including load shedding under heavy demand (HTTP 503 with a |
REGION_DIRECTORY_UNAVAILABLE | Regional discovery is temporarily unavailable. Wait before retrying, or use your account's known regional API address. Keep the same Idempotency-Key when retrying a mutation. |
REGIONAL_API_UNAVAILABLE | Your account's regional API could not be reached. A mutation may already have been accepted: check its status and reuse the same Idempotency-Key when retrying. Do not send it to a different region. |
INTERNAL_PERMANENT_ERROR | An unexpected failure inside Toutye. Contact support with the |
MESSAGE_BUILD_FAILED | Toutye could not assemble the message (for example a template variable could not be filled). Nothing was sent. |
WEBHOOK_DELIVERY_ERROR | Delivering an event to your endpoint failed. It is retried with backoff; see the webhook's delivery log. |