API REFERENCE
Get Task Runs
On this page
/api/tasks/runsReturns task runs for the authenticated account. When runId is provided, the response contains that single run (runs length 1) or 404 if not found. When runId is omitted, returns recent runs filtered by account context (default authenticated account, or account_id override when authorized).
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request GET \
--url 'https://api.recoupable.dev/api/tasks/runs' \
--header 'x-api-key: YOUR_API_KEY'Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.
Parameters
Query parameters
runIdstringThe unique identifier of a specific task run to retrieve. If omitted, returns a list of recent runs for the authenticated account.
limitintegerMaximum number of runs to return when listing (ignored when runId is provided). Default 20, max 100.
Default: 20
account_idstringFilter runs by account ID. When provided, returns runs tagged with account:<account_id>. Only applicable when the authenticated account has access to multiple accounts via organization membership.
Responses
200Task runs retrieved successfully.+
application/json
statusstring · enumrequiredIndicates the request was successful
Values: "success"
runsarray<TaskRunResponse>requiredList of recent task runs for the authenticated account. Each item is a raw Trigger.dev SDK run object (same shape as TaskRunResponse, but without output and error fields).
Item properties for runs
idstringrequiredThe unique run identifier, prefixed with run_
statusstring · enumrequiredCurrent run status
Values: "PENDING_VERSION", "DELAYED", "QUEUED", "EXECUTING", "REATTEMPTING", "FROZEN", "COMPLETED", "CANCELED", "FAILED", "CRASHED", "INTERRUPTED", "SYSTEM_FAILURE"
taskIdentifierstringrequiredThe task type identifier (e.g. 'setup-sandbox', 'run-sandbox-command')
idempotencyKeystringnullableIdempotency key used to deduplicate trigger requests
versionstringThe worker version that executed the run
isTestbooleanWhether this is a test run
createdAtstringrequiredWhen the run was created (ISO 8601)
format: date-time
updatedAtstringrequiredWhen the run was last updated (ISO 8601)
format: date-time
startedAtstringnullableWhen execution started (null if not yet started)
format: date-time
finishedAtstringnullableWhen the run finished (null if still running)
format: date-time
delayedUntilstringnullableIf delayed, when the run becomes eligible to execute
format: date-time
ttlanynullableTime-to-live. If the run is not started within this duration, it expires.
expiredAtstringnullableWhen the run expired (null if not expired)
format: date-time
tagsarray<string>Tags associated with this run (max 10)
Item properties for tags
string
metadataobjectnullableJSON metadata attached to the run
costInCentsnumberCompute cost of the run in cents
baseCostInCentsnumberBase invocation cost in cents
durationMsnumberCompute duration in milliseconds
envobjectEnvironment the run executed in
Properties for env
idstringnamestringuserstringnullabledepthintegerNesting depth for child runs
batchIdstringnullableBatch ID if triggered as part of a batch
triggerFunctionstring · enumThe function used to trigger this run
Values: "trigger", "triggerAndWait", "batchTrigger", "batchTriggerAndWait"
payloadanynullableInput payload for the task. Only present when retrieving by runId.
outputone ofnullableTask output data. Only present when retrieving by runId, and only populated when status is COMPLETED. Shape varies by taskIdentifier. The create-content task returns the schema below; other tasks return their own.
Properties for output
oneOf · CreateContentRunOutput 1
Output payload for a create-content task run. Returned in output when status is COMPLETED. Agents should poll /api/tasks/runs?runId=… and read these fields once the run is done.
videoSourceUrlstringrequiredURL to the rendered final 9:16 video (image + motion + audio + caption already composed).
format: uri
imageUrlstringrequiredURL to the base image used for video generation.
format: uri
captionTextstringrequiredThe caption text burned into the video.
templatestringrequiredTemplate id used for this run (e.g. album-record-store, artist-caption-bedroom).
lipsyncbooleanWhether lipsync was applied (audio-driven mouth animation).
audioobjectMetadata about the song clip used in the final composition.
Properties for audio
songTitlestringsongFilenamestringstartSecondsnumberOffset into the source song where the clip starts.
durationSecondsnumberLength of the audio clip in seconds.
clipLyricsstringnullableLyrics for the chosen clip, when available.
clipMoodstringnullableInferred mood for the chosen clip, when available.
oneOf · object 2
Generic task output (for tasks not yet schema'd)
object
errorobjectnullableError details if the run failed. Only present when retrieving by runId.
Properties for error
messagestringHuman-readable error message
namestringError name or type
stackTracestringStack trace
attemptsarray<object>Attempt history. Only present when retrieving by runId.
Item properties for attempts
idstringAttempt ID, prefixed with attempt_
statusstring · enumValues: "PENDING", "EXECUTING", "PAUSED", "COMPLETED", "FAILED", "CANCELED"
createdAtstringformat: date-time
updatedAtstringformat: date-time
startedAtstringnullableformat: date-time
completedAtstringnullableformat: date-time
errorobjectnullableProperties for error
messagestringnamestringstackTracestringscheduleobjectnullableSchedule information if triggered by a schedule. Only present when retrieving by runId.
relatedRunsobjectnullableRelated run references (root, parent, children). Only present when retrieving by runId.
400Bad request - invalid query parameters (for example non-numeric limit, out-of-range limit, or invalid empty values).+
application/json
statusstring · enumrequiredAlways error for this response shape
Values: "error"
errorstringrequiredHuman-readable error message
401Unauthorized - missing or invalid credentials+
application/json
statusstring · enumrequiredAlways error for this response shape
Values: "error"
errorstringrequiredHuman-readable error message
403Forbidden - account_id is not accessible with the provided credentials+
application/json
statusstring · enumrequiredAlways error for this response shape
Values: "error"
errorstringrequiredHuman-readable error message
404Task run not found (only when runId is provided)+
application/json
statusstring · enumrequiredAlways error for this response shape
Values: "error"
errorstringrequiredHuman-readable error message
Unknown run id
{
"status": "error",
"error": "Task run not found"
}500Internal server error while fetching runs from Trigger.dev.+
application/json
statusstring · enumrequiredAlways error for this response shape
Values: "error"
errorstringrequiredHuman-readable error message
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download releases.jsonView operation source
{
"summary": "Get task runs",
"description": "Returns task runs for the authenticated account. When `runId` is provided, the response contains that single run (`runs` length 1) or 404 if not found. When `runId` is omitted, returns recent runs filtered by account context (default authenticated account, or `account_id` override when authorized).",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "runId",
"in": "query",
"description": "The unique identifier of a specific task run to retrieve. If omitted, returns a list of recent runs for the authenticated account.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "limit",
"in": "query",
"description": "Maximum number of runs to return when listing (ignored when runId is provided). Default 20, max 100.",
"required": false,
"schema": {
"type": "integer",
"default": 20,
"minimum": 1,
"maximum": 100
}
},
{
"name": "account_id",
"in": "query",
"description": "Filter runs by account ID. When provided, returns runs tagged with account:<account_id>. Only applicable when the authenticated account has access to multiple accounts via organization membership.",
"required": false,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Task runs retrieved successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskRunListResponse"
}
}
}
},
"400": {
"description": "Bad request - invalid query parameters (for example non-numeric `limit`, out-of-range `limit`, or invalid empty values).",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskRunsErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized - missing or invalid credentials",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskRunsErrorResponse"
}
}
}
},
"403": {
"description": "Forbidden - account_id is not accessible with the provided credentials",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskRunsErrorResponse"
}
}
}
},
"404": {
"description": "Task run not found (only when runId is provided)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskRunsErrorResponse"
},
"examples": {
"notFound": {
"summary": "Unknown run id",
"value": {
"status": "error",
"error": "Task run not found"
}
}
}
}
}
},
"500": {
"description": "Internal server error while fetching runs from Trigger.dev.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskRunsErrorResponse"
}
}
}
}
}
}