Replay a webhook delivery
POST /webhooks/deliveries/{id}/replay - Replay a dead-lettered webhook delivery after your handler is fixed.
0Gate is the primary public integration path for hosted payment, ramp, and swap experiences. Keep secret-key operations on your server and hand only browser-safe values to the widget.
Endpoint
| Field | Value |
|---|---|
| Method | POST |
| Path | /v1/webhooks/deliveries/{id}/replay |
| Area | Webhooks |
| Operation id | replayWebhookDelivery |
| Auth boundary | Secret key from your server. |
The {id} path parameter is a delivery id you read from GET /webhooks/deliveries.
Use it for
Re-queue a dead-lettered delivery for another attempt, after you have fixed the handler that was failing. The worker picks it up on the next tick and its status returns to pending.
Only your own deliveries are replayable, and only ones currently in dead_lettered state. A delivery in any other state — pending, in_flight, or succeeded — returns 400. A delivery that is not yours, or does not exist, returns 404.
Server-side, secret key only
This endpoint requires an sk_* secret key sent from your server. pk_* publishable keys cannot replay deliveries.
Request
Path parameters
| Field | Required | Type | Use it for |
|---|---|---|---|
id | Yes | string | The dead_lettered delivery id to re-queue. |
There is no request body. This route is not idempotent: it only succeeds against a delivery currently in dead_lettered state. A successful replay moves that delivery back to pending, so an immediate retry of the same call returns 400 (the delivery is no longer dead-lettered). Read the delivery's state from GET /webhooks/deliveries before retrying, rather than blindly replaying.
Response
Returns the re-queued WebhookDelivery with status back to pending. The event_id is unchanged, so the replayed event will dedupe against any copy you already processed. For the full field list, see the WebhookDelivery record.
| Field | Type | Use it for |
|---|---|---|
object | string | Always webhook_delivery. |
id | string | The delivery id you replayed. |
event_id | string | Unchanged stable event id; your dedupe key. |
event_type | string | The event being re-delivered. |
status | enum | Now pending — the worker will attempt delivery on the next tick. |
attempts | integer | Attempt count carried over from before the replay. |
Examples
curl -X POST https://gate-api.0bit.app/v1/webhooks/deliveries/whd_test_67a1f3b9e4b0c10009999999/replay \
-H "Authorization: Bearer sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"{
"object": "webhook_delivery",
"id": "whd_test_67a1f3b9e4b0c10009999999",
"event_id": "9b2d6c1a-1111-2222-3333-444455556666",
"event_type": "gate_session.completed",
"target_url": "https://partner.example/webhooks/0bit",
"status": "pending",
"attempts": 5,
"last_response_status": 500,
"last_error": "HTTP 500: (empty body)",
"next_attempt_at": "2026-01-01T03:00:00Z",
"delivered_at": null,
"created_at": "2026-01-01T00:00:01Z",
"updated_at": "2026-01-01T03:00:00Z"
}The delivery is back in the queue. Confirm the next attempt's outcome with GET /webhooks/deliveries.
Errors
All errors use the unified envelope and carry an X-Request-Id response header. Branch on code/type/statusCode, not on the free-form message.
{
"type": "invalid_request",
"code": "invalid_request",
"message": "Example error using fake data.",
"request_id": "req_test_000000000123",
"doc_url": null,
"statusCode": 400
}| Status | type | When it happens |
|---|---|---|
400 | invalid_request | The delivery is not in dead_lettered state — pending, in_flight, and succeeded deliveries cannot be replayed. |
401 | unauthorized | Missing or invalid secret key. |
404 | not_found | Delivery not found or not scoped to this partner. Cross-tenant access is 404, never 403. |
429 | rate_limited | Throttled. This route allows up to 30 requests per minute. Back off and retry. |
5xx | server_error | Transient server failure. Retry with bounded backoff. |
Production rules
- Keep secret keys on your server. This endpoint requires an
sk_*key. - Replay only after the handler defect is fixed — otherwise the delivery dead-letters again.
- Replay works only on a
dead_lettereddelivery, and it is not idempotent: once replayed the delivery ispending, so a second identical call returns400. Re-read the delivery state instead of retrying blindly. - The
event_idis preserved across a replay; keep deduping on it so a re-delivery is safe. - Branch on machine-readable status, error code, object id, and request id.
- Treat examples and placeholder ids as fake data only.
Public boundary
This reference covers partner-scoped endpoint behavior, authentication, idempotency, webhook verification, and support-safe records. Internal operations, administrative routes, settlement venues, and unsupported availability claims are outside the public API contract.