How to Read and Debug a WhatsApp Cloud API Webhook Payload

Understand WhatsApp webhook JSON, identify message and status events, extract important IDs and troubleshoot integration problems.

Developer Guide

Turn a WhatsApp webhook payload into useful information

Formatting and identifying the event first makes webhook debugging substantially easier.

WhatsApp Cloud API uses webhooks to notify an application about events. These may include an incoming customer message, a delivery update, a read receipt or a failed message. The payload arrives as JSON and can contain several nested objects and arrays.

webhook.json
{
  "object": "whatsapp_business_account",
  "phone_number_id": "123456789",
  "status": "delivered"
}
✓ Valid JSON · Status event detected

Important Fields to Identify

WABA ID

Identifies the WhatsApp Business Account associated with the event.

Phone number ID

Identifies the Cloud API number that received or sent the relevant message.

Message ID

Connects delivery and read events with the outbound message stored by your application.

Contact and type

Indicates the sender and whether the event contains text, media, interactive content or another supported type.

Incoming Messages Versus Status Events

An incoming message normally appears in a messages collection and contains the sender, message ID, timestamp and content type. A delivery update normally appears in a statuses collection and tells the application whether an outbound message was sent, delivered, read or failed.

Do not assume every webhook contains message text. Robust handlers identify the event type before trying to read type-specific fields.

A Practical Debugging Process

  1. Capture the exact raw body safely. Avoid exposing customer information in public logs.
  2. Validate the JSON. A copied fragment or escaped string may not be a complete payload.
  3. Identify the event. Determine whether it is an incoming message, status update or another notification.
  4. Extract stable IDs. Use message and phone-number identifiers to locate related application records.
  5. Check signature verification. Verify against the exact raw request body before decoding or changing it.
Security reminder: Treat production payloads, app secrets and customer telephone numbers as sensitive. Redact them before sharing debugging examples.

Frequently Asked Questions

Why does signature verification fail after JSON formatting?

The signature is calculated using the exact raw request bytes. Whitespace or encoding changes can produce a different result.

Can one webhook contain several events?

Yes. Code should iterate through supported entries and changes rather than assuming only the first item exists.

Does the inspector replace server logging?

No. It helps interpret a captured payload; production systems still need secure logging, retries and idempotent processing.

Inspect a WhatsApp Webhook Payload

Format JSON, identify the event and extract commonly needed fields.

Open the Webhook Inspector


WhatsApp webhook inspector WhatsApp Cloud API webhook webhook JSON delivery status X-Hub-Signature-256

Related articles