# Retry a delivery

`POST /api/v1/webhooks/{id}/deliveries/{deliveryId}/retry`

Queues a failed or dead delivery for another attempt, right away. The attempt counter is kept, so a dead delivery gets one more attempt and dies again if it fails. A delivered or already pending delivery answers 409. Requires the "webhooks:manage" scope.

Scope: `webhooks:manage`
Idempotency-Key: optional

## Parameters

- `id` (path, string, required) — Awrora id (UUID) for the endpoint.
- `deliveryId` (path, string, required) — Awrora id (UUID) for the delivery.
- `Idempotency-Key` (header, string) — Optional. A unique key, 8-200 characters. Retrying with the same key replays the first response verbatim instead of acting twice.

## Responses

- `200` — The delivery, now queued.
- `401` — Missing, invalid, revoked or expired API key — codes "api_key_missing", "api_key_invalid", "api_key_revoked", "api_key_expired".
- `403` — The API app is off, the plan does not include the API, or the key lacks the required scope — codes "app_not_enabled", "plan_upgrade_required", "insufficient_scope" (the last carries "required_scope").
- `404` — No such resource. The same response is returned for a resource that belongs to another organization — code "not_found".
- `409` — The request conflicts with the current state — codes "insufficient_capacity" (carries "seats_available"), "conflict", or "idempotency_in_progress" when another request with the same Idempotency-Key is still running.
- `429` — Rate limit exceeded — code "rate_limited". See the x-ratelimit-* headers.
- `500` — Something went wrong on our side — code "internal_error".

## Response `200`

- `id` (string, required) — Awrora id (UUID) for the delivery attempt record.
- `endpoint_id` (string, required) — The endpoint this delivery goes to.
- `event_id` (string, required) — The event being delivered. Also the id in the envelope.
- `event_type` (string, required) — Event type, copied from the event for filtering.
- `status` ("pending" | "delivered" | "failed" | "dead", required) — pending = waiting for its next attempt; delivered = the endpoint answered 2xx; failed = given up early (the endpoint was disabled); dead = six attempts failed, we stopped trying. Retry a dead or failed delivery with the retry endpoint.
- `attempts` (integer, required) — How many attempts have been made.
- `next_attempt_at` (string | null, required) — When the next attempt is due, ISO 8601 with offset. Only meaningful while pending.
- `last_status_code` (integer | null, required) — HTTP status from the last attempt, or null when the request never got a response.
- `last_error` (string | null, required) — Short description of the last failure. Never a copy of your response body.
- `response_ms` (integer | null, required) — How long the last attempt took, in milliseconds.
- `created_at` (string, required) — ISO 8601 timestamp with offset.
- `delivered_at` (string | null, required) — ISO 8601 with offset, or null.

## Example

```bash
curl -X POST "https://your-site.awrora.app/api/v1/webhooks/id_8f2k3n/deliveries/delivery_8f2k3n/retry" \
  -H "Authorization: Bearer $AWRORA_API_KEY"
```