Skip to main content

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

Message Events

You can subscribe to multiple events in a single webhook by providing an array of event names.

Webhook Payload Structure

All webhooks follow this structure:

Common Fields

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:
The test sends a message.received event with dummy data:

Implementing a Webhook Endpoint

Your webhook endpoint should:
  1. Accept POST requests
  2. Parse JSON body
  3. Process the event
  4. Respond with 2xx status code
Your webhook endpoint must respond within 5 seconds. For long-running operations, acknowledge the webhook immediately and process asynchronously.

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
Monitor your webhook endpoint’s uptime and response times to ensure reliable event delivery.

Security Best Practices

Always use HTTPS URLs for webhook endpoints to ensure data is encrypted in transit.
In production, validate that requests are coming from Sendook’s servers by checking the source IP or implementing webhook signatures.
Store processed event IDs to prevent processing the same event multiple times if webhooks are retried.
Acknowledge webhooks within 5 seconds. Queue heavy processing for background jobs.
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