# Send Deliveries Again

Put your tenant's deliveries back in the queue with a fresh set of attempts: one event's, those of a time range, or every one that failed.

## Overview

- In one `environment`, name exactly one of: `eventId` (that event's deliveries), `from` and `to` (those queued in that range, at most 31 days), or `"failed": true` (every delivery that is `failed` or `retrying`). Add `endpointId` to take only one address's deliveries.
- By event or range, every delivery that is not `pending` or `sending` goes again — a `delivered` one too. A delivery still waiting or being sent is left as it is.
- The same body goes again with the same event id, signed when it is sent, to the address and with the secret it has then: a receiver that already has the event drops it. Each delivery gets 10 new attempts; its attempts log restarts from 1.
- At most 500 deliveries a call, oldest first: `more` is `true` when others match — call again. At most **10 calls a minute**.
- A body that doesn't fit answers `400` `WEBHOOK_RESEND_INVALID` with the field: `Name exactly one of: eventId, a range (from and to), or failed: true`, `A range needs both from and to`, `to must be after from`, `A range spans at most 31 days`, `An event id is evt_ and 32 hex characters`.
- For a tenant role that manages the webhooks — `owner`, `tenantadmin`, `non_signing_admin` or `security_admin`. Written to the tenant's activity log with how many went again.

## Endpoint

### `POST /v1/admin/tenants/{id}/webhook-deliveries/resend`

Authentication: bearer token required.

Puts the chosen deliveries back in the queue with a fresh budget of attempts.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Tenant UUID |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `environment` | string | yes | `production` or `sandbox` |
| `eventId` | string | no | One event's deliveries |
| `from` | string (date-time) | no | With `to`: the deliveries queued in this range |
| `to` | string (date-time) | no | After `from`, at most 31 days later |
| `failed` | boolean | no | `true`: every delivery that failed or is waiting for a retry |
| `endpointId` | string | no | Only this address's deliveries |

**Responses**

`200` Queued

```json
{
  "resent": 2,
  "deliveryIds": ["c41f2a8e-6d3b-4e7a-9f15-0b8d2c6e4a91", "9d4e2b70-8a1f-4c3e-b5d6-1f0e9a8b7c64"],
  "more": false
}
```

`400` Refused

```json
{
  "statusCode": 400,
  "error": "BadRequestError",
  "message": "Name exactly one of: eventId, a range (from and to), or failed: true",
  "details": {
    "code": "WEBHOOK_RESEND_INVALID",
    "field": "eventId",
    "issues": [{ "path": "eventId", "message": "Name exactly one of: eventId, a range (from and to), or failed: true" }]
  }
}
```

**Example request**

```bash
curl -X POST https://api.aureahub.com/v1/admin/tenants/$TENANT_ID/webhook-deliveries/resend \
  -H "Authorization: Bearer $TENANT_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "environment": "production", "failed": true }'
```

---

Web version: https://docs.aureahub.com/#webhook-deliveries-resend
