Overview
Webhooks allow Inbound to push email data to your application in real-time. When an email arrives at your configured address, Inbound sends an HTTP POST request to your webhook URL with the complete email payload.Webhook Payload Structure
Every webhook request includes a fully-typed payload:Complete Payload Example
Payload Fields
Event type. Currently only
"email.received"ISO 8601 timestamp when the webhook was triggered
Complete email data
Unique email identifier (e.g.,
inbnd_abc123)RFC 5322 Message-ID header
Sender information with text and parsed addresses
Recipient information with text and parsed addresses
The email address that received this message
Email subject line
ISO 8601 timestamp when email was received
Thread identifier for conversation tracking
Position in the email thread (1 for first email)
Raw parsed email data including headers, body, and attachments
Cleaned/processed email content ready for display
Implementing a Webhook Handler
Basic Handler
With Auto-Reply
Signature Verification
Security Headers
Webhook requests include verification headers:Verifying Signatures
Using the SDK Helper
Retry Logic
Inbound automatically retries failed webhook deliveries:- Initial attempt: Immediate delivery
- Retry 1: After 1 minute
- Retry 2: After 5 minutes
- Retry 3: After 15 minutes
- Retry 4: After 1 hour
HTTP Response Codes
Your webhook endpoint should return:- 2xx: Success - no retry
- 4xx: Client error - no retry (except 429)
- 429: Rate limited - will retry
- 5xx: Server error - will retry
Idempotency
Make your webhook handler idempotent to handle duplicate deliveries:Best Practices
1. Return Quickly
Respond within 10 seconds to avoid timeouts:2. Log Webhook Events
3. Handle Errors Gracefully
4. Validate Payload Structure
5. Monitor Webhook Health
Track webhook delivery success in your dashboard:Testing Webhooks
Local Development
Use ngrok or similar tools to expose your local server:Test Endpoint
Use the API to send test webhooks:Troubleshooting
Webhooks Not Received
- Check endpoint URL - Ensure it’s publicly accessible
- Verify endpoint is active - Check in the dashboard
- Check logs - Look for delivery errors
- Test manually - Use the test endpoint feature
Failed Deliveries
- Check response codes - Must return 2xx for success
- Check timeout - Must respond within 10 seconds
- Verify SSL certificate - Must be valid for HTTPS endpoints
- Check firewall - Ensure Inbound IPs aren’t blocked