RecoupGet a Free AuditFree Audit

API REFERENCE

Get Task Runs

On this page
GET/api/tasks/runs

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).

Authentication

x-api-key in header

bearerAuth bearer

Request

cURL
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

runIdstring

The unique identifier of a specific task run to retrieve. If omitted, returns a list of recent runs for the authenticated account.

limitinteger

Maximum number of runs to return when listing (ignored when runId is provided). Default 20, max 100.

Default: 20

account_idstring

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.

Responses

200Task runs retrieved successfully.

application/json

statusstring · enumrequired

Indicates the request was successful

Values: "success"

runsarray<TaskRunResponse>required

List 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
idstringrequired

The unique run identifier, prefixed with run_

statusstring · enumrequired

Current run status

Values: "PENDING_VERSION", "DELAYED", "QUEUED", "EXECUTING", "REATTEMPTING", "FROZEN", "COMPLETED", "CANCELED", "FAILED", "CRASHED", "INTERRUPTED", "SYSTEM_FAILURE"

taskIdentifierstringrequired

The task type identifier (e.g. 'setup-sandbox', 'run-sandbox-command')

idempotencyKeystringnullable

Idempotency key used to deduplicate trigger requests

versionstring

The worker version that executed the run

isTestboolean

Whether this is a test run

createdAtstringrequired

When the run was created (ISO 8601)

format: date-time

updatedAtstringrequired

When the run was last updated (ISO 8601)

format: date-time

startedAtstringnullable

When execution started (null if not yet started)

format: date-time

finishedAtstringnullable

When the run finished (null if still running)

format: date-time

delayedUntilstringnullable

If delayed, when the run becomes eligible to execute

format: date-time

ttlanynullable

Time-to-live. If the run is not started within this duration, it expires.

expiredAtstringnullable

When the run expired (null if not expired)

format: date-time

tagsarray<string>

Tags associated with this run (max 10)

Item properties for tags

string

metadataobjectnullable

JSON metadata attached to the run

costInCentsnumber

Compute cost of the run in cents

baseCostInCentsnumber

Base invocation cost in cents

durationMsnumber

Compute duration in milliseconds

envobject

Environment the run executed in

Properties for env
idstring
namestring
userstringnullable
depthinteger

Nesting depth for child runs

batchIdstringnullable

Batch ID if triggered as part of a batch

triggerFunctionstring · enum

The function used to trigger this run

Values: "trigger", "triggerAndWait", "batchTrigger", "batchTriggerAndWait"

payloadanynullable

Input payload for the task. Only present when retrieving by runId.

outputone ofnullable

Task 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.

videoSourceUrlstringrequired

URL to the rendered final 9:16 video (image + motion + audio + caption already composed).

format: uri

imageUrlstringrequired

URL to the base image used for video generation.

format: uri

captionTextstringrequired

The caption text burned into the video.

templatestringrequired

Template id used for this run (e.g. album-record-store, artist-caption-bedroom).

lipsyncboolean

Whether lipsync was applied (audio-driven mouth animation).

audioobject

Metadata about the song clip used in the final composition.

Properties for audio
songTitlestring
songFilenamestring
startSecondsnumber

Offset into the source song where the clip starts.

durationSecondsnumber

Length of the audio clip in seconds.

clipLyricsstringnullable

Lyrics for the chosen clip, when available.

clipMoodstringnullable

Inferred mood for the chosen clip, when available.

oneOf · object 2

Generic task output (for tasks not yet schema'd)

object

errorobjectnullable

Error details if the run failed. Only present when retrieving by runId.

Properties for error
messagestring

Human-readable error message

namestring

Error name or type

stackTracestring

Stack trace

attemptsarray<object>

Attempt history. Only present when retrieving by runId.

Item properties for attempts
idstring

Attempt ID, prefixed with attempt_

statusstring · enum

Values: "PENDING", "EXECUTING", "PAUSED", "COMPLETED", "FAILED", "CANCELED"

createdAtstring

format: date-time

updatedAtstring

format: date-time

startedAtstringnullable

format: date-time

completedAtstringnullable

format: date-time

errorobjectnullable
Properties for error
messagestring
namestring
stackTracestring
scheduleobjectnullable

Schedule information if triggered by a schedule. Only present when retrieving by runId.

relatedRunsobjectnullable

Related 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 · enumrequired

Always error for this response shape

Values: "error"

errorstringrequired

Human-readable error message

401Unauthorized - missing or invalid credentials

application/json

statusstring · enumrequired

Always error for this response shape

Values: "error"

errorstringrequired

Human-readable error message

403Forbidden - account_id is not accessible with the provided credentials

application/json

statusstring · enumrequired

Always error for this response shape

Values: "error"

errorstringrequired

Human-readable error message

404Task run not found (only when runId is provided)

application/json

statusstring · enumrequired

Always error for this response shape

Values: "error"

errorstringrequired

Human-readable error message

Unknown run id

notFound
{
  "status": "error",
  "error": "Task run not found"
}

500Internal server error while fetching runs from Trigger.dev.

application/json

statusstring · enumrequired

Always error for this response shape

Values: "error"

errorstringrequired

Human-readable error message

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download releases.json
View operation source
json
{
  "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"
          }
        }
      }
    }
  }
}