Overview
Webhooks allow you to receive real-time notifications when events occur in your Sendook account. You can subscribe to events like receiving emails, delivery confirmations, bounces, and more.Creating a Webhook
Set up a webhook by specifying your endpoint URL and the events you want to receive:Available Events
Subscribe to any of the following events:Inbox Events
| Event | Description |
|---|---|
inbox.created | New inbox was created |
inbox.deleted | Inbox was deleted |
inbox.updated | Inbox details were updated |
Message Events
| Event | Description |
|---|---|
message.sent | Message was sent to AWS SES |
message.received | Incoming email was received |
message.delivered | Message was successfully delivered to recipient |
message.bounced | Message bounced (invalid email or rejection) |
message.complained | Recipient marked message as spam |
message.rejected | Message was rejected before sending |
Webhook Payload Structure
All webhooks follow this structure:Common Fields
| Field | Type | Description |
|---|---|---|
event | string | The event type that triggered the webhook |
messageId | string | ID of the related message (if applicable) |
inboxId | string | ID of the related inbox (if applicable) |
payload | object | Event-specific data |
Event Payload Examples
message.received
message.delivered
message.bounced
inbox.created
Managing Webhooks
List All Webhooks
Get Webhook Details
Delete a Webhook
Testing Webhooks
Test your webhook endpoint to verify it’s working correctly:message.received event with dummy data:
Implementing a Webhook Endpoint
Your webhook endpoint should:- Accept POST requests
- Parse JSON body
- Process the event
- Respond with 2xx status code
Webhook Retry Logic
If your endpoint fails to respond with a 2xx status code:- Sendook will retry the webhook up to 3 times
- Retries use exponential backoff (5s, 25s, 125s)
- After 3 failed attempts, the webhook delivery is marked as failed
- Repeated failures may result in your webhook being disabled
Security Best Practices
Use HTTPS
Use HTTPS
Always use HTTPS URLs for webhook endpoints to ensure data is encrypted in transit.
Validate webhook source
Validate webhook source
In production, validate that requests are coming from Sendook’s servers by checking the source IP or implementing webhook signatures.
Handle duplicates
Handle duplicates
Store processed event IDs to prevent processing the same event multiple times if webhooks are retried.
Respond quickly
Respond quickly
Acknowledge webhooks within 5 seconds. Queue heavy processing for background jobs.
Monitor failures
Monitor failures
Set up alerts for webhook failures to catch issues early before webhooks are disabled.
Common Use Cases
Email Notification System
Use
message.received to notify users of new emails in real-time.Delivery Tracking
Monitor
message.delivered and message.bounced to track email delivery rates.Auto-Reply Bot
Respond to
message.received events with automated replies.Support Ticket Creation
Create support tickets automatically when receiving emails.
Next Steps
Receiving Emails
Learn more about handling incoming emails
Sending Emails
Understand message statuses and delivery
Threads
Track conversations with thread IDs
API Reference
View complete webhook API documentation