Skip to content
CirrusDocs

API reference

Webhooks

Register an endpoint that is told about delivery events.

Register a webhook endpoint.

POST/v1/webhooks

Needs an API key with the webhook:manage scope. Operation createDeveloperWebhook

The URL must be https and resolve to public addresses only. The response carries the signing secret, this once.

Request body

CreateWebhookRequestCreateWebhookRequest

  • urlstringrequired

    An https URL without credentials that resolves to public addresses.

    format: uri
  • descriptionstringoptional
    length 0 to 200
  • event_typesWebhookEventType[]optional

    Leave out or empty to receive every event type.

Responses

  • 201WebhookCreated

    The new endpoint, with its signing secret. The secret cannot be read again.

    object

    • dataWebhookrequired

      A webhook endpoint.

      Show fields (8)
      • iduuidrequired
      • urlstringrequired
        format: uri
      • descriptionstringrequired
      • event_typesWebhookEventType[]required

        The event types delivered. Empty means every type.

      • enabledbooleanrequired
      • created_atdate-timerequired
      • last_event_statusstringrequiredcan be null

        The state of the newest event queued for the endpoint. Null when nothing has been sent yet, which is always the case in the response to creating one.

        One ofpendingdeliveredfailed
      • signing_secretstringoptional

        The secret deliveries are signed with. Returned once, in the response to creating the endpoint, and never again.

  • 400BadRequest
    • invalid_json: the body is not one JSON object, or has a field this endpoint does not accept.

    The body is the error envelope.

  • 401InvalidApiKey
    • unauthenticated: no API key was sent.
    • invalid_api_key: the key is unknown, revoked or expired.

    The body is the error envelope.

  • 403InsufficientScope
    • insufficient_scope: the API key does not hold the scope this operation needs.
    • account_suspended: the organisation is suspended; none of its keys work until that is lifted.
    • account_closed: the organisation has been closed; none of its keys will work again.

    The body is the error envelope.

  • 409WebhookLimitReached
    • webhook_limit_reached: the organisation already has the maximum number of endpoints.

    The body is the error envelope.

  • 422ValidationFailed
    • validation_failed: details names each invalid field.

    The body is the error envelope.

  • 429RateLimited
    • rate_limited: too many requests. Wait Retry-After seconds.
    • Retry-After header: How many seconds to wait before trying again.
    • RateLimit-Limit header: How many requests the limit that stopped this one allows per period.
    • RateLimit-Remaining header: How many requests are left in the current period.

    The body is the error envelope.

Example

Request
curl -X POST https://api.cirrusmail.example/v1/webhooks \
  -H "Authorization: Bearer $CIRRUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://shop.example/hooks/cirrus",
    "description": "Order emails",
    "event_types": [
      "email.delivered",
      "email.bounced"
    ]
  }'
Response 201
{
  "data": {
    "id": "b3c1f5a4-7d2e-4c8a-9a1b-0e6f2d4a8c11",
    "url": "https://shop.example/hooks/cirrus",
    "description": "string",
    "event_types": [
      "email.sent"
    ],
    "enabled": false,
    "created_at": "2026-01-15T09:30:00Z",
    "last_event_status": "pending",
    "signing_secret": "whsec_…"
  }
}

Set CIRRUS_API_KEY to your key. The values are examples.