Skip to main content
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.webhooks.list({ limit: 10 });
console.log(result);
{
  "data": [
    {
      "id": "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
      "url": "https://example.com",
      "event_types": ["<event_types>"],
      "description": "<description>",
      "active": false,
      "secret_rotated_at": "2026-10-04T12:00:00.000Z",
      "previous_secret_expires_at": "2026-10-04T12:00:00.000Z",
      "created_at": "<created_at>"
    }
  ],
  "has_more": false,
  "next_cursor": "<next_cursor>"
}

List webhook endpoints

GET/v1/webhooksscope · read
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.webhooks.list({ limit: 10 });
console.log(result);
{
  "data": [
    {
      "id": "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
      "url": "https://example.com",
      "event_types": ["<event_types>"],
      "description": "<description>",
      "active": false,
      "secret_rotated_at": "2026-10-04T12:00:00.000Z",
      "previous_secret_expires_at": "2026-10-04T12:00:00.000Z",
      "created_at": "<created_at>"
    }
  ],
  "has_more": false,
  "next_cursor": "<next_cursor>"
}

Query Parameters

limitinteger

Page size (1–100).

Default: 25

cursorstring

Opaque cursor from a previous page's next_cursor.

Response

dataobject[]

The items on this page, at most limit of them.

Show propertiesHide properties
idstring

Webhook endpoint id (whe_…).

urlstring

The URL events are POSTed to.

event_typesstring[]

The event types this endpoint receives. * is every type except thread.created, thread.updated, thread.deleted and message.delayed, which reach an endpoint only when it lists them by name.

descriptionstring | null

Your note about the endpoint, or null when it has none.

activeboolean

false while the endpoint is paused: nothing is delivered to it until PATCH /v1/webhooks/{id} sets it back to true.

secret_rotated_atstring | null

When the signing secret was last rotated.

previous_secret_expires_atstring | null

While set, deliveries are signed with both the new and the previous secret; null once the previous one stops signing.

created_atstring

When the endpoint was created (ISO 8601, UTC).

has_moreboolean

True when more items follow this page: pass next_cursor as cursor to get them.

next_cursorstring

Pass as cursor to fetch the next page. Absent on the last page.

Was this page helpful?