Webhooks — What and Why
What WhatsApp webhooks are and why you need them — Meta's server sends JSON to your endpoint for incoming messages, delivery receipts, and template status changes.
On this page
A webhook is an HTTP endpoint on your server that Meta calls with a JSON payload whenever something happens on WhatsApp — an incoming message, a delivery or read receipt, a template approval or rejection. Unlike the API (where you call Meta), webhooks are Meta calling you.
Customer sends "Hello"
↓
Meta's servers receive it
↓
Meta POSTs JSON to your webhook URL
↓
Your server receives the payload
↓
Your code decides what to do (reply, log, trigger bot, etc.)The difference between the API and webhooks#
| API | Webhook | |
|---|---|---|
| Direction | You → Meta | Meta → You |
| Use | Send messages, upload media | Receive messages, status updates |
| Trigger | You call it | Meta calls it when something happens |
What webhooks notify you about#
Incoming message from a customer:
{
"messages": [{
"from": "919959623255",
"type": "text",
"text": { "body": "Hello" }
}]
}Message delivered / read / failed:
{ "statuses": [{ "status": "delivered" }] }
{ "statuses": [{ "status": "read" }] }
{ "statuses": [{ "status": "failed" }] }What your server can do with the data#
Your server receives the JSON and can choose to:
- Show the message on a dashboard
- Save it to a database (MySQL, Google Sheets, Airtable)
- Forward it to an automation tool (n8n, Zapier)
- Trigger an AI bot to generate a reply
- Send an automatic response back via the API
Setting up a webhook#
You need an HTTPS endpoint at a public URL, e.g. https://yourdomain.com/webhook. Register
this URL in Meta's App Dashboard under WhatsApp → Configuration → Webhook. Meta will
verify the endpoint with a GET request before activating it.
Frequently asked#
What is a webhook in WhatsApp API?
It's an HTTPS endpoint on your server that Meta calls with a JSON payload when something happens — a customer sends a message, a delivery status changes, or a template is approved/rejected. You register the URL in the Meta dashboard.
How do I receive incoming WhatsApp messages from customers?
Set up a webhook endpoint. When a customer sends a message, Meta POSTs the message data to your webhook URL. Your server processes the JSON and can trigger a reply via the send-message API.
How do I know if my message was delivered or read?
Meta sends a statuses event to your webhook with "status": "delivered" or
"status": "read" when those events occur.
I got error 131049 when sending a Marketing template. What does it mean?
WhatsApp blocked the marketing message because the recipient has already received too many marketing messages — their per-user marketing cap was hit. You cannot override this — wait and try again later, or use a Utility template if the content qualifies.
Gotchas & common mistakes#
Was this page helpful?
Still stuck? Open a support ticket and our team will help.