Docs
Esc

Suggested

QuickstartGet started
Webhooks and signaturesMessaging
Create a messagemessages.create · POST /v1/accounts/{AC}/messages
RATE_LIMITED429 · Rate limit exceeded.
message.deliveredMessage resource
Contents

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

error response
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": "…" }]
  }
}
  • retryable is the only thing that says whether retrying can help. When it is true, wait retryAfterSeconds (or the Retry-After header) and retry with the same Idempotency-Key.
  • providerCode is WhatsApp’s own error code, when the refusal came from WhatsApp.
  • details lists each invalid field for validation errors.
  • Quote requestId when 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.

CodeMessage and what to do
AUTHENTICATION_ERROR401Not retryableAuthentication failed.Authentication

The API key is missing, mistyped, revoked, or used from an address outside its allow-list. Send Authorization: Bearer <secret> with the full secret shown when the key was created.

API_KEY_DISABLED401Not retryableThe API key is disabled.Authentication

The key was disabled in the console or by an administrator. Re-enable it or create a new key.

SIGNATURE_REQUIRED401Not retryableThis key requires request signing.Authentication

This key is configured to require signed requests. Turn on request signing in your SDK (the signing option) or add the X-Toutye-Key, -Timestamp, -Nonce and -Signature headers.

SIGNATURE_INVALID401Not retryableThe request signature is invalid.Authentication

The signature did not match. Sign the exact bytes you send, with the path and query in canonical order, and keep your clock within 5 minutes of real time.

SIGNATURE_REPLAYED401Not retryableThe request signature was already used.Authentication

The nonce was already used. Every signed request needs a new random nonce; the SDKs generate one per attempt.

SIGNING_UNAVAILABLE503RetryableRequest signing verification is temporarily unavailable.Authentication

Signature checking is briefly unavailable. Retry after a short wait; nothing was processed.

CAPTCHA_REQUIRED401Not retryableA completed challenge is required before another sign-in attempt.Authentication

Several failed sign-ins in a row: the next sign-in must include a solved challenge.

CAPTCHA_INVALID401Not retryableThe challenge response could not be verified.Authentication

The challenge answer was rejected or expired. Solve a new challenge and sign in again.

AUTHORIZATION_ERROR403Not retryableInsufficient permission.Permission

The key or user lacks the permission (scope) this endpoint needs, or the resource belongs to another account or environment. Check the key's scopes and that a sandbox key is used with sandbox resources.

STEP_UP_REQUIRED403Not retryableStep-up authentication is required.Permission

This action is sensitive and needs a fresh second-factor confirmation from a signed-in user. It cannot be done with an API key alone.

APPROVAL_REQUIRED403Not retryableThis action requires approval.Permission

Your account requires a second person to approve this action. It has been queued for approval; it runs once approved.

VALIDATION_ERROR400Not retryableThe request is invalid.Invalid request

A field is missing, has the wrong type or is out of range. details lists each problem as a field path and an issue.

NOT_FOUND404Not retryableResource not found.Invalid request

No such resource in this account and environment. Check the SID, and that sandbox and live resources are not mixed.

METHOD_NOT_ALLOWED405Not retryableThis method is not supported for this path.Invalid request

This path exists, but does not support the requested HTTP method. Use a method listed in the Allow response header and the API reference; do not retry the same method.

CAPABILITY_UNAVAILABLE400Not retryableThe sender does not have this capability.Invalid request

The sender cannot send this kind of message (for example a Flow or a product message) until the capability is enabled on its WhatsApp Business Account.

MEDIA_NOT_READY400RetryableThe media is not ready yet.Invalid request

The uploaded media is still being scanned or processed. Wait until its state is READY, then send.

MEDIA_REJECTED400Not retryableThe media was rejected.Invalid request

The media failed the safety scan or is an unsupported type or size. Upload a different file.

RECIPIENT_ADDRESSING_UNSUPPORTED400Not retryableThis recipient addressing is not supported for this message.Invalid request

This message type cannot be sent to that kind of address (for example a username instead of a phone number). Address the recipient by phone number.

RECIPIENT_USERNAME_INVALID400Not retryableThe recipient username is invalid.Invalid request

The WhatsApp username is not in a valid format.

STATUS_CALLBACK_NOT_VERIFIED422Not retryableThe status callback endpoint is not verified.Invalid request

A per-message status callback must point at a webhook endpoint that has passed verification. Verify the endpoint first.

TEMPLATE_NAME_LOCKED400Not retryableThe template name is locked.Invalid request

A template with this name was deleted recently; WhatsApp does not allow reusing the name for 30 days. Pick another name.

TEMPLATE_CAP_REACHED400Not retryableThe template cap has been reached.Invalid request

The WhatsApp Business Account has reached its template limit. Delete unused templates.

IDEMPOTENCY_KEY_REUSED409Not retryableIdempotency key reused with a different request.Idempotency

The Idempotency-Key was already used within 24 hours for a different request body or endpoint. Use a new key for a new request.

IDEMPOTENCY_IN_PROGRESS409RetryableA request with this idempotency key is still in progress.Idempotency

The first request with this key is still running. Wait a moment and retry with the same key; you will receive its result.

RATE_LIMITED429RetryableRate limit exceeded.Rate limits

A rate limit was exceeded. Wait retryAfterSeconds, then retry. The RateLimit-Policy header names the limit you hit.

PROVIDER_RATE_LIMITED429RetryableThe provider is rate limiting this sender.Rate limits

WhatsApp is throttling this sender. The message is retried automatically when queued; for direct calls, wait and retry.

ACCOUNT_SUSPENDED422Not retryableThe account is suspended.Policy and account state

The account is suspended, so it cannot send. The console explains why and what is needed to lift it.

PLAN_MESSAGE_QUOTA_EXCEEDED422Not retryableThe contracted message allowance has been reached.Policy and account state

The account has used the message allowance in its contracted plan for this period. Nothing was sent. Wait for the allowance to renew, or ask your account owner to change the plan.

INSUFFICIENT_FUNDS422Not retryableInsufficient funds.Policy and account state

The prepaid balance cannot cover this message. Top up the wallet or change the billing mode.

SENDER_NOT_READY422Not retryableThe sender is not ready to send.Policy and account state

The sender (phone number) is not connected or verified yet. Finish onboarding, or use a sender whose status is CONNECTED.

SENDER_RESTRICTED422Not retryableThe sender is restricted.Policy and account state

WhatsApp has restricted this number, usually after quality problems. Sending resumes when the restriction ends.

SENDER_TEMPLATE_RESTRICTED422Not retryableThe sender is restricted for template messaging.Policy and account state

The number may not send template messages for now. Replies inside an open service window still work.

TEMPLATE_NOT_APPROVED422Not retryableThe template is not approved.Policy and account state

The template does not exist in that language, or WhatsApp has not approved it. Check its name, language and status.

TEMPLATE_PAUSED422Not retryableThe template is paused.Policy and account state

WhatsApp paused the template because recipients reported or blocked it. Edit it or wait for the pause to end.

SERVICE_WINDOW_CLOSED422Not retryableFree-form messages require an open 24-hour service window.Policy and account state

Free-form messages (text, media, interactive) are allowed only within 24 hours of the customer's last message. Send an approved template instead.

CONTACT_SUPPRESSED422Not retryableThe recipient is suppressed for this message.Policy and account state

The number is on a suppression list for this kind of message (for example after a hard failure or a manual block).

RECIPIENT_OPTED_OUT422Not retryableThe recipient opted out.Policy and account state

The contact opted out of this kind of message. Do not send it again unless they opt back in.

RECIPIENT_MARKETING_CAP422Not retryableThe recipient reached the marketing message cap.Policy and account state

WhatsApp limits how many marketing messages one person receives. Send later; with deferIfCapped the message waits automatically.

DESTINATION_POLICY_BLOCKED422Not retryableThe destination is blocked by policy.Policy and account state

Your account's policy blocks this destination (a country or number range).

MARKET_EXCLUDED422Not retryableThe market is excluded.Policy and account state

Messages to this country are not available for this account or message category.

PORTFOLIO_LIMIT_EXHAUSTED422Not retryableThe business portfolio messaging limit is exhausted.Policy and account state

The business has used its daily limit of new conversations. It resets on a rolling 24-hour basis and grows as quality stays high.

TRANSPORT_CATEGORY_MISMATCH422Not retryableThe transport does not support this message category.Policy and account state

The chosen transport cannot carry this template category (for example a non-marketing template on the Marketing Messages API).

RISK_BLOCKED422Not retryableThe message was blocked by the risk engine.Policy and account state

The message was held back by fraud and abuse checks. Contact support if you think this is wrong.

COEXISTENCE_DEREGISTER_UNSUPPORTED422Not retryableCoexistence numbers cannot be deregistered.Policy and account state

A number shared with the WhatsApp Business app cannot be deregistered from the API; disconnect it from the app side.

PHONE_NUMBER_CAP_REACHED422Not retryableThe phone number cap has been reached.Policy and account state

The WhatsApp Business Account already has the maximum number of phone numbers.

ONBOARDING_NOT_PERMITTED422Not retryableLive onboarding is not permitted until the platform's Meta application is production-ready.Policy and account state

Connecting live numbers is not open yet on this platform. Use the sandbox until it is.

RESIDENCY_POLICY_MISMATCH422Not retryableThe chosen data localization region conflicts with this account's data residency policy.Policy and account state

The data region you chose conflicts with the account's data residency policy. Pick an allowed region.

FLOW_BLOCKED422Not retryableThe Flow is blocked by the provider.Policy and account state

WhatsApp has blocked this Flow. Check its health in the console.

CONFLICT409Not retryableThe resource state conflicts with this action.Resource state

The resource changed or is in the wrong state for this action. Read it again and retry against its current state.

REGION_OWNERSHIP_CONFLICT409Not retryableThe account's regional routing ownership is ambiguous.Resource state

More than one region claims this account. Contact support with the requestId so ownership can be corrected; do not create another account or change regions to retry the operation.

MESSAGE_NOT_CANCELABLE409Not retryableThe message can no longer be canceled.Resource state

The message has already been handed to WhatsApp, so it can no longer be canceled.

MESSAGE_EXPIRED409Not retryableThe message expired.Resource state

The message passed its validity period before it could be sent, so it was not sent.

OPERATION_NOT_RETRYABLE409Not retryableThe operation cannot be retried.Resource state

This operation cannot be retried; check retryEligible on the operation before retrying.

ONBOARDING_CODE_EXPIRED409Not retryableThe onboarding code expired.Resource state

The onboarding code has expired. Start the connection again to get a new one.

WABA_NOT_CONNECTED409Not retryableThe WABA is not connected.Resource state

The WhatsApp Business Account is not connected to Toutye. Reconnect it in the console.

CONVERSATION_VERSION_CONFLICT409Not retryableThe conversation changed since it was loaded.Resource state

Someone else changed the conversation after you loaded it. Reload it and try again.

COMPOSER_CLAIM_CONFLICT409Not retryableAnother principal holds the conversation composer claim.Resource state

Another agent is replying in this conversation right now.

COMPOSER_CLAIM_REQUIRED409Not retryableAn active composer claim is required for this reply.Resource state

Take the conversation's reply claim before replying from an inbox.

FLOW_NOT_PUBLISHED409Not retryableThe Flow is not published.Resource state

Only published Flows can be sent. Publish the Flow first.

FLOW_ENCRYPTION_KEY_MISSING409Not retryableThe sender does not have a verified Flow encryption public key.Resource state

Data-exchange Flows need the sender's Flow encryption public key to be uploaded and verified.

MARKETING_MESSAGES_NOT_ONBOARDED409Not retryableThe WABA is not onboarded for the Marketing Messages API.Resource state

The WhatsApp Business Account has not accepted the Marketing Messages API terms. Complete that step, or send through the Cloud API transport.

ANALYTICS_RANGE_UNAVAILABLE409Not retryableDetailed analytics are temporarily limited to the last 7 days; the requested range is outside that window.Resource state

Detailed analytics are limited to the last 7 days right now. Ask for a shorter range.

PROVIDER_TEMPORARY_ERROR502RetryableThe provider returned a temporary error.WhatsApp (provider)

WhatsApp had a temporary failure. Retrying is safe; queued messages are retried automatically.

PROVIDER_PERMANENT_ERROR502Not retryableThe provider returned a permanent error.WhatsApp (provider)

WhatsApp refused the request for good. providerCode has Meta's reason; change the request before trying again.

PROVIDER_RESULT_UNKNOWN502Not retryableThe provider result is unknown.WhatsApp (provider)

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_INVALID502Not retryableThe provider credential is invalid.WhatsApp (provider)

The WhatsApp connection's credential is no longer valid. Reconnect the WhatsApp Business Account.

WABA_RESTRICTED502Not retryableThe WABA is restricted by the provider.WhatsApp (provider)

WhatsApp has restricted the business account. The console shows the reason and any appeal path.

PAYMENT_REQUIRED502Not retryableThe provider requires a payment method on the WABA.WhatsApp (provider)

WhatsApp needs a payment method on the WhatsApp Business Account before it will send.

REGISTRATION_ERROR502Not retryableSender registration failed at the provider.WhatsApp (provider)

WhatsApp refused to register the phone number. Check the number and its verification code.

MEDIA_PROVIDER_ERROR502Not retryableThe provider could not process the media.WhatsApp (provider)

WhatsApp could not process the media file. Try another format or a smaller file.

FLOW_ERROR502Not retryableThe Flow is blocked or throttled.WhatsApp (provider)

WhatsApp blocked or throttled the Flow.

MARKETING_MESSAGES_ERROR502Not retryableMarketing Messages API error.WhatsApp (provider)

The Marketing Messages API refused the message; providerCode has the reason.

RECIPIENT_UNREACHABLE502Not retryableThe recipient cannot receive WhatsApp messages.WhatsApp (provider)

The number does not have WhatsApp or cannot receive messages. Do not retry.

RECIPIENT_IN_EXPERIMENT502Not retryableThe recipient is in a provider experiment group.WhatsApp (provider)

WhatsApp is holding back marketing messages to this person as part of its own experiment. Nothing to fix.

TEMPLATE_PROVIDER_ERROR502Not retryableThe provider rejected the template message.WhatsApp (provider)

WhatsApp rejected the template message, usually for wrong or missing parameters. Compare the parameters with the template.

DISPLAY_NAME_NOT_APPROVED502Not retryableThe sender display name is not approved.WhatsApp (provider)

The sender's display name is not approved by WhatsApp yet, so it cannot send.

INTERNAL_TEMPORARY_ERROR500RetryableA temporary internal error occurred.Toutye internal

A temporary failure inside Toutye, including load shedding under heavy demand (HTTP 503 with a Retry-After header and retryAfterSeconds; nothing was saved and no RateLimit headers are sent). Wait, then retry with the same Idempotency-Key.

REGION_DIRECTORY_UNAVAILABLE503RetryableRegional account routing is temporarily unavailable.Toutye internal

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_UNAVAILABLE502RetryableThe account's regional API is temporarily unavailable.Toutye internal

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_ERROR500Not retryableAn internal error occurred.Toutye internal

An unexpected failure inside Toutye. Contact support with the requestId.

MESSAGE_BUILD_FAILED500Not retryableThe message could not be prepared for sending; nothing was sent to the provider.Toutye internal

Toutye could not assemble the message (for example a template variable could not be filled). Nothing was sent.

WEBHOOK_DELIVERY_ERROR500Not retryableWebhook delivery failed.Toutye internal

Delivering an event to your endpoint failed. It is retried with backoff; see the webhook's delivery log.