Skip to main content
POST
TypeScript

Authorizations

Authorization
string
header
required

Use a named environment API key. It starts with tr_dev_sk_, tr_prod_sk_, tr_stg_sk_, etc.

Create a named API key in the API Keys section of your Trigger.dev project dashboard. Choose the narrowest access preset that supports your integration.

Our TypeScript SDK will default to using the value of the TRIGGER_SECRET_KEY environment variable if it is set. If you are using the SDK in a different environment, you can set the key using the configure function.

Path Parameters

runId
string
required

The ID of an run, starts with run_. The run ID will be returned when you trigger a run on a task.

Body

application/json
payload
any

The payload for the new run. Omit it to reuse the original run's payload.

payloadType
enum<string>

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.

Available options:
application/json,
application/super+json
metadata
object

Metadata for the new run. Omit it to reuse the original run's metadata.

tags

Tags for the new run. Replaces the original run's tags.

Maximum string length: 128
Example:

"user_123456"

queue
string

The name of an existing queue in the environment to run on.

concurrencyKey
string

The concurrency key for the new run.

machine
enum<string>

The machine preset for the new run.

Available options:
micro,
small-1x,
small-2x,
medium-1x,
medium-2x,
large-1x,
large-2x
Example:

"small-2x"

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

How long the new run can stay queued before it expires, as a duration string (10m) or a number of seconds.

idempotencyKey
string

An idempotency key for the new run. A repeated request with the same key returns the same run.

Maximum string length: 2048
idempotencyKeyTTL
string

How long the idempotency key is valid, as a duration (1h).

maxAttempts
integer

The maximum number of attempts for the new run.

Required range: x >= 1
maxDuration
number

The maximum duration of the new run in seconds.

priority
number

Priority offset in seconds. Higher values are dequeued sooner.

Response

Successful request

id
string

The ID of the new run.