# Replay events to an endpoint

`POST https://api.morevoice.ai/v1/webhook_endpoints/{id}/replay`

Queues a new delivery to this endpoint for every stored event since `since` that it subscribes to (optionally only `types`, or only the events whose deliveries to it never succeeded). At most 10 000 events; narrow the window otherwise. Events keep their ids, so receivers can deduplicate.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `webhook_endpoints_replay`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | A webhook endpoint ID (`we_…`). |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |
| `Idempotency-Key` | `string` | no | A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice. |

## Request body

Required, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `since` | `string` | yes | Replay events created at or after this time (events are kept 30 days). |
| `only_failed` | `boolean` | no | Only events whose deliveries to this endpoint never succeeded. |
| `types` | `string[]` | no | Only these types (within the endpoint's own `enabled_events`). |
| `until` | `string` | no | …and up to this time (default: now). |

Example:

```json
{
  "only_failed": true,
  "since": "2026-11-03T00:00:00Z"
}
```

## Responses

### 200 OK

OK Returns `WebhookReplay`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"webhook_replay"` | — |
| `endpoint_id` | `string` | A webhook endpoint ID (prefix `we_`). |
| `since` | `string` | An ISO-8601 timestamp in UTC. |
| `until` | `string` | An ISO-8601 timestamp in UTC. |
| `types` | `string[]` | — |
| `only_failed` | `boolean` | — |
| `events_queued` | `integer` | New deliveries queued (one per event; at most 10000). They keep their event ids, so receivers can deduplicate. |

Example:

```json
{
  "endpoint_id": "we_4Gk2LmN9pQ4rS6tV8wX0yZ",
  "events_queued": 12,
  "object": "webhook_replay",
  "only_failed": true,
  "since": "2026-11-03T00:00:00.000Z",
  "types": [
    "*"
  ],
  "until": "2026-11-04T00:00:00.000Z"
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID (in the path or the body) exists in this organisation and mode. Returns `ErrorEnvelope`.

### 409 Conflict

The request conflicts with the object's state, or the Idempotency-Key was reused with other parameters. Returns `ErrorEnvelope`.

### 413 Payload Too Large

The request body is larger than the endpoint accepts, or has more parts or files than it takes. Returns `ErrorEnvelope`.

### 415 Unsupported Media Type

The request body's Content-Type is not one the endpoint takes. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const webhookReplay = await mv.webhookEndpoints.replay("we_7Hk2Lm9Qp", {
	only_failed: true,
	since: "2026-11-03T00:00:00Z",
});
console.log(webhookReplay);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

webhook_replay = client.webhook_endpoints.replay("we_7Hk2Lm9Qp", {
    "only_failed": True,
    "since": "2026-11-03T00:00:00Z",
})
print(webhook_replay)
```

**cURL**

```sh
curl -X POST https://api.morevoice.ai/v1/webhook_endpoints/we_7Hk2Lm9Qp/replay \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "only_failed": true,
  "since": "2026-11-03T00:00:00Z"
}'
```
