API documentation

Errors

Every error is JSON with a stable code you can branch on.

Error shape
{
  "error": {
    "code": "insufficient_credits",
    "message": "The account does not hold enough credits for this template's category."
  }
}

The HTTP status tells you the class of problem; the code tells you exactly which. Codes are stable — build on them, not on the message text, which may be reworded.

All codes

HTTPcodeMeaning
400invalid_requestThe body is not valid JSON or fails the schema.
401invalid_api_keyThe Authorization header is missing, malformed, unknown or revoked.
402insufficient_creditsThe account does not hold enough credits for this template's category.
404template_not_foundNo template with that name and language exists on this account.
404message_not_foundNo message with that id exists on this account.
409template_not_approvedThe template exists but Meta has not approved it yet, or rejected it.
409unsupported_templateThis template cannot be sent through the API: carousels are not supported yet, and a template using a WhatsApp feature outside utility, authentication and marketing messages is never sendable here.
409template_category_changedWhatsApp has changed this template's category since it was approved. The template has been updated; check the new price and send again.
409number_not_connectedThe account's WhatsApp number is not connected and live.
403account_suspendedThis account is on hold; sending is disabled. Contact your provider.
422invalid_phone`to` is not a valid Indian mobile number.
422non_indian_numberWe do not send messages to non-Indian numbers. `to` belongs to another country; the message was not attempted and nothing was charged.
422variable_count_mismatchThe number of body parameters does not match the template's variables.
422unsupported_componentA component was supplied that this template does not have, or of a type the API does not support.
429rate_limitedToo many sends on this key in the last minute. Retry after the `Retry-After` seconds.
429daily_limit_reachedThis account's daily credit limit has been reached. Retry after the `Retry-After` seconds, or ask us to raise the limit.
502send_failedOur messaging platform refused the send. Any credits debited were refunded.