928 B
928 B
Webhook Specification
Public Endpoints
- GET /webhooks/whatsapp
- POST /webhooks/whatsapp
- POST /webhooks/whatsapp/:provider
Responsibilities
- Validate verification token or signature
- Store raw payload
- Detect duplicate event_id
- Enqueue processing job
- Return 200 quickly
Internal Normalized Event Format
{
"provider": "meta",
"event_type": "message.delivered",
"event_id": "evt_123",
"sender_phone": "628xxxx",
"recipient_phone": "628yyyy",
"external_message_id": "wamid.xxx",
"timestamp": "2026-05-08T06:00:00.000Z",
"payload": {}
}
Internal Event Types
- message.inbound
- message.sent
- message.delivered
- message.read
- message.failed
- template.updated
- account.updated
Processing Flow
- Receive request
- Verify authenticity
- Save webhook_events record
- Ignore duplicates
- Push job to queue
- Worker parses and updates data
- Mark processed or failed