import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.webhooks.replayDelivery(
"whd_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.replay_webhook_delivery(
"whd_01JZX8K3M9Q4P7VN2YB6RTDC0E",
)
print(result)curl -X POST 'https://api.mails.ai/v1/webhook-deliveries/whd_01JZX8K3M9Q4P7VN2YB6RTDC0E/replay' \
-H "Authorization: Bearer $MAILS_API_KEY"mails webhooks replay whd_01JABC{
"name": "mails_webhooks_replay_delivery",
"arguments": {
"delivery_id": "whd_01JZX8K3M9Q4P7VN2YB6RTDC0E"
}
}{
"delivery_id": "whd_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"event_id": "evt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"scheduled": ["<scheduled>"],
"scheduled_at": "2026-10-04T12:00:00.000Z"
}202 Replay scheduled.
401 Missing or invalid API key.
403 The API key lacks the required scope
(insufficient_scope), or the token belongs to an
app connected by sign-in and this operation is
closed to connected apps
(connected_app_not_allowed).
404 Resource not found in this workspace, or the agent
a send names is archived (agent_archived).
429 Rate or quota limit exceeded. The body's resets_at
and retry_after_seconds say when the request can
succeed. A Retry-After header is sent only when
that is 60 seconds or less; a longer wait (an
hourly, daily or monthly cap) sends none, so retry
at resets_at or raise the limit instead of
sleeping.
500 Internal server error.Replay a delivery
Re-sends the event behind a previous delivery attempt to that delivery's endpoint only.
import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.webhooks.replayDelivery(
"whd_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.replay_webhook_delivery(
"whd_01JZX8K3M9Q4P7VN2YB6RTDC0E",
)
print(result)curl -X POST 'https://api.mails.ai/v1/webhook-deliveries/whd_01JZX8K3M9Q4P7VN2YB6RTDC0E/replay' \
-H "Authorization: Bearer $MAILS_API_KEY"mails webhooks replay whd_01JABC{
"name": "mails_webhooks_replay_delivery",
"arguments": {
"delivery_id": "whd_01JZX8K3M9Q4P7VN2YB6RTDC0E"
}
}{
"delivery_id": "whd_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"event_id": "evt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"scheduled": ["<scheduled>"],
"scheduled_at": "2026-10-04T12:00:00.000Z"
}202 Replay scheduled.
401 Missing or invalid API key.
403 The API key lacks the required scope
(insufficient_scope), or the token belongs to an
app connected by sign-in and this operation is
closed to connected apps
(connected_app_not_allowed).
404 Resource not found in this workspace, or the agent
a send names is archived (agent_archived).
429 Rate or quota limit exceeded. The body's resets_at
and retry_after_seconds say when the request can
succeed. A Retry-After header is sent only when
that is 60 seconds or less; a longer wait (an
hourly, daily or monthly cap) sends none, so retry
at resets_at or raise the limit instead of
sleeping.
500 Internal server error.Path Parameters
idstringrequired
Webhook delivery id (whd_…).
Other endpoints subscribed to the event are not sent it again; to re-send an event to every subscribed endpoint, use POST /v1/events/{id}/redeliver.
Response
delivery_idstring
The delivery that was replayed: the id in the path. The replay is recorded as a new delivery with its own id, which GET /v1/webhooks/{id}/deliveries lists.
event_idstring
The event behind that delivery, which is what was sent again.
scheduledstring[]
The endpoint the replay went to (whe_…): one id, or empty when that endpoint is paused or no longer subscribed to the event type.
scheduled_atstring
When the replay finished (ISO 8601, UTC), set even when scheduled is empty. The attempt has been made by then, and a failed one is retried like any delivery.
Was this page helpful?