Overview
Webhooks allow you to receive real-time notifications about message delivery status (DLR) and incoming messages (MO). Instead of polling the API, your server receives HTTP POST requests when events occur.Create a webhook subscription
Register your webhook endpoint with the events you want to receive.Response:
Your webhook URL must be publicly accessible and use HTTPS in production.
Handle incoming DLR payloads
Create an endpoint to receive and process delivery report webhooks.Delivery Report (DLR) Payload:Node.js Express Handler:Python Flask Handler:
Message Status Lifecycle
| Status | Description |
|---|---|
pending | Message accepted, awaiting queue |
queued | In queue, ready to send |
submitted | Sent to carrier |
delivered | Successfully delivered |
failed | Delivery failed |
expired | Delivery timeout exceeded |
Webhook Event Types
Delivery Report (DLR)
Sent when a message status changes.Mobile Originated (MO)
Sent when you receive an incoming message.Security Best Practices
Verify Webhook Signatures
Verify Webhook Signatures
Always verify the
X-Webhook-Signature header to ensure requests are from NativeMessage.Use HTTPS
Use HTTPS
Always use HTTPS for webhook URLs in production to prevent man-in-the-middle attacks.
Implement Idempotency
Implement Idempotency
Store processed webhook IDs to prevent duplicate processing during retries.
Handle Retries Gracefully
Handle Retries Gracefully
NativeMessage retries failed webhooks up to 5 times with exponential backoff:
- 1st retry: 1 minute
- 2nd retry: 5 minutes
- 3rd retry: 15 minutes
- 4th retry: 1 hour
- 5th retry: 6 hours