API REFERENCE
Get tasks
On this page
/api/tasksRetrieve scheduled tasks. Each task includes recent_runs (last 5 runs), upcoming (next scheduled run times) sourced directly from the Trigger.dev API, and owner_email when an account email exists for the task owner. Supports filtering by id, account_id, or artist_account_id.
Fetching one task by id performs the owner-plan preflight used by the runner and can return 402 plan_limit. Listing tasks remains distinct from permission to execute them.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request GET \
--url 'https://api.recoupable.dev/api/tasks' \
--header 'x-api-key: YOUR_API_KEY'Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.
Try it
Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.
Kept in this browser tab only and cleared when it closes.
curl --request GET \
--url 'https://api.recoupable.dev/api/tasks'Parameters
Query parameters
idstringFilter by task ID (UUID). Returns a single task matching the provided ID. Admin callers may retrieve any task by ID regardless of owner; non-admin callers only receive the task if it belongs to their authenticated account.
account_idstringFilter tasks to only include those for the specified account.
artist_account_idstringFilter tasks to only include those for the specified artist account.
Responses
200Tasks retrieved successfully+
application/json
statusstring · enumrequiredStatus of the request
Values: "success", "error"
tasksarray<Task>requiredArray of task objects
Item properties for tasks
idstringUnique identifier for the task
format: uuid
titlestringDescriptive title or name of the task
promptstringDetailed instruction or prompt for task execution
schedulestringCron expression defining when the task should execute (e.g., '0 10 * * *')
timezonestringnullableIANA time zone the task's cron is interpreted in, read from the Trigger.dev schedule (the source of truth). Null when the task has no schedule or the timezone can't be read.
Example: "America/New_York"
account_idstringUnique identifier for the associated account
format: uuid
artist_account_idstringUnique identifier for the associated artist account
format: uuid
enabledbooleannullableWhether the task is enabled. Defaults to true.
trigger_schedule_idstringnullableIdentifier for the trigger schedule associated with this task
recent_runsarray<TaskRunResponse>Last 5 runs for this task, sourced from the Trigger.dev API.
Item properties for recent_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).
Example: "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.
upcomingarray<string>Next scheduled run times.
Item properties for upcoming
string
owner_emailstringnullablePrimary email address for the task owner account when one exists.
artist_namestringnullableDisplay name of the artist account the task runs for (artist_account_id), so a task list can label rows without a roster lookup. Null when the artist account no longer exists.
Example: "Braden Bales"
modelstringnullableAI model identifier used when the task runs. When present as a string, must be non-empty; otherwise null if unset.
minLength: 1
errorstringError message (only present if status is error)
400Bad request+
application/json
errorintegerrequiredformat: int32
messagestringrequired401Unauthorized — send exactly one of x-api-key or Authorization: Bearer …. Missing or conflicting headers return a text error; malformed or rejected credentials return a text message. Both envelopes include status: error; read whichever text field is present.+
application/json
anyOf · object 1
statusstring · enumrequiredAlways error.
Values: "error"
errorstringrequiredHuman-readable error message or documented error code.
Additional properties
any
anyOf · object 2
statusstring · enumrequiredAlways error.
Values: "error"
messagestringrequiredHuman-readable authentication error message.
Additional properties
any
Missing credentials or both credential headers supplied
{
"status": "error",
"error": "Exactly one of x-api-key or Authorization must be provided"
}Rejected API key, whether sent in x-api-key or as a Bearer key
{
"status": "error",
"message": "Unauthorized"
}402A single task fetched by id is blocked by its owner plan. Returns plan_limit with task_count or min_cadence and billingUrl. Ordinary listing does not apply this pre-run gate.+
application/json
statusstring · enumrequiredAlways error for this response shape
Values: "error"
errorstring · enumrequiredMachine-readable code. Literally plan_limit.
Values: "plan_limit"
limitstring · enumrequiredWhich entitlement blocked the request: task_count (the plan's enabled-task cap is reached) or min_cadence (the cron fires more often than the plan allows).
Values: "task_count", "min_cadence"
messagestringrequiredHuman-readable explanation naming the plan and the limit, suitable to show to a user.
Example: "Free includes 1 task. Starter includes 3, Pro is unlimited."
planstring · enumrequiredThe account's current plan, resolved from its subscription.
Values: "free", "starter", "pro"
task_limitintegerrequirednullableMaximum enabled tasks on the current plan. Null means uncapped.
Example: 1
minimum: 1
min_cadence_minutesintegerrequiredShortest allowed gap between two consecutive runs of a task on the current plan, in minutes (Free 10080, Starter 1440, Pro 60).
Example: 10080
minimum: 1
current_task_countintegerrequiredEnabled tasks the account has right now, excluding the one being created or updated.
Example: 1
minimum: 0
billingUrlstringrequiredStatic link to /plan in the Recoup app, where a human can upgrade. Constant; retrying creates nothing.
Example: "https://app.recoupable.dev/plan"
format: uri
403Forbidden — the requested account_id is outside the authenticated account's authorized access. Read the text error.+
application/json
statusstring · enumrequiredAlways error.
Values: "error"
errorstringrequiredHuman-readable error message or documented error code.
Additional properties
any
{
"status": "error",
"error": "Access denied to specified account_id"
}500Internal server error while retrieving tasks. Read the text error; the message can vary. The examples illustrate the response shape.+
application/json
statusstring · enumrequiredAlways error.
Values: "error"
errorstringrequiredHuman-readable error message or documented error code.
Additional properties
any
{
"status": "error",
"error": "Task service unavailable"
}{
"status": "error",
"error": "Internal server error"
}Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download releases.jsonView operation source
{
"operationId": "getTasks",
"description": "Retrieve scheduled tasks. Each task includes `recent_runs` (last 5 runs), `upcoming` (next scheduled run times) sourced directly from the Trigger.dev API, and `owner_email` when an account email exists for the task owner. Supports filtering by id, account_id, or artist_account_id.\n\nFetching one task by id performs the owner-plan preflight used by the runner and can return 402 plan_limit. Listing tasks remains distinct from permission to execute them.",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "query",
"description": "Filter by task ID (UUID). Returns a single task matching the provided ID. Admin callers may retrieve any task by ID regardless of owner; non-admin callers only receive the task if it belongs to their authenticated account.",
"required": false,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "account_id",
"in": "query",
"description": "Filter tasks to only include those for the specified account.",
"required": false,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "artist_account_id",
"in": "query",
"description": "Filter tasks to only include those for the specified artist account.",
"required": false,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Tasks retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TasksResponse"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized — send exactly one of `x-api-key` or `Authorization: Bearer …`. Missing or conflicting headers return a text `error`; malformed or rejected credentials return a text `message`. Both envelopes include `status: error`; read whichever text field is present.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskAuthenticationErrorResponse"
},
"examples": {
"missingOrConflictingCredentials": {
"summary": "Missing credentials or both credential headers supplied",
"value": {
"status": "error",
"error": "Exactly one of x-api-key or Authorization must be provided"
}
},
"invalidCredential": {
"summary": "Rejected API key, whether sent in x-api-key or as a Bearer key",
"value": {
"status": "error",
"message": "Unauthorized"
}
}
}
}
}
},
"402": {
"description": "A single task fetched by id is blocked by its owner plan. Returns plan_limit with task_count or min_cadence and billingUrl. Ordinary listing does not apply this pre-run gate.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlanLimitError"
}
}
}
},
"403": {
"description": "Forbidden — the requested `account_id` is outside the authenticated account's authorized access. Read the text `error`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskFailureErrorResponse"
},
"examples": {
"accountOverrideDenied": {
"value": {
"status": "error",
"error": "Access denied to specified account_id"
}
}
}
}
}
},
"500": {
"description": "Internal server error while retrieving tasks. Read the text `error`; the message can vary. The examples illustrate the response shape.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskFailureErrorResponse"
},
"examples": {
"serviceError": {
"value": {
"status": "error",
"error": "Task service unavailable"
}
},
"unexpectedFailure": {
"value": {
"status": "error",
"error": "Internal server error"
}
}
}
}
}
}
}
}