# Replay events to an endpoint

URL: https://docs.fxapis.com/api-reference/webhooks/replay-events-to-an-endpoint

> Replay events to an endpoint. Queues this window's events, of the types this endpoint receives, oldest first, with their original ids.

`POST https://api.fxapis.com/v1/webhooks/{id}/replay`

Queues this window's events, of the types this endpoint receives, oldest first, with their original ids. By default (`include: "failed"`) only events it did not receive — deliveries it gave up on, and events recorded while it was switched off — so repeating a call sends nothing twice. `include: "all"` also re-sends what it already received: deduplicate on `id` first. Types follow the endpoint's events now: if you added a type later, its events recorded since the endpoint was created are sent too — never sent to it before, but older than what it has received. Up to 10,000 per call; `nextSince` says where to continue. Events written at one exact moment are never split across calls, so in the rare case of more than that at one moment, a call queues them all. For code that catches up by itself, read `GET /v1/events?after=<last listed id>` instead.

Authentication: `Authorization: Bearer <API key>`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes |  |

#### Request body (application/json, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `since` | string (date-time) | yes | From this time (inclusive), within the event history your plan keeps. Read to the microsecond: pass `nextSince` back exactly as given. |
| `until` | string (date-time) | no | Up to this time (exclusive). Defaults to now. |
| `types` | "order.filled" \| "order.rejected" \| "order.unresolved" \| "order.resolved" \| "order.cancelled" \| "position.opened" \| "position.closed" \| "account.state_changed" \| "wave.settled"[] | no | Only these types. Default: every type this endpoint receives. |
| `include` | "failed" \| "all" | no | `failed` (default): only events this endpoint did not receive — given up on, or recorded while it was off (or, for a type added to it later, recorded since it was created). `all`: also re-send events it already received. **A copy-trading or order-handling receiver must deduplicate on `id` before you use `all`.** |

#### Responses

- `202`
- `400`
- `401`
- `402`
- `403`
- `404`
- `409`

Failures return `{ "error": { "code", "message" } }`; every code is listed at https://docs.fxapis.com/errors.

#### 202 response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | object | no |  |
| `data.queued` | integer | no | Events queued to this endpoint by this call. Over the cap only when more events than that share one moment. |
| `data.include` | "failed" \| "all" | no |  |
| `data.since` | string (date-time) | no |  |
| `data.until` | string (date-time) | no |  |
| `data.nextSince` | null \| string (date-time) | no | Set when the cap was reached: call again with this as `since`. Null when the window is done. |