← Back to API Reference

POST /webhooks

Create Webhook

Create a webhook endpoint for delivery and engagement events.

Request (cURL)

curl -X POST "http://localhost:8080/v1/webhooks" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com/webhooks/mail",
  "secret": "whsec_your_signing_secret",
  "enabled": true,
  "events": [
    "email.sent",
    "email.bounced"
  ]
}'

Response Example

{
  "data": {
    "id": "wh_123",
    "url": "https://example.com/webhooks/mail",
    "enabled": true,
    "events": [
      "email.sent",
      "email.delivered"
    ],
    "created_at": "2026-06-09T21:20:46.820Z",
    "updated_at": "2026-06-09T21:20:46.820Z",
    "has_secret": true
  }
}

Request Body Example

{
  "url": "https://example.com/webhooks/mail",
  "secret": "whsec_your_signing_secret",
  "enabled": true,
  "events": [
    "email.sent",
    "email.bounced"
  ]
}