# Recover failed events

`POST https://api.fiscalisto.com/v1/webhook_endpoints/{id}/recover`

After your server was down: sends again, now, every event since `since` that this webhook listens to and didn't receive (those whose tries all failed and those that happened while it was turned off), oldest first. Up to 1,000 per call; if more are left, next_since says where to call again from. Each one is a separate try, signed with its usual webhook-id, so your server can drop the ones it already had. The webhook must be turned on.

## Before you call

- **A key for the whole account**: not limited to some issuers or to a test environment.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | The object's id. |
| `Idempotency-Key` | header |  | Optional (the SDKs send it on their own). If the response is lost, repeat the request with the same value within 24 hours: it answers the same, with idempotent-replayed: true, and doesn't do it twice (it doesn't create, send emails or charge). |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `since` | string | yes | Since when (ISO 8601, within the last 30 days): for example, when your server started failing (the webhook's failing_since). |

Example:

```json
{
  "since": "2026-11-20T09:00:00-06:00"
}
```

## With the TypeScript SDK

```ts
import { Fiscalisto } from "fiscalisto";

// La llave viene de FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const webhookRecovery = await fiscalisto.webhookEndpoints.recover("id", { since: "2026-11-20T09:00:00-06:00" }, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

# La llave viene de FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

webhook_recovery = fiscalisto.webhook_endpoints.recover("id", {"since": "2026-11-20T09:00:00-06:00"}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$webhookRecovery = $fiscalisto->webhookEndpoints->recover('id', ['since' => '2026-11-20T09:00:00-06:00'], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var webhookRecovery = await fiscalisto.WebhookEndpoints.RecoverAsync("id", new RecoverWebhookEndpointParams
{
    Since = "2026-11-20T09:00:00-06:00",
}, new RequestOptions { IdempotencyKey = "pedido-A-1042" });
```

## With the Go SDK

```go
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// La llave viene de FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	webhookRecovery, err := client.WebhookEndpoints.Recover(ctx, "id", &fiscalisto.RecoverWebhookEndpointParams{
		Since: "2026-11-20T09:00:00-06:00",
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *webhookRecovery)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.RecoverWebhookEndpointParams;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var webhookRecovery = fiscalisto.webhookEndpoints().recover("id", new RecoverWebhookEndpointParams()
        .setSince("2026-11-20T09:00:00-06:00"), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(webhookRecovery);
```

## Response 202

OK.

A `WebhookRecovery` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"webhook_recovery"` | yes | What kind of object it is («invoice», «customer»…). |
| `endpoint` | string | yes | The webhook (whe_…) they were sent to. |
| `since` | string | yes | Since when they were looked for: the `since` you sent, or when the webhook was created if that's later. |
| `events` | integer | yes | How many events went out again. 0: none were missing. (from -9007199254740991 to 9007199254740991) |
| `next_since` | string or null | yes | If more than 1,000 were left: call again with this `since`. null: all of them went out. |

```json
{
  "object": "webhook_recovery",
  "endpoint": "whe_8Kq2ZtR4mNw1Lp0sXc7V",
  "since": "2026-11-20T09:00:00-06:00",
  "events": 42,
  "next_since": null
}
```

## Errors

- `endpoint_disabled` (400): That webhook endpoint is disabled, so an event can't be resent to it. Enable it with disabled: false and resend.
- `key_restricted` (403): This key is limited to some issuers and the request touches another one (or creates one, or uses something of the whole account, like webhooks).
- `resource_missing` (404): There's no object with that id (or it belongs to another issuer or the other mode).

Plus those of any call (key, fields, limits): https://fiscalisto.com/en/docs/api/errores.md.
