Webhooks

GET /webhooks

List the organization's webhook endpoints, newest first by default.

Requires the webhooks:read permission.

Query Parameters

limitnumber

The number of records to return.

cursorstring

A pagination cursor. Fetch the next page by passing the nextCursor value from the previous response.

sorturl | -url | createdAt | -createdAt

The sort order. Prefix a field with - to sort descending. Defaults to -createdAt.

filterstring

A JSON-encoded filter document, for example {"createdAt":{"$gte":"2025-01-01T00:00:00Z"}}. Filterable fields: id, url, isActive, createdAt. See Filtering for the syntax.

Request
curl \
  "https://api.cascade.dev/webhooks" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "url": "https://example.com",
      "isActive": true,
      "events": ["..."],
      "hasHmacSecret": true,
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ],
  "nextCursor": "string"
}

POST /webhooks

Register a webhook endpoint. It starts receiving deliveries for the events you subscribe to as soon as it is active. Triggers the webhook.created webhook.

Requires the webhooks:write permission.

Body Parameters

dataobjectrequired

The webhook to create.

Request
curl \
  -X POST \
  "https://api.cascade.dev/webhooks" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "url": "https://example.com",
    "events": [
      "customer.updated"
    ],
    "isActive": true,
    "hmacSecret": "string"
  }
}'
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "url": "https://example.com",
  "isActive": true,
  "events": ["customer.updated"],
  "hasHmacSecret": true,
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

GET /webhooks/{id}

Get a single webhook by ID.

Requires the webhooks:read permission.

Path Parameters

idstring (uuid)required

The ID of the webhook.

Request
curl \
  "https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "url": "https://example.com",
  "isActive": true,
  "events": ["customer.updated"],
  "hasHmacSecret": true,
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

PUT /webhooks/{id}

Update a webhook's URL, subscriptions, signing secret or active flag. Triggers the webhook.updated webhook.

Requires the webhooks:write permission.

Path Parameters

idstring (uuid)required

The ID of the webhook to update.

Body Parameters

dataobjectrequired

The fields to update.

Request
curl \
  -X PUT \
  "https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "url": "https://example.com",
    "events": [
      "customer.updated"
    ],
    "isActive": true,
    "hmacSecret": "string"
  }
}'
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "url": "https://example.com",
  "isActive": true,
  "events": ["customer.updated"],
  "hasHmacSecret": true,
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

DELETE /webhooks/{id}

Delete a webhook endpoint, stopping all deliveries to it. To pause it instead, set isActive to false. Triggers the webhook.deleted webhook.

Requires the webhooks:write permission.

Path Parameters

idstring (uuid)required

The ID of the webhook to delete.

Request
curl \
  -X DELETE \
  "https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "url": "https://example.com",
  "isActive": true,
  "events": ["customer.updated"],
  "hasHmacSecret": true,
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

GET /webhooks/{id}/events

List a webhook's recent deliveries, newest first, with their payloads and any errors. Use this to debug an endpoint that is not receiving what you expect.

Requires the webhooks:read permission.

Path Parameters

idstring (uuid)required

The ID of the webhook.

Query Parameters

limitnumber

The number of deliveries to return.

Request
curl \
  "https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000/events" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "webhookId": "550e8400-e29b-41d4-a716-446655440000",
      "eventName": "customer.updated",
      "idempotencyKey": "string",
      "url": "https://example.com",
      "payload": "...",
      "status": "string",
      "error": "string",
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ],
  "nextCursor": "string"
}