# Resend an event

`POST https://api.fiscalisto.com/v1/events/{id}/resend`

Sends again, now, an event from the last 30 days: to one webhook (endpoint) or to all the enabled ones that listen for that type. It's a separate attempt, signed with the same webhook-id: it doesn't change the automatic retries, and if it arrives, it's no longer retried. Use it after fixing your server, with GET /v1/events?delivery_success=false.

## 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 |
| --- | --- | --- | --- |
| `endpoint` | string |  | The webhook (whe_…) to send it to again. Not sent: to all enabled webhooks that listen for that event type. |

Example:

```json
{
  "endpoint": "whe_8Kq2ZtR4mNw1Lp0sXc7V"
}
```

## With the TypeScript SDK

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

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

const eventResend = await fiscalisto.events.resend("id", { endpoint: "whe_8Kq2ZtR4mNw1Lp0sXc7V" }, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

event_resend = fiscalisto.events.resend("id", {"endpoint": "whe_8Kq2ZtR4mNw1Lp0sXc7V"}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

$eventResend = $fiscalisto->events->resend('id', ['endpoint' => 'whe_8Kq2ZtR4mNw1Lp0sXc7V'], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

var eventResend = await fiscalisto.Events.ResendAsync("id", new ResendEventParams
{
    Endpoint = "whe_8Kq2ZtR4mNw1Lp0sXc7V",
}, 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()

	eventResend, err := client.Events.Resend(ctx, "id", &fiscalisto.ResendEventParams{
		Endpoint: fiscalisto.String("whe_8Kq2ZtR4mNw1Lp0sXc7V"),
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *eventResend)
}
```

## With the Java SDK

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

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

var eventResend = fiscalisto.events().resend("id", new ResendEventParams().setEndpoint("whe_8Kq2ZtR4mNw1Lp0sXc7V"), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(eventResend);
```

## Response 202

OK.

A `EventResend` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"event_resend"` | yes | What kind of object it is («invoice», «customer»…). |
| `event` | string | yes | The event (evt_…) sent again. |
| `deliveries` | integer | yes | How many webhooks it went to. 0 if no enabled one listens to that event type. (from -9007199254740991 to 9007199254740991) |

```json
{
  "object": "event_resend",
  "event": "evt_0PKhIdhYuAGwzmMQYfkc",
  "deliveries": 1
}
```

## 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.
