Polling for new messages works, but it wastes requests and adds latency. A webhook flips the model: WhatsApp events land on your endpoint the instant they happen.
What Gets Sent
- Inbound messages — text, media, location, contact cards
- Delivery and read receipts for messages you sent
- Session connection events — connected, disconnected, reconnecting
A Minimal Receiver
javascript
app.post('/webhooks/whatsapp', (req, res) => {
const { event, sessionId, data } = req.body;
console.log(event, sessionId, data);
res.sendStatus(200); // acknowledge fast, process async
});Acknowledge the request immediately and process the payload asynchronously — a slow webhook handler is the most common cause of delivery-tracking gaps.