> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anivahealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reinvia consegna

> Invia di nuovo una consegna webhook

Invia di nuovo una consegna, qualunque sia il suo stato. Aniva invia lo stesso evento con lo stesso `webhook-id`
e riavvia la pianificazione dei tentativi.

> [!NOTE]
>
> Richiede lo scope `webhooks_manage`.

## Richiesta

### Parametri di percorso

**id** `string` *required*

Identificatore del webhook (UUID).

**delivery\_id** `string` *required*

Identificatore della consegna (UUID), da [Elenca consegne](https://docs.anivahealth.com/it/api/webhooks/list-deliveries.md).

## Risposta

In caso di successo, l'API restituisce `202 Accepted` con la consegna. Il suo `status` è `pending`.

**id** `string` *required*

Identificatore della consegna (UUID). Una consegna invia un evento a un webhook.

**event** `object` *required*

L'evento esattamente come inviato nel corpo della richiesta. Vedi [Payload](https://docs.anivahealth.com/it/concepts/webhooks.md#payload).

**status** `string` *required*

`pending`, `succeeded`, `failed` (tutti i tentativi sono falliti o l'endpoint ha risposto `410 Gone`) o
`cancelled` (il webhook è stato disabilitato mentre era in attesa).

**attempt\_count** `integer` *required*

Tentativi effettuati finora. Un nuovo invio riparte da `0`.

**next\_attempt\_at** `string`

Istante UTC ISO 8601 del prossimo tentativo. `null` quando non è previsto alcun tentativo.

**last\_attempt\_at** `string`

Istante UTC ISO 8601 dell'ultimo tentativo. Può essere `null`.

**last\_response\_status** `integer`

Stato HTTP dell'ultimo tentativo. `null` quando non è arrivata alcuna risposta, ad esempio in caso di timeout.

**last\_error** `string`

Un errore di rete, oppure lo stato e l'inizio del corpo della risposta. `null` dopo un esito positivo.

**attempts** `object[]` *required*

Gli ultimi 20 tentativi, dal meno recente al più recente. Ciascuno contiene `at`, `status` (stato HTTP o `null`), `duration_ms`
ed `error`.

**created\_at** `string` *required*

Istante UTC ISO 8601 in cui è stata creata la consegna.

## Risposte di errore

| Stato | Descrizione |
| - | - |
| `400` | Richiesta non valida. Vedi il messaggio `error`. |
| `401` | Chiave API non valida. |
| `403` | Nessuna chiave API, oppure una chiave API senza lo scope `webhooks_manage`. |
| `404` | Webhook o consegna non trovato, oppure il webhook appartiene a un'altra chiave API. |
| `409` | È in corso un tentativo di questa consegna: riprova tra due minuti. Oppure il webhook è disabilitato: abilitalo prima. |
| `500` | Errore interno del server. |

```bash cURL theme={null}
curl --request POST \
  --url https://anivahealth.com/api/v1/webhooks/4a6c8e0f-2b4d-4f6a-8c0e-2a4c6e8f0b1d/deliveries/7c9e1a3b-5d7f-4b2d-9e4a-6c8e0a2b4d6f/resend \
  --header 'x-api-key: YOUR_API_KEY'
```

```json 202 theme={null}
{
  "id": "7c9e1a3b-5d7f-4b2d-9e4a-6c8e0a2b4d6f",
  "event": {
    "id": "0b8e6f3a-2c4d-4e7f-9a1b-3c5d7e9f1a2b",
    "type": "appointment.confirmed",
    "timestamp": "2026-10-15T09:12:44.512Z",
    "data": {
      "object": "appointment",
      "id": "c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a",
      "url": "https://anivahealth.com/api/v1/appointments/c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a",
      "status": "confirmed",
      "previous_status": "pending",
      "status_revision": 2
    }
  },
  "status": "pending",
  "attempt_count": 0,
  "next_attempt_at": "2026-10-16T10:00:00.000Z",
  "last_attempt_at": "2026-10-15T09:13:06.000Z",
  "last_response_status": 204,
  "last_error": null,
  "attempts": [
    {
      "at": "2026-10-15T09:13:01.000Z",
      "status": 503,
      "duration_ms": 412,
      "error": "HTTP 503: Service Unavailable"
    },
    {
      "at": "2026-10-15T09:13:06.000Z",
      "status": 204,
      "duration_ms": 88,
      "error": null
    }
  ],
  "created_at": "2026-10-15T09:13:00.000Z"
}
```

```json 404 theme={null}
{
  "error": "Delivery not found"
}
```

```json 409 theme={null}
{
  "error": "An attempt is running. Try again in two minutes."
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.