WhatsApp Cloud API · error code

WhatsApp error 0: AuthException

ConfigurationHTTP 401Authorization & permissions

Last verified against Meta for Developers - Cloud API error codes

What WhatsApp returns
We were unable to authenticate the app user.

What error 0 means

Code 0 is the Graph API's most basic authentication failure: the token you attached to the request could not be resolved to a valid app user at all. Unlike 190, which tells you a once-good token has expired, code 0 is returned when the platform cannot make sense of the credential in the first place. It is raised before your request reaches any WhatsApp-specific logic, so nothing about your message payload, template, or phone number is being evaluated yet.

Meta lists three situations: the token has expired, it has been invalidated (password change, revoked app, or Meta itself), or the app user has changed a setting that blocks all apps from accessing their data. It carries type OAuthException and HTTP 401, so check the raw body rather than a wrapper's generic "unauthorized".

What is not wrong: your endpoint path, the phone number ID, the recipient, or the message body. Fixing those will not clear a code 0.

Why it happens

  • The Authorization header is missing, truncated, or contains a placeholder such as YOUR_ACCESS_TOKEN from a copied sample.
  • The token was generated for a different app than the one whose phone number ID you are calling.
  • A System User or admin who generated the token was removed from the business, which invalidates every token tied to them.
  • Meta invalidated the token after it was detected in a public repository or leaked log.

How to fix WhatsApp error 0

  1. 1Paste the token into the Access Token Debugger at developers.facebook.com/tools/debug/accesstoken and confirm it is valid, lists your app, and carries whatsapp_business_messaging.
  2. 2If the debugger says it is invalid, generate a new one: Business Settings, System Users, select the user, Generate New Token, pick the app, grant whatsapp_business_messaging and whatsapp_business_management.
  3. 3Confirm the header is exactly Authorization: Bearer with no quotes or trailing newline; print its length to catch truncation.
  4. 4Retry a harmless GET such as /{phone-number-id} before re-sending the failed message.
  5. 5If a person rather than a System User generated the token, reissue it from a System User so staff changes do not break production.

How to stop it recurring

Never ship with a user-scoped or temporary dashboard token. Generate a permanent System User token, store it in a secrets manager, and load it at startup so it can never be an empty string. Add a startup health check that calls the token debug endpoint and fails fast if the credential is invalid, which turns an overnight outage into a deploy-time error. If the token is valid but expired you will see 190 instead; the authorization-family triage order is summarized in the WhatsApp error-code guide.

Official reference: Meta for Developers - Cloud API error codes. See all WhatsApp error codes or the WhatsApp limits and quotas.

Related codes

Error 0 - quick answers

What does WhatsApp error 0 mean?

Code 0 is the Graph API's most basic authentication failure: the token you attached to the request could not be resolved to a valid app user at all. Unlike 190, which tells you a once-good token has expired, code 0 is returned when the platform cannot make sense of the credential in the first place.

How do I fix WhatsApp error 0?

1. Paste the token into the Access Token Debugger at developers.facebook.com/tools/debug/accesstoken and confirm it is valid, lists your app, and carries whatsapp_business_messaging. 2. If the debugger says it is invalid, generate a new one: Business Settings, System Users, select the user, Generate New Token, pick the app, grant whatsapp_business_messaging and whatsapp_business_management. 3. Confirm the header is exactly Authorization: Bearer with no quotes or trailing…

Stop debugging WhatsApp by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.