Create Webhook
Request Body
The HTTPS URL where webhook events will be sent.Must be a publicly accessible endpoint that can receive POST requests.Example:
"https://your-app.com/webhooks/sendook"Array of event types to subscribe to. At least one event is required.Available events:
inbox.created- Inbox was createdinbox.deleted- Inbox was deletedinbox.updated- Inbox was updatedmessage.sent- Message was sent from an inboxmessage.received- Message was received in an inboxmessage.delivered- Message was successfully deliveredmessage.bounced- Message bouncedmessage.complained- Recipient marked message as spammessage.rejected- Message was rejected by recipient server
["message.received", "message.sent"]Response
Unique identifier for the webhook.
ID of the organization that owns this webhook.
The webhook endpoint URL.
Array of event types this webhook is subscribed to.
ISO 8601 timestamp of when the webhook was created.
ISO 8601 timestamp of when the webhook was last updated.
List Webhooks
Response
Returns an array of webhook objects.Unique identifier for the webhook.
ID of the organization that owns this webhook.
The webhook endpoint URL.
Array of event types this webhook is subscribed to.
ISO 8601 timestamp of when the webhook was created.
ISO 8601 timestamp of when the webhook was last updated.
Get Webhook
Path Parameters
The unique identifier of the webhook to retrieve.
Response
Unique identifier for the webhook.
ID of the organization that owns this webhook.
The webhook endpoint URL.
Array of event types this webhook is subscribed to.
ISO 8601 timestamp of when the webhook was created.
ISO 8601 timestamp of when the webhook was last updated.
Error Responses
404 Not Found"Webhook not found"- The webhook doesn’t exist or doesn’t belong to your organization
Test Webhook
Path Parameters
The unique identifier of the webhook to test.
Response
Returns
true if the test event was queued successfully.Test Event Payload
The test endpoint will send amessage.received event with a sample payload:
Error Responses
404 Not Found"Webhook not found"- The webhook doesn’t exist or doesn’t belong to your organization
Delete Webhook
Path Parameters
The unique identifier of the webhook to delete.
Response
Returns the deleted webhook object.Unique identifier for the deleted webhook.
ID of the organization that owned this webhook.
The webhook endpoint URL.
Array of event types the webhook was subscribed to.
ISO 8601 timestamp of when the webhook was created.
ISO 8601 timestamp of when the webhook was last updated.
Error Responses
404 Not Found"Webhook not found"- The webhook doesn’t exist or doesn’t belong to your organization
List Webhook Attempts
Path Parameters
The unique identifier of the webhook.
Response
Returns an array of webhook attempt objects.Unique identifier for the webhook attempt.
ID of the webhook this attempt belongs to.
The event type that triggered this webhook.
The data payload sent to the webhook endpoint.
The webhook endpoint URL that was called.
HTTP status code returned by the webhook endpoint.
Response body returned by the webhook endpoint (if available).
Whether the webhook delivery was successful (status code 2xx).
The attempt number for this delivery (1-5).
ISO 8601 timestamp of when the attempt was made.
Example Response
Webhook Event Format
All webhook events are sent as POST requests to your configured URL with the following format:Headers
Payload Structure
The type of event that occurred.
The event payload. Structure varies by event type:
- Inbox events: Contains inbox object
- Message events: Contains message object
ISO 8601 timestamp of when the event occurred.
Responding to Webhooks
Your endpoint should:- Respond with a
200status code within 5 seconds - Process the event asynchronously if needed
- Return a
200even if the event is not relevant to your application
Retry Logic
If your endpoint fails or times out, Sendook will retry with exponential backoff:- Attempt 1: Immediate
- Attempt 2: After 1 minute
- Attempt 3: After 5 minutes
- Attempt 4: After 30 minutes
- Attempt 5: After 2 hours
Security Best Practices
Use HTTPS
Use HTTPS
Always use HTTPS URLs for webhook endpoints to ensure data is encrypted in transit.
Validate Source
Validate Source
Verify that webhook requests are coming from Sendook by checking the source IP or implementing signature verification.
Idempotency
Idempotency
Process webhook events idempotently, as you may receive the same event multiple times due to retries.