Troubleshooting & Debugging

WhatsApp Cloud API Message Not Sending

Debug failed requests, incorrect payloads, phone configuration, authentication problems, API errors, and other sending issues.

Practical Guide6 min read

Step 1

Read the API Error First

The initial send response is not the final delivery result. Store the outbound WhatsApp message ID and update that record when webhook events report sent, delivered, read, or failed states.

Implementation Checklist

  • Match events by WhatsApp message ID.
  • Store timestamps and failure details.
  • Make repeated status events safe to process.

This guide only covers the part needed for the current workflow. For the complete setup, examples, and troubleshooting, continue with WhatsApp Cloud API Message Statuses Explained.

Step 2

Check the Access Token

An access token proves that your backend is allowed to call Meta's Graph API. The token alone is not enough: it must belong to the right app or system user, include the required permissions, and have access to the WhatsApp business assets involved in the request.

When debugging authentication, first identify what kind of token you are using and whether it is intended for temporary development or server side production use. Then verify the permissions and asset assignments instead of repeatedly generating new tokens without understanding the original failure.

Implementation Checklist

  • Keep access tokens in server side environment variables, never in client side JavaScript.
  • Check the token type and expiration before changing application code.
  • Confirm whatsapp_business_messaging for message operations and management permissions where required.
  • Regenerate a token only after fixing the underlying permission or asset assignment problem.

Step 3

Check the Phone Number ID

Outbound messages are sent from your server to the Graph API messages endpoint for the sending Phone Number ID. Authenticate with a bearer token, validate the recipient and payload, and store the returned WhatsApp message ID so later webhook statuses can update the correct record.

Implementation Checklist

  • Send from server side code, never expose the token in the browser.
  • Use the Phone Number ID in the endpoint path.
  • Persist the returned message ID for status tracking.

This guide only covers the part needed for the current workflow. For the complete setup, examples, and troubleshooting, continue with How to Send a WhatsApp Message With Cloud API.

Step 4

Validate the Recipient Number

Phone number configuration is part identity, part routing. The visible business number is what customers recognize, while the Phone Number ID is what the Graph API uses in message and registration endpoints. Make sure the number is attached to the intended WABA and is in the expected registration state.

Normalize customer numbers before sending and keep country code handling explicit. Avoid guessing a country code from local formatting in production workflows. A CRM should store phone numbers in a consistent international representation so the same customer is not created multiple times under different formats.

Implementation Checklist

  • Confirm the business number belongs to the intended WhatsApp Business Account.
  • Use the Phone Number ID in Graph API paths, not the display phone number.
  • Normalize customer numbers consistently before matching or sending.
  • When registration fails, check ownership verification and two step verification before changing code.

Step 5

Validate the Message Payload

Validate the Message Payload should be checked with one known failing request or event. Capture the exact input, HTTP result, structured error, message ID, and relevant configuration before changing anything else. Troubleshooting becomes much faster when you can reproduce the same failure after each change.

Work from the transport layer outward: network and HTTPS, authentication, asset IDs, request payload, Meta response, webhook delivery, then your own database or CRM processing. Do not change several layers at once because a new successful result will not tell you which change fixed the original problem.

Implementation Checklist

  • Reproduce the issue with one controlled test case.
  • Record exact error codes and safe identifiers before editing configuration.
  • Change one layer at a time and compare against a known successful baseline.
  • Redact tokens and personal data from logs while keeping message IDs and event IDs for correlation.

Step 6

Check Messaging Rules

Debug this layer independently before changing several parts of the integration at once. Reproduce one known request or event, capture the input and output, and compare the result with what the application expected.

Use structured logs with timestamps, message IDs, event IDs, phone number IDs, and internal workflow IDs. Redact tokens and sensitive customer content. Good logs let you follow one message from API request to webhook event to CRM update without guessing which layer failed.

Implementation Checklist

  • Create one repeatable test case with known input.
  • Log the boundary between this layer and the next system.
  • Change one variable at a time while diagnosing the failure.
  • Keep a successful baseline request so future changes can be compared quickly.

Step 7

Check Template Requirements

Templates should be designed around a clear business purpose and stable variable structure. Decide what part of the message is fixed, what data is dynamic, and which actions the recipient needs before creating the template in WhatsApp Manager.

Keep names predictable and use a consistent internal naming convention. Your backend will refer to the template name and language exactly, so clear names make deployments, debugging, and CRM mappings easier.

Implementation Checklist

  • Use the exact approved template name and language code in API requests.
  • Validate every dynamic value before building the template payload.
  • Keep template purpose and category aligned with the actual customer communication.
  • Test a simple approved template before adding media, dynamic URLs, or multiple variables.

Step 8

Check Phone Registration

Phone number configuration is part identity, part routing. The visible business number is what customers recognize, while the Phone Number ID is what the Graph API uses in message and registration endpoints. Make sure the number is attached to the intended WABA and is in the expected registration state.

Normalize customer numbers before sending and keep country code handling explicit. Avoid guessing a country code from local formatting in production workflows. A CRM should store phone numbers in a consistent international representation so the same customer is not created multiple times under different formats.

Implementation Checklist

  • Confirm the business number belongs to the intended WhatsApp Business Account.
  • Use the Phone Number ID in Graph API paths, not the display phone number.
  • Normalize customer numbers consistently before matching or sending.
  • When registration fails, check ownership verification and two step verification before changing code.

Step 9

Inspect API Response Data

Start with the exact error returned by the failing layer. For a Graph API request, record the HTTP status and the structured error object. For a webhook, record the request path, response status, and event identifiers. For an external API or CRM, keep its response separate so one provider's error is not mistaken for another provider's failure.

Retry only when the failure is safe to retry. Authentication, invalid parameters, missing templates, and permission errors usually need a configuration or data fix. Network timeouts and some temporary server failures can be retried with backoff, but message and workflow operations should be idempotent so a retry does not create duplicates.

Implementation Checklist

  • Capture the error code, message, HTTP status, and relevant request correlation information.
  • Remove tokens and sensitive customer data before writing logs.
  • Separate permanent input or permission failures from temporary transport failures.
  • Use idempotency or unique event keys before adding automatic retries.

Need Implementation Help?

Need Help With Your WhatsApp or Automation Project?

If you need help building, integrating, troubleshooting, or improving a production system, you can discuss the project with me directly.