# Resend failed webhook events

> Source: https://truto.one/docs/api-reference/admin/webhook-events/resend/

`POST /webhook-event/resend`

Resource: **Webhook events**

Sends failed events again with the same `id` and body, so your endpoint can deduplicate them. `X-Truto-Signature` is computed with the webhook's current secret, so it differs from the first send if the secret has changed since; a form-data event also gets a new multipart boundary. Each event goes back to `pending` and waits behind new events, so a large resend never delays live delivery. It is then tried once more, and retried like a new event: up to 5 attempts over the 5 minutes after that first attempt. When it is delivered it leaves the failed list and is listed as `delivered` (a `sync_job_run:record` event is removed instead). If its webhook is no longer active, it fails again without being sent. Pending and delivered events are never resent.

Name the events by `ids`, or select them with filters, not both. One of them is required. A call resends failed events oldest first, up to 1,000 of them and about 64 MB of their bodies. While 1,000 or more events of the environment are waiting to be sent, it answers 429: wait `Retry-After` seconds. When `has_more` is `true`, call again with the same `ids` or filters and the `next_cursor` it returned; the cursor carries on after the events already resent, so one that has failed again since is not sent twice.

## Request body

- **`environment_id`** _(string)_
  The environment whose events to resend. Required when you call with a dashboard session; an API token uses its own environment.
- **`ids`** _(array<string>)_
  The events to resend, in this order. Ones that are not failed are skipped.
- **`webhook_id`** _(string)_
  Resend the failed events for this webhook.
- **`integrated_account_id`** _(string)_
  Resend the failed events about this integrated account.
- **`event`** _(string)_
  Resend the failed events of this type.
- **`created_at`** _(object)_
  Resend the failed events created in this window.
  - **`gt`** _(string)_
    Created after this time (ISO 8601, compared to the second).
  - **`lt`** _(string)_
    Created before this time (ISO 8601, compared to the second).
- **`next_cursor`** _(string)_
  The `next_cursor` of the previous call with the same `ids` or filters.

## Response body

- **`resent`** _(integer)_
  How many failed events this call sent back to `pending`.
- **`has_more`** _(boolean)_
  Whether more of the events you selected are still to be resent.
- **`next_cursor`** _(string)_
  Pass this with the same `ids` or filters to carry on; `null` when `has_more` is `false`.

## Errors

| Status | Description |
| :----- | :---------- |
| `400` | No `ids` or filters, both, an invalid or unknown field, an invalid `next_cursor`, or no `environment_id` from a dashboard session. Nothing is resent. |
| `403` | The caller cannot reach `environment_id`. |
| `429` | 1,000 or more events of the environment are waiting to be sent, so nothing was resent. Try again after `Retry-After` seconds. |
| `503` | A resend by filters needs the same preparation as the list (see `GET /webhook-event`). Try again after `Retry-After` seconds. A resend by `ids` does not. |
| `507` | The environment's event storage filled up during the call. The `message` says how many events were resent before it stopped. Try again later. |

## Code examples

### curl

```bash
curl -X POST 'https://api.truto.one/webhook-event/resend' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
  "created_at": {
    "gt": "2026-11-08T00:00:00Z"
  }
}'
```

### JavaScript

```javascript
const body = {
  "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
  "created_at": {
    "gt": "2026-11-08T00:00:00Z"
  }
};

const response = await fetch('https://api.truto.one/webhook-event/resend', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/webhook-event/resend"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
    "created_at": {
        "gt": "2026-11-08T00:00:00Z"
    }
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())
```
