Webhooks
Subscribe to real-time events, verify signatures, and manage webhook endpoints through the AfriRoute API.
Webhook Management API
Use the endpoint paths below with your configured BASE_URL.
POST /api/v1/webhookscreates a webhook endpointGET /api/v1/webhookslists configured endpointsPUT /api/v1/webhooks/{webhookId}updates endpoint settingsDELETE /api/v1/webhooks/{webhookId}removes an endpoint
Event Types
| Event | Description |
|---|---|
| message.delivered | Message successfully reached the handset |
| message.failed | Delivery failed (e.g. carrier blocked, invalid number) |
| call.completed | Voice call ended, includes duration and cost |
| payment.received | Mobile money collection confirmed |
| otp.verified | Verification flow completed successfully |
Secure your webhooks
AfriRoute signs every webhook request so you can verify it was sent by us.
- Retrieve your webhook secret from the Console.
- Look for the
x-afriroute-signatureheader. - Calculate the HMAC SHA256 of the payload body using your secret.
- Compare the hashes.
Retry Schedule
If your endpoint returns anything other than a 2xx status code, AfriRoute retries delivery with backoff while preserving the original payload and signature headers:
- Immediately
- After 1 minute
- After 5 minutes
- After 30 minutes
- After 3 hours