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

const client = createClient(); // reads MAILS_API_KEY

const result = await client.webhooks.deliveries(
  "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  {
    limit: 10,
  },
);
console.log(result);
{
  "data": [
    {
      "id": "whd_01JZX8K3M9Q4P7VN2YB6RTDC0E",
      "webhook_endpoint_id": "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
      "event_id": "evt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
      "attempt_number": 0,
      "status": "pending",
      "http_status": 0,
      "response_body_excerpt": "<response_body_excerpt>",
      "next_retry_at": "2026-10-04T12:00:00.000Z",
      "delivered_at": "2026-10-04T12:00:00.000Z",
      "created_at": "<created_at>"
    }
  ],
  "has_more": false,
  "next_cursor": "<next_cursor>"
}

List delivery attempts

GET/v1/webhooks/{id}/deliveriesscope · read
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.webhooks.deliveries(
  "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  {
    limit: 10,
  },
);
console.log(result);
{
  "data": [
    {
      "id": "whd_01JZX8K3M9Q4P7VN2YB6RTDC0E",
      "webhook_endpoint_id": "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
      "event_id": "evt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
      "attempt_number": 0,
      "status": "pending",
      "http_status": 0,
      "response_body_excerpt": "<response_body_excerpt>",
      "next_retry_at": "2026-10-04T12:00:00.000Z",
      "delivered_at": "2026-10-04T12:00:00.000Z",
      "created_at": "<created_at>"
    }
  ],
  "has_more": false,
  "next_cursor": "<next_cursor>"
}

Path Parameters

idstringrequired

Webhook endpoint id.

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

Delivery id (whd_…). Each attempt is a delivery of its own, so a retry has a new id; pass one to POST /v1/webhook-deliveries/{id}/replay.

webhook_endpoint_idstring

The endpoint the event was sent to (whe_…).

event_idstring

The event that was sent (evt_…); read it with GET /v1/events/{id}.

attempt_numberinteger

Which try this was: 1 for the first, 2 and 3 for the automatic retries. A replay, a redelivery or a test starts again at 1.

statusstring

failed: this attempt failed and a retry follows, as a delivery of its own with the next attempt_number. dlq (dead-lettered): no retry follows, because three attempts failed or a retry came due while the endpoint was paused (response_body_excerpt then says so). Replay any delivery with POST /v1/webhook-deliveries/{id}/replay.

One of: pending, succeeded, failed, dlq

http_statusinteger

The HTTP status the endpoint answered with; redirects are followed, 3 at most. Absent while pending, and when no answer came back: a connection error, no answer within 5 seconds, or an address that is not public.

response_body_excerptstring

The first 500 characters of the endpoint's response body. When no answer came back, or a retry could not be made, the reason instead; absent while pending.

next_retry_atstring

When the retry of a failed attempt is due: 30 seconds after a first failure, 2 minutes after a second. Absent once that retry has been made, and on attempts that get none.

delivered_atstring

When the endpoint answered with a 2xx. Present only when status is succeeded.

created_atstring

When this attempt started (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?