Create Webhook
Request Body
string
required
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"string[]
required
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
string
Unique identifier for the webhook.
string
ID of the organization that owns this webhook.
string
The webhook endpoint URL.
string[]
Array of event types this webhook is subscribed to.
string
ISO 8601 timestamp of when the webhook was created.
string
ISO 8601 timestamp of when the webhook was last updated.
List Webhooks
Response
Returns an array of webhook objects.string
Unique identifier for the webhook.
string
ID of the organization that owns this webhook.
string
The webhook endpoint URL.
string[]
Array of event types this webhook is subscribed to.
string
ISO 8601 timestamp of when the webhook was created.
string
ISO 8601 timestamp of when the webhook was last updated.
Get Webhook
Path Parameters
string
required
The unique identifier of the webhook to retrieve.
Response
string
Unique identifier for the webhook.
string
ID of the organization that owns this webhook.
string
The webhook endpoint URL.
string[]
Array of event types this webhook is subscribed to.
string
ISO 8601 timestamp of when the webhook was created.
string
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
string
required
The unique identifier of the webhook to test.
Response
boolean
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
string
required
The unique identifier of the webhook to delete.
Response
Returns the deleted webhook object.string
Unique identifier for the deleted webhook.
string
ID of the organization that owned this webhook.
string
The webhook endpoint URL.
string[]
Array of event types the webhook was subscribed to.
string
ISO 8601 timestamp of when the webhook was created.
string
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
string
required
The unique identifier of the webhook.
Response
Returns an array of webhook attempt objects.string
Unique identifier for the webhook attempt.
string
ID of the webhook this attempt belongs to.
string
The event type that triggered this webhook.
object
The data payload sent to the webhook endpoint.
string
The webhook endpoint URL that was called.
number
HTTP status code returned by the webhook endpoint.
string
Response body returned by the webhook endpoint (if available).
boolean
Whether the webhook delivery was successful (status code 2xx).
number
The attempt number for this delivery (1-5).
string
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
string
The type of event that occurred.
object
The event payload. Structure varies by event type:
- Inbox events: Contains inbox object
- Message events: Contains message object
string
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.