Webhooks
Receive real-time notifications for email delivery events via HTTP webhooks.
Events
Wistfare Mail can send webhook notifications for the following events:
| Event | Description |
|---|---|
email.sent | Email accepted and sent to recipient server |
email.delivered | Email confirmed delivered to inbox |
email.bounced | Email delivery failed (hard or soft bounce) |
email.opened | Recipient opened the email |
email.clicked | Recipient clicked a link in the email |
email.complained | Recipient marked the email as spam |
email.failed | Email sending failed due to an error |
email.received | Incoming email received on a verified domain |
Create a Webhook
POST /api/v1/webhooks
Scope: webhooks:manage
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | HTTPS endpoint to receive events |
events | string[] | Yes | List of events to subscribe to |
Response
The signingSecret is only returned at creation time. Store it securely for signature verification.
List Webhooks
GET /api/v1/webhooks
Scope: webhooks:manage
Update a Webhook
PATCH /api/v1/webhooks/:id
Scope: webhooks:manage
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | No | Updated endpoint URL |
events | string[] | No | Updated event subscriptions |
active | boolean | No | Enable or disable the webhook |
Delete a Webhook
DELETE /api/v1/webhooks/:id
Scope: webhooks:manage
Returns 204 No Content on success.
Test a Webhook
POST /api/v1/webhooks/:id/test
Scope: webhooks:manage
Sends a test payload to your endpoint and returns the HTTP status code received.
Response
Webhook Payload
When an event fires, Wistfare Mail sends a POST request to your endpoint with this payload:
Your endpoint must return a 2xx status code within 10 seconds. Failed deliveries are retried with exponential backoff up to 3 times.
Signature Verification
Every webhook request includes a Wistmail-Signature header for verifying authenticity. The signature is an HMAC-SHA256 hex digest of the raw request body using your signingSecret.