---
title: "Re-run a terminal execution byte-exact as a new execution"
method: POST
path: "/v1/executions/{id}/replay"
---

# Re-run a terminal execution byte-exact as a new execution

`POST /v1/executions/{id}/replay`

## Request

- Base URL: `https://api.klanexai.com`
- URL: `https://api.klanexai.com/v1/executions/{id}/replay`
- Auth: API key in header `X-API-Key`

Clones target, byte-exact payload, and sealed credentials with a fresh attempt counter. Replays of approval-gated executions pause in PENDING_APPROVAL again. Not idempotent by design.

## Path parameters

- `id` string, required

## Response `202`

Clone created (QUEUED, or PENDING_APPROVAL if gated).

- ReplayResponse
  - `execution_id` string
  - `status` 'PENDING_APPROVAL' | 'QUEUED' | 'RUNNING' | 'RETRYING' | 'SUCCEEDED' | 'FAILED'
  - `replay_of` string

## Other responses

- `401`: Missing or invalid X-API-Key.
- `404`: No such execution for this tenant.
- `409`: Execution is not in a terminal state (NOT_TERMINAL).
- `429`: Per-tenant rate limit exceeded; retry after Retry-After seconds.
- `502`: Persisted but could not be enqueued; safe to retry the request.

---

[API](https://skmtc.dev/klanexai/apis/klanex-api.md) · [All operations](https://skmtc.dev/klanexai/apis/klanex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/klanexai/apis/klanex-api/revisions/daf36597612f?raw)
