Questions · Updated 2026-09-28

How do I replay webhook events?

Replay webhook events with POST /webhooks/{id}/replay, filtered by since, until, event_type or one event_id, after a dry_run=true call has told you how many events the range holds. Replays arrive with x-agentisend-replay: true and the original event id, so deduplicate on the id.

Replay webhook events by calling POST /webhooks/{id}/replay with query parameters since and until for a time range, event_type to narrow it to one type, or event_id for one event. The operation summary says it will "Re-send past events to this endpoint, by time range and/or a single event id". Call it with dry_run=true first: the reply is count, and nothing is sent. Every replayed delivery carries x-agentisend-replay: true and the same event id as the original, so a handler that deduplicates on id treats the replay as already seen.

Count, then send

With dry_run=true the reply is count, the number of events in the range. Without it the reply is replayed, the number queued; delivery_ids, one per new delivery; and truncated, which is true when the range held more than one call may re-send, so narrow the range and repeat. The source of a replay is the original fan-out only: a replay is never itself replayed, so repeating a range does not compound.

curl -sS -X POST https://api.agentisend.com/webhooks/9c8f8f0e-3d1a-4d3f-9a1e-2b7c1a0f5e42/replay \
  -H "Authorization: Bearer $AGENTISEND_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
201 with an empty body
Response

Idempotency-Key applies. Send the same key with the same request and the original response is replayed instead of the events being queued twice.

Duplicates are expected

Webhooks has a section with that title. Delivery is at-least-once, so the same id can arrive twice: a retry after your acknowledgement was lost, or a replay you asked for. Deduplicate on the event id, which is also in the x-agentisend-event-id header. The x-agentisend-replay header lets you log a replay separately from a first delivery; verify its signature the same way as any other, with the check on How do I verify a webhook signature?.

Replaying a dead letter

A delivery that exhausted every retry is listed by GET /webhooks/{id}/dead-letters with its event_id, event_type, occurred_at, payload and last_status_code. Fix the handler against payload. Confirm the endpoint is not disabled on GET /webhooks/{id}: a disabled endpoint holds deliveries rather than sending them, and PATCH /webhooks/{id} with {"disabled": false} turns it back on. Then replay by event_id, or by a since and until range that covers the outage. The guide says a dead letter can be replayed once the endpoint is fixed, so fix first: a replay is a new delivery, and one sent into a handler that still fails fails again.

Next