Overview
Hypersender sends a WhatsApp webhook to your URL whenever something happens on your instance: a new message, a delivery or read receipt, a reaction, a poll vote. You receive it with your own route. The SDK is only needed when you reply. A webhook is aPOST with a JSON body and your secret in the Authorization header, so any Node.js framework can handle it. The examples use Express.
Set up the webhook
1
Add the webhook in the dashboard
In the Hypersender dashboard, open your WhatsApp instance and add a webhook with your public HTTPS URL, for example
https://example.com/whatsapp/webhook.2
Set a secret
Set an authorization secret on the webhook. Hypersender sends it in the
Authorization header so you can reject requests that did not come from Hypersender. Save the same value as HYPERSENDER_WHATSAPP_WEBHOOK_SECRET.3
Answer quickly
Reply with a
2xx status right away. If handling an event takes time, store the payload and process it in the background.Receive and verify webhooks
- Basic Usage
Compare the secret with
timingSafeEqual, not ===, so the comparison takes the same time whether or not the secret matches.Payload
Every WhatsApp webhook has the same outer shape:data.payload. Each event page in the WhatsApp webhooks reference shows the full payload.
WhatsApp webhook events
Handle each event
Switch onevent and reply with the SDK. This example answers incoming messages and records read receipts:
- Basic Usage
Next steps
- Send Messages: reply with text, media, polls, and more
- Chat Status: mark messages as read and show “typing…”
- WhatsApp webhooks reference: every payload in full