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

const client = createClient(); // reads MAILS_API_KEY

const result = await client.events.redeliver(
  "evt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);
{
  "event_id": "evt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  "webhook_endpoint_ids": [
    "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E"
  ],
  "scheduled_at": "2026-10-04T12:00:00.000Z"
}

Redeliver an event

Re-dispatches a stored event to all matching webhook endpoints.
POST/v1/events/{id}/redeliverscope · manage
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.events.redeliver(
  "evt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);
{
  "event_id": "evt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  "webhook_endpoint_ids": [
    "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E"
  ],
  "scheduled_at": "2026-10-04T12:00:00.000Z"
}

Path Parameters

idstringrequired

Event id.

Needs a key that is not tied to an agent, since an endpoint can receive every agent's mail (403 insufficient_scope).

Response

event_idstring

The event that was sent again: the id in the path.

webhook_endpoint_idsstring[]

Ids of the endpoints it was sent to: every active endpoint whose event_types take this event. Empty when there is none.

scheduled_atstring

When the redelivery finished (UTC). Each endpoint has been tried once by then, and one that failed is retried like any delivery.

Was this page helpful?