---
title: "Replay a run"
method: POST
path: "/api/v1/runs/{runId}/replay"
tags: ["runs"]
---

# Replay a run

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

## Request

- Base URL: `https://api.trigger.dev`
- URL: `https://api.trigger.dev/api/v1/runs/{runId}/replay`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/triggerdotdev/apis/trigger-dev-v3-rest-api/docs/api/v1/runs/:runId/replay/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new run with the same payload and options as the original run, in the same environment. Send a body to override the payload, metadata, or trigger options for the new run. The body is optional; an empty body replays the run unchanged.

## Request body

- object
  - `payload` unknown
  - `payloadType` 'application/json' | 'application/super+json': How `payload` is encoded. Defaults to `application/json`. With `application/super+json`, `payload` must be a SuperJSON string, which keeps types like `Date` and `BigInt`. The SDK sends this automatically.
  - `metadata` object: Metadata for the new run. Omit it to reuse the original run's metadata.
  - `tags` union: One or more tags to attach to a run. Runs can have a maximum of 10 tags.
    - string: A single run tag. Must be less than 128 characters.
    - RunTag[]
  - `queue` string: The name of an existing queue in the environment to run on.
  - `concurrencyKey` string: The concurrency key for the new run.
  - `machine` 'micro' | 'small-1x' | 'small-2x' | 'medium-1x' | 'medium-2x' | 'large-1x' | 'large-2x': The machine preset for the new run.
  - `version` string: Lock the new run to this deployed version, for example `20250101.1`. Defaults to the current version.
  - `region` string: The region to run in. Defaults to the original run's region.
  - `delay` string: Delay the new run, as a duration (`1h30m`) or an ISO 8601 date.
  - `ttl` union: How long the new run can stay queued before it expires, as a duration string (`10m`) or a number of seconds.
    - string
    - integer
  - `idempotencyKey` string: An idempotency key for the new run. A repeated request with the same key returns the same run.
  - `idempotencyKeyTTL` string: How long the idempotency key is valid, as a duration (`1h`).
  - `maxAttempts` integer: The maximum number of attempts for the new run.
  - `maxDuration` number: The maximum duration of the new run in seconds.
  - `priority` number: Priority offset in seconds. Higher values are dequeued sooner.

## Response `200`

Successful request

- object
  - `id` string: The ID of the new run.

## Other responses

- `400`: Invalid request, for example an unknown body field, an unknown queue, or a version that is not deployed to the environment.
- `401`: Unauthorized request
- `403`: The credentials can't trigger the run's task. A replay starts a new run, so it needs permission to trigger the task as well as write access to the run.
- `404`: Resource not found
- `413`: The request body is larger than the maximum payload size.

## Changes

- **2026-10-13** `a0892bbd2253`: 5 info
  - added optional request body
  - added the non-success response with the status `403`
  - added the non-success response with the status `413`
  - removed the `Failed to create new run` enum value from the `error` response property for the response status `400`
  - …1 more

[Operation history](https://skmtc.dev/triggerdotdev/apis/trigger-dev-v3-rest-api/changes/api/v1/runs/:runId/replay/post.md)

---

[API](https://skmtc.dev/triggerdotdev/apis/trigger-dev-v3-rest-api.md) - [All operations](https://skmtc.dev/triggerdotdev/apis/trigger-dev-v3-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/triggerdotdev/apis/trigger-dev-v3-rest-api/revisions/441161111493?raw)
