Handling Webhooks
Receive real-time notifications when events occur in your account. Webhooks are delivered via HTTP POST to your endpoint.Webhook Structure
All webhook events use this envelope:event: Event type identifierid: Unique event ID (use for deduplication)time: ISO 8601 timestampdata: Event-specific payload
Signature Verification
Webhooks include an RSA-SHA256 signature in thex-access-signature header. Verify signatures using the webhook public key.
Header: x-access-signatureAlgorithm: RSA-SHA256
Key: Public key provided when creating webhook endpoint Verification Process:
- Extract signature from
x-access-signatureheader (Base64-encoded) - Load webhook public key (PEM format)
- Verify signature against raw request body using RSA-SHA256 with PKCS1v15 padding
- Return HTTP 401 if verification fails
- Use raw request body before JSON parsing
- Signature is Base64-encoded
- Public key is provided at webhook creation time
For language-specific verification examples, see the Recipes section.
Endpoint Requirements
Your webhook endpoint must:- Accept POST requests over HTTPS
- Return HTTP 200 within 5 seconds
- Parse JSON request bodies
- Verify signatures before processing
Event Processing
Deduplication
Use theid field to detect duplicate deliveries. Store processed event IDs and check before processing.
Storage options:
- Database table with event ID index
- Distributed cache (Redis) with TTL
- In-memory set (development only)
Async Processing
Process events asynchronously to meet the 5-second response requirement:- Verify signature
- Check for duplicate (event ID)
- Acknowledge with HTTP 200
- Queue event for async processing
Error Handling
- Log errors without preventing acknowledgment
- Implement retry logic in your queue/worker
- Make handlers idempotent (safe to retry)
Webhook Statuses
Webhooks transition through these statuses:| Status | Description |
|---|---|
created | Newly created, pending initial health check |
healthy | Active, deliveries successful |
unhealthy | Degraded, retries in progress |
error | Suspended due to repeated failures |
removed | Deleted from system |
created→unhealthy→healthy(on first success)healthy→unhealthy(on failures)unhealthy→error(after 10+ consecutive failures)error→healthy(on successful auto-recovery ping)error→removed(after 24 hours of failed pings)
Testing
Local Development
Use tunneling tools to expose local endpoints:- ngrok
- Cloudflare Tunnel
- localtunnel
Test Events
Send test events from the dashboard:- Navigate to Settings → Webhooks
- Select your endpoint
- Click Send Test Event
- Choose event type
Monitoring
Log:- Event ID and type
- Processing status
- Errors and latency
- Full payload (for debugging)
- Success rate
- Processing latency
- Queue depth (if using queues)
- Endpoint availability
Troubleshooting
Webhooks not arriving:- Verify HTTPS endpoint is publicly accessible
- Check firewall rules
- Confirm endpoint URL in dashboard
- Verify correct public key
- Use raw body before JSON parsing
- Check Base64 encoding
- Normal behavior (retries)
- Implement deduplication using event ID
Next Steps
- Webhooks Overview - Webhook lifecycle and status management
- Webhook Events - Complete event catalog
- API Reference - Webhook management endpoints

