A webhook is an HTTP callback that automatically sends data to your application when specific SMS events occur, enabling real-time reactions to message events.
How Webhooks Work
1. You register a webhook URL with the SMS platform
2. An event occurs (message delivered, reply received)
3. Platform sends HTTP POST to your URL
4. Your application receives and processes the data
Common SMS Webhook Events
Delivery events:Webhook Payload Example
```json
{
"event": "message.delivered",
"message_id": "msg_12345",
"to": "+15551234567",
"status": "delivered",
"timestamp": "2024-12-15T10:30:00Z"
}
```
Webhook Best Practices
1. Respond with 200 OK quickly
2. Process asynchronously
3. Implement retry logic
4. Validate webhook signatures
5. Log all received events
6. Handle duplicate events