---
title: "EventWolf API: Replays"
description: "Replay events, list replays, get a replay, or cancel a replay, with the EventWolf API."
url: "https://agentpost.tools/docs/eventwolf/reference/replays"
kind: reference
---

# Replays

Send a range of history again, to one subscription or every subscription of an endpoint. A replay makes new matches and deliveries, with new `webhook-id` values and the events’ own `id`, and never changes the old ones.

[Replays](/docs/eventwolf/concepts/replays.md) explains what a replay sends and how a receiver tells it apart.

Paths are relative to `https://api.agentpost.tools/v1/events`, and every request follows the [API basics](/docs/platform/api-basics.md). [Who may call](/docs/eventwolf/reference.md#who-may-call) explains each kind of caller.

## Replay events

`POST /replays`

Starts a replay, which answers `202` and runs in the background. With `dryRun: true` it answers `200` with `preview`, what it would send, and writes nothing: run that first, and start the replay once the counts are what you meant. A disabled endpoint, a deleted subscription with `definitions: "current"`, and a subscription with a notification target answer `conflict`.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `filter` | `object` | No |  |
| `filter.types` | `string[]` | No | 1–50 items. |
| `filter.sources` | `string[]` | No | 1–50 items. |
| `filter.extensions` | `object` | No | Each value is a `string` or `string[]`. |
| `filter.workspace` | `string` | No | The workspace it belongs to, when the app groups its principals into workspaces; 1–200 characters. |
| `filter.subject` | `string` | No | 1–500 characters. |
| `filter.refs` | `object[]` | No | 1–20 items. |
| `filter.refs[].type` | `string` | Yes | 1–100 characters. |
| `filter.refs[].id` | `string` | No | 1–500 characters. |
| `filter.where` | `object` | No | Each value is a `string` or `string[]`. |
| `from` | `string` | Yes | An ISO 8601 date and time. |
| `to` | `string` | Yes | An ISO 8601 date and time. |
| `target` | `object` | Yes |  |
| `target.subscriptionId` | `string` | No |  |
| `target.endpointId` | `string` | No |  |
| `definitions` | `string` | Yes | One of `"current"` or `"historical"`. |
| `dryRun` | `boolean` | No | Default `false`. |

### Response

`202 Accepted`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `replay` | [`ReplayRecord`](/docs/eventwolf/reference/replays.md#the-replayrecord-object) | When set |  |
| `preview` | [`ReplayPreview`](/docs/eventwolf/reference/replays.md#the-replaypreview-object) | When set |  |

### Errors

-   [`not_found`](/docs/eventwolf/errors.md#not_found) (404)
-   [`conflict`](/docs/eventwolf/errors.md#conflict) (409)
-   [`payload_too_large`](/docs/eventwolf/errors.md#payload_too_large) (413)
-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl -X POST https://api.agentpost.tools/v1/events/replays \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": {
      "types": [
        "request.resolved"
      ]
    },
    "from": "2026-11-11T00:00:00.000Z",
    "to": "2026-11-12T00:00:00.000Z",
    "target": {
      "endpointId": "end_01M7A4A7MV7ACEEPN21HTHJE6Y"
    },
    "definitions": "current",
    "dryRun": true
  }'
```

```json title="Response"
{
  "preview": {
    "dryRun": true,
    "target": {
      "endpointId": "end_01M7A4A7MV7ACEEPN21HTHJE6Y"
    },
    "definitions": "current",
    "counts": {
      "scanned": 18,
      "matched": 18,
      "deliveries": 18
    }
  }
}
```

## List replays

`GET /replays`

Replays, newest first.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Pages:** `limit`, 1 to 200, default 50, with `next` and `after`. [Lists](/docs/platform/api-basics.md#lists) has the rule.

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | No | One of `"running"`, `"completed"`, `"canceled"`, or `"failed"`. |
| `subscriptionId` | `string` | No |  |
| `endpointId` | `string` | No |  |
| `after` | `string` | No |  |
| `limit` | `integer` | No | 1–200; default `50`. |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `replays` | [`ReplayRecord`](/docs/eventwolf/reference/replays.md#the-replayrecord-object) array | Always |  |
| `next` | `string` | When set |  |

### Errors

-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl 'https://api.agentpost.tools/v1/events/replays?endpointId=end_01M7A4A7MV7ACEEPN21HTHJE6Y' \
  -H "Authorization: Bearer sk_test_…"
```

```json title="Response"
{
  "replays": [
    {
      "id": "rpl_01M78R4G3T1T880VR82SDPXJHK",
      "filter": {
        "types": ["request.resolved"]
      },
      "from": "2026-11-11T00:00:00.000Z",
      "to": "2026-11-12T00:00:00.000Z",
      "target": {
        "endpointId": "end_01M7A4A7MV7ACEEPN21HTHJE6Y"
      },
      "definitions": "current",
      "status": "completed",
      "counts": {
        "scanned": 18,
        "matched": 18,
        "deliveries": 18
      },
      "cursor": 39,
      "requestedBy": "key:backend",
      "createdAt": "2026-11-13T09:30:00.000Z",
      "completedAt": "2026-11-13T09:30:02.000Z"
    }
  ]
}
```

## Get a replay

`GET /replays/:id`

One replay, with its counts so far.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | A replay ID, `rpl_…`. The `id` of a [`ReplayRecord`](/docs/eventwolf/reference/replays.md#the-replayrecord-object). |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `replay` | [`ReplayRecord`](/docs/eventwolf/reference/replays.md#the-replayrecord-object) | Always |  |

### Errors

-   [`not_found`](/docs/eventwolf/errors.md#not_found) (404)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl https://api.agentpost.tools/v1/events/replays/rpl_01M78R4G3T1T880VR82SDPXJHK \
  -H "Authorization: Bearer sk_test_…"
```

```json title="Response"
{
  "replay": {
    "id": "rpl_01M78R4G3T1T880VR82SDPXJHK",
    "filter": {
      "types": ["request.resolved"]
    },
    "from": "2026-11-11T00:00:00.000Z",
    "to": "2026-11-12T00:00:00.000Z",
    "target": {
      "endpointId": "end_01M7A4A7MV7ACEEPN21HTHJE6Y"
    },
    "definitions": "current",
    "status": "completed",
    "counts": {
      "scanned": 18,
      "matched": 18,
      "deliveries": 18
    },
    "cursor": 39,
    "requestedBy": "key:backend",
    "createdAt": "2026-11-13T09:30:00.000Z",
    "completedAt": "2026-11-13T09:30:02.000Z"
  }
}
```

## Cancel a replay

`POST /replays/:id/cancel`

Stops a running replay. What it already queued is still delivered.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | A replay ID, `rpl_…`. The `id` of a [`ReplayRecord`](/docs/eventwolf/reference/replays.md#the-replayrecord-object). |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `replay` | [`ReplayRecord`](/docs/eventwolf/reference/replays.md#the-replayrecord-object) | Always |  |

### Errors

-   [`not_found`](/docs/eventwolf/errors.md#not_found) (404)
-   [`conflict`](/docs/eventwolf/errors.md#conflict) (409)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl -X POST https://api.agentpost.tools/v1/events/replays/rpl_01M78R4G3T1T880VR82SDPXJHK/cancel \
  -H "Authorization: Bearer sk_test_…"
```

```json title="Response"
{
  "replay": {
    "id": "rpl_01M78R4G3T1T880VR82SDPXJHK",
    "filter": {
      "types": ["request.resolved"]
    },
    "from": "2026-11-11T00:00:00.000Z",
    "to": "2026-11-12T00:00:00.000Z",
    "target": {
      "endpointId": "end_01M7A4A7MV7ACEEPN21HTHJE6Y"
    },
    "definitions": "current",
    "status": "canceled",
    "counts": {
      "scanned": 9,
      "matched": 9,
      "deliveries": 9
    },
    "cursor": 31,
    "requestedBy": "key:backend",
    "createdAt": "2026-11-13T09:30:00.000Z",
    "completedAt": "2026-11-13T09:30:02.000Z"
  }
}
```

## The ReplayRecord object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `id` | `string` | Always | A replay ID, `rpl_…`. |
| `filter` | `object` | Always |  |
| `filter.types` | `string[]` | When set | 1–50 items. |
| `filter.sources` | `string[]` | When set | 1–50 items. |
| `filter.extensions` | `object` | When set | Each value is a `string` or `string[]`. |
| `filter.workspace` | `string` | When set | The workspace it belongs to, when the app groups its principals into workspaces; 1–200 characters. |
| `filter.subject` | `string` | When set | 1–500 characters. |
| `filter.refs` | `object[]` | When set | 1–20 items. |
| `filter.refs[].type` | `string` | Always | 1–100 characters. |
| `filter.refs[].id` | `string` | When set | 1–500 characters. |
| `filter.where` | `object` | When set | Each value is a `string` or `string[]`. |
| `from` | `string` | Always |  |
| `to` | `string` | Always |  |
| `target` | `object` | Always |  |
| `target.subscriptionId` | `string` | When set |  |
| `target.endpointId` | `string` | When set |  |
| `definitions` | `string` | Always | One of `"current"` or `"historical"`. |
| `status` | `string` | Always | One of `"running"`, `"completed"`, `"canceled"`, or `"failed"`. |
| `counts` | `object` | Always |  |
| `counts.scanned` | `number` | Always | Events in the range that met the filter. |
| `counts.matched` | `number` | Always | Matches written, one per event and subscription. |
| `counts.deliveries` | `number` | Always | Deliveries written, including those skipped for a disabled endpoint. |
| `cursor` | `number` | When set | The last sequence scanned. Progress, and where a resumed replay would pick up. |
| `error` | `string` | When set | Why it failed, when it did. |
| `requestedBy` | `string` | Always |  |
| `createdAt` | `string` | Always |  |
| `completedAt` | `string` | When set |  |

```json title="The ReplayRecord object"
{
  "id": "rpl_01M78R4G3T1T880VR82SDPXJHK",
  "filter": {
    "types": ["request.resolved"]
  },
  "from": "2026-11-11T00:00:00.000Z",
  "to": "2026-11-12T00:00:00.000Z",
  "target": {
    "endpointId": "end_01M7A4A7MV7ACEEPN21HTHJE6Y"
  },
  "definitions": "current",
  "status": "completed",
  "counts": {
    "scanned": 18,
    "matched": 18,
    "deliveries": 18
  },
  "cursor": 39,
  "requestedBy": "key:backend",
  "createdAt": "2026-11-13T09:30:00.000Z",
  "completedAt": "2026-11-13T09:30:02.000Z"
}
```

## The ReplayPreview object

The answer to a dry run: what a replay would do, with nothing written. It counts up to 5,000 events; `partial` marks a longer range.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `dryRun` | `true` | Always |  |
| `target` | `object` | Always |  |
| `target.subscriptionId` | `string` | When set |  |
| `target.endpointId` | `string` | When set |  |
| `definitions` | `string` | Always | One of `"current"` or `"historical"`. |
| `counts` | `object` | Always |  |
| `counts.scanned` | `number` | Always | Events in the range that met the filter. |
| `counts.matched` | `number` | Always | Matches written, one per event and subscription. |
| `counts.deliveries` | `number` | Always | Deliveries written, including those skipped for a disabled endpoint. |
| `partial` | `boolean` | When set | True when the preview stopped before the range’s end; `cursor` is the last sequence it counted. |
| `cursor` | `number` | When set |  |

```json title="The ReplayPreview object"
{
  "dryRun": true,
  "target": {
    "endpointId": "end_01M7A4A7MV7ACEEPN21HTHJE6Y"
  },
  "definitions": "current",
  "counts": {
    "scanned": 18,
    "matched": 18,
    "deliveries": 18
  }
}
```
