Webhooks
Optional HTTPS callbacks for delivery events.
Delivery webhooks are opt-in per organization. Configure them in the dashboard under API Integration, then Webhooks. Set a live URL for Live keys and, separately, a sandbox URL for Sandbox keys. Sandbox events are never sent to the live URL.
SMS events: sms.accepted, sms.sending, sms.sent, sms.delivered, sms.failed, sms.unknown, sms.cancelled. WhatsApp events: whatsapp.accepted, whatsapp.sending, whatsapp.sent, whatsapp.delivered, whatsapp.read, whatsapp.failed, whatsapp.cancelled. New webhook configs default to SMS sent, delivered, failed, and unknown, plus WhatsApp sent, delivered, read, and failed. Existing saved filters are unchanged until you update them in the dashboard.
Each envelope includes data.channel set to sms or whatsapp. Each POST to your HTTPS URL is signed HMAC-SHA256 over {timestamp}.{rawBody} using the webhook secret. Headers:
X-Msngr-Signature-sha256=<hex>X-Msngr-Timestamp- Unix secondsX-Msngr-Event- event typeX-Msngr-Delivery-Id- delivery record id
Scenario 1 — SMS delivered:
Webhook body: sms.delivered
json
{
"id": "evt_01HXEXAMPLE",
"type": "sms.delivered",
"created_at": "2026-04-02T08:15:22.000Z",
"data": {
"message_id": "661f0a1b2c3d4e5f67890123",
"dispatch_id": "661f0a1b2c3d4e5f67890123",
"batch_id": null,
"status": "delivered",
"channel": "sms",
"recipient": "97798XXXXXXX",
"sent_at": "2026-04-02T08:15:10.000Z",
"delivered_at": "2026-04-02T08:15:20.000Z",
"failed_at": null,
"error_code": null,
"error_message": null,
"cost": 1,
"environment": "live"
}
}Scenario 2 — WhatsApp delivered:
Webhook body: whatsapp.delivered
json
{
"id": "evt_01HYEXAMPLE",
"type": "whatsapp.delivered",
"created_at": "2026-04-02T09:01:10.000Z",
"data": {
"message_id": "661f0a1b2c3d4e5f67890123",
"dispatch_id": "661f0a1b2c3d4e5f67890123",
"batch_id": null,
"status": "delivered",
"channel": "whatsapp",
"recipient": "97798XXXXXXX",
"sent_at": "2026-04-02T09:01:00.000Z",
"delivered_at": "2026-04-02T09:01:08.000Z",
"failed_at": null,
"error_code": null,
"error_message": null,
"cost": 1,
"environment": "live"
}
}Scenario 3 — verify the signature (Node.js):
Verify X-Msngr-Signature
javascript
const crypto = require('crypto');
function verifyMsngrWebhook({ rawBody, timestamp, signatureHeader, secret }) {
const expected = crypto
.createHmac('sha256', secret)
.update(`${timestamp}.${rawBody}`)
.digest('hex');
const provided = String(signatureHeader || '').replace(/^sha256=/, '');
return crypto.timingSafeEqual(
Buffer.from(expected, 'hex'),
Buffer.from(provided, 'hex')
);
}