> ## Documentation Index
> Fetch the complete documentation index at: https://285e39fd5e337e58f16290.sightscreen.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Replay & testing

> Replay match simulation and tape management endpoints.

Replay endpoints allow you to simulate live matches using recorded "tapes" of past match data. Useful for testing Live Activities, push notifications, and frontend rendering without waiting for real matches.

<Note>
  Replay functionality is only available when mock mode is enabled. See [Configuration](/backend/configuration) for the relevant env vars.
</Note>

## Endpoint reference

| Method   | Route                               | Auth  | Purpose                 |
| -------- | ----------------------------------- | ----- | ----------------------- |
| `POST`   | `/admin/replay/matches`             | Admin | Create a replay match   |
| `GET`    | `/admin/replay/matches`             | Admin | List replay matches     |
| `POST`   | `/admin/replay/matches/:id/control` | Admin | Control replay playback |
| `DELETE` | `/admin/replay/matches/:id`         | Admin | Delete a replay match   |
| `GET`    | `/admin/replay/tapes`               | Admin | List available tapes    |

***

### POST /admin/replay/matches `Admin`

Create a new replay match from a tape.

<ParamField body="tapeId" type="string" required>
  The ID of the recorded tape to replay.
</ParamField>

<ParamField body="speed" type="number">
  Playback speed multiplier. Default `1`. Set to `2` for double speed, etc.
</ParamField>

### GET /admin/replay/matches `Admin`

List all active replay matches and their current playback state.

### POST /admin/replay/matches/:id/control `Admin`

Control playback of a replay match.

<ParamField path="id" type="string" required>
  Replay match ID.
</ParamField>

<ParamField body="action" type="string" required>
  One of: `play`, `pause`, `stop`, `seek`.
</ParamField>

<ParamField body="position" type="number">
  Required when `action` is `seek`. The ball number to seek to.
</ParamField>

### DELETE /admin/replay/matches/:id `Admin`

Stop and delete a replay match.

### GET /admin/replay/tapes `Admin`

List all available replay tapes with metadata (match name, duration, ball count).
