---
title: "Replay a run"
---

> Documentation Index
> Fetch the complete documentation index at: https://simplcron.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Replay a run

Path: Simplcron API › Runs

`POST /v1/runs/{runId}/replay`

Create a new run ID with the earlier payload and a link to the failed or cancelled run.

## Authentication

Requires one of the following:

- `bearerAuth`, http bearer, header `Authorization`
- `browserSession`, apiKey, in cookie
- `localBrowserSession`, apiKey, in cookie

## Path parameters

- `runId` (`replayRun.path.runId`; string, required) — ID returned at submission.
  - pattern: `^run_[a-f0-9]{32}$`

## Header parameters

- `Idempotency-Key` (`replayRun.header.Idempotency-Key`; string, optional) — Reuse the same value when repeating the same submission. Reusing it with different inputs returns a conflict.
  - maxLength: `160` · minLength: `1`

## Code samples

### cURL

```bash
curl --request POST \
  --url '<base-url>/v1/runs/<runId>/replay' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = '<base-url>/v1/runs/<runId>/replay';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/v1/runs/<runId>/replay"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
```

## Responses

### 200

Previously accepted run with the same idempotency key

#### Example

```json
{
  "id": "string",
  "runId": "string",
  "task": "string",
  "taskName": "string",
  "status": "scheduled",
  "source": "string",
  "attempt": 5,
  "maxAttempts": 3,
  "payload": {},
  "output": null,
  "error": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "startedAt": "2019-08-24T14:15:22Z",
  "finishedAt": "2019-08-24T14:15:22Z",
  "runAt": "2019-08-24T14:15:22Z",
  "nextAttemptAt": "2019-08-24T14:15:22Z",
  "waitUntil": "2019-08-24T14:15:22Z",
  "waitStartedAt": "2019-08-24T14:15:22Z",
  "waitResumedAt": "2019-08-24T14:15:22Z",
  "replyTimeoutSeconds": 5,
  "waitOutcome": "reply",
  "reply": {
    "receivedAt": "2019-08-24T14:15:22Z",
    "payload": {}
  },
  "durationMs": 0,
  "previousRunId": "string"
}
```

- `id` (`replayRun.response.200.id`; string, required)
- `task` (`replayRun.response.200.task`; string, required)
  - maxLength: `64` · pattern: `^[a-z0-9]+(?:-[a-z0-9]+)*$`
- `status` (`replayRun.response.200.status`; string, required)
  - one of `"scheduled"`, `"queued"`, `"waiting"`, `"running"`, `"retrying"`, `"succeeded"`, `"failed"`, `"cancelled"`
- `attempt` (`replayRun.response.200.attempt`; integer, required)
  - maximum: `5` · minimum: `0`
- `maxAttempts` (`replayRun.response.200.maxAttempts`; integer, required)
  - maximum: `5` · minimum: `1` · default: `3`
- `createdAt` (`replayRun.response.200.createdAt`; string, required)
  - format: `date-time`
- `runId` (`replayRun.response.200.runId`; string, optional)
- `taskName` (`replayRun.response.200.taskName`; string, optional)
- `source` (`replayRun.response.200.source`; string, optional)
- `payload` (`replayRun.response.200.payload`; object, optional)
- `output` (`replayRun.response.200.output`; unknown, optional)
- `error` (`replayRun.response.200.error`; any of, optional)
  - any of the following: `string`, `null`
- `startedAt` (`replayRun.response.200.startedAt`; any of, optional)
  - any of the following: `string`, `null`
- `finishedAt` (`replayRun.response.200.finishedAt`; any of, optional)
  - any of the following: `string`, `null`
- `runAt` (`replayRun.response.200.runAt`; any of, optional)
  - any of the following: `string`, `null`
- `nextAttemptAt` (`replayRun.response.200.nextAttemptAt`; any of, optional)
  - any of the following: `string`, `null`
- `waitUntil` (`replayRun.response.200.waitUntil`; string, optional) — Planned resume time for Wait Until or the reply deadline for Wait for Reply.
  - format: `date-time`
- `waitStartedAt` (`replayRun.response.200.waitStartedAt`; string | null, optional) — Time when a wait run entered its pause, or null until it has paused.
  - format: `date-time`
- `waitResumedAt` (`replayRun.response.200.waitResumedAt`; string | null, optional) — Time when a wait run resumed, or null before resumption.
  - format: `date-time`
- `replyTimeoutSeconds` (`replayRun.response.200.replyTimeoutSeconds`; integer, optional) — Timeout applied to this Wait for Reply run.
  - maximum: `2592000` · minimum: `5`
- `waitOutcome` (`replayRun.response.200.waitOutcome`; string | null, optional) — Outcome of a Wait for Reply run. Null until the run resumes.
  - one of `"reply"`, `"timeout"`, `null`
- `reply` (`replayRun.response.200.reply`; object | null, optional) — The accepted reply on a full Wait for Reply run record. Null while there is no accepted reply, including after timeout. Run summaries omit this field.
  - `receivedAt` (`replayRun.response.200.reply.receivedAt`; string, required)
    - format: `date-time`
  - `payload` (`replayRun.response.200.reply.payload`; object, required)
- `durationMs` (`replayRun.response.200.durationMs`; any of, optional)
  - any of the following: `number`, `null`
- `previousRunId` (`replayRun.response.200.previousRunId`; any of, optional)
  - any of the following: `string`, `null`

### 202

Run accepted

#### Example

```json
{
  "id": "string",
  "runId": "string",
  "task": "string",
  "taskName": "string",
  "status": "scheduled",
  "source": "string",
  "attempt": 5,
  "maxAttempts": 3,
  "payload": {},
  "output": null,
  "error": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "startedAt": "2019-08-24T14:15:22Z",
  "finishedAt": "2019-08-24T14:15:22Z",
  "runAt": "2019-08-24T14:15:22Z",
  "nextAttemptAt": "2019-08-24T14:15:22Z",
  "waitUntil": "2019-08-24T14:15:22Z",
  "waitStartedAt": "2019-08-24T14:15:22Z",
  "waitResumedAt": "2019-08-24T14:15:22Z",
  "replyTimeoutSeconds": 5,
  "waitOutcome": "reply",
  "reply": {
    "receivedAt": "2019-08-24T14:15:22Z",
    "payload": {}
  },
  "durationMs": 0,
  "previousRunId": "string"
}
```

- `id` (`replayRun.response.202.id`; string, required)
- `task` (`replayRun.response.202.task`; string, required)
  - maxLength: `64` · pattern: `^[a-z0-9]+(?:-[a-z0-9]+)*$`
- `status` (`replayRun.response.202.status`; string, required)
  - one of `"scheduled"`, `"queued"`, `"waiting"`, `"running"`, `"retrying"`, `"succeeded"`, `"failed"`, `"cancelled"`
- `attempt` (`replayRun.response.202.attempt`; integer, required)
  - maximum: `5` · minimum: `0`
- `maxAttempts` (`replayRun.response.202.maxAttempts`; integer, required)
  - maximum: `5` · minimum: `1` · default: `3`
- `createdAt` (`replayRun.response.202.createdAt`; string, required)
  - format: `date-time`
- `runId` (`replayRun.response.202.runId`; string, optional)
- `taskName` (`replayRun.response.202.taskName`; string, optional)
- `source` (`replayRun.response.202.source`; string, optional)
- `payload` (`replayRun.response.202.payload`; object, optional)
- `output` (`replayRun.response.202.output`; unknown, optional)
- `error` (`replayRun.response.202.error`; any of, optional)
  - any of the following: `string`, `null`
- `startedAt` (`replayRun.response.202.startedAt`; any of, optional)
  - any of the following: `string`, `null`
- `finishedAt` (`replayRun.response.202.finishedAt`; any of, optional)
  - any of the following: `string`, `null`
- `runAt` (`replayRun.response.202.runAt`; any of, optional)
  - any of the following: `string`, `null`
- `nextAttemptAt` (`replayRun.response.202.nextAttemptAt`; any of, optional)
  - any of the following: `string`, `null`
- `waitUntil` (`replayRun.response.202.waitUntil`; string, optional) — Planned resume time for Wait Until or the reply deadline for Wait for Reply.
  - format: `date-time`
- `waitStartedAt` (`replayRun.response.202.waitStartedAt`; string | null, optional) — Time when a wait run entered its pause, or null until it has paused.
  - format: `date-time`
- `waitResumedAt` (`replayRun.response.202.waitResumedAt`; string | null, optional) — Time when a wait run resumed, or null before resumption.
  - format: `date-time`
- `replyTimeoutSeconds` (`replayRun.response.202.replyTimeoutSeconds`; integer, optional) — Timeout applied to this Wait for Reply run.
  - maximum: `2592000` · minimum: `5`
- `waitOutcome` (`replayRun.response.202.waitOutcome`; string | null, optional) — Outcome of a Wait for Reply run. Null until the run resumes.
  - one of `"reply"`, `"timeout"`, `null`
- `reply` (`replayRun.response.202.reply`; object | null, optional) — The accepted reply on a full Wait for Reply run record. Null while there is no accepted reply, including after timeout. Run summaries omit this field.
  - `receivedAt` (`replayRun.response.202.reply.receivedAt`; string, required)
    - format: `date-time`
  - `payload` (`replayRun.response.202.reply.payload`; object, required)
- `durationMs` (`replayRun.response.202.durationMs`; any of, optional)
  - any of the following: `number`, `null`
- `previousRunId` (`replayRun.response.202.previousRunId`; any of, optional)
  - any of the following: `string`, `null`

### 401

Authentication is required

#### Example

```json
{
  "error": "string"
}
```

- `error` (`replayRun.response.401.error`; string, required)

### 403

The credential lacks permission

#### Example

```json
{
  "error": "string"
}
```

- `error` (`replayRun.response.403.error`; string, required)

### 404

Resource not found in this environment

#### Example

```json
{
  "error": "string"
}
```

- `error` (`replayRun.response.404.error`; string, required)

### 409

This operation conflicts with the current state

#### Example

```json
{
  "error": "string"
}
```

- `error` (`replayRun.response.409.error`; string, required)

### 429

Workspace run limit reached

#### Example

```json
{
  "error": "string"
}
```

- `error` (`replayRun.response.429.error`; string, required)


Source: https://simplcron.dev/docs/api/replay-run/index.md
