API REFERENCE
Update Task
On this page
/api/tasksUpdate an existing scheduled task. Only the id field is required; any additional fields you include will be updated on the task. The response shape matches the GET endpoint (an array containing the updated task).
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request PATCH \
--url 'https://api.recoupable.dev/api/tasks' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a",
"title": "Weekly Genre Pulse Check (rev)",
"schedule": "0 10 * * 4"
}'Request body required
JSON object with id and optional fields to merge onto the task.
application/json
idstringrequiredUUID of the task to update
format: uuid
titlestringNew descriptive title. If sent, must be a non-empty string.
minLength: 1
promptstringNew instruction/prompt executed by the task. If sent, must be a non-empty string.
minLength: 1
schedulestringNew cron expression. If sent, must be non-empty and valid for your environment.
minLength: 1
timezonestringOptional IANA time zone the cron is interpreted in (DST-aware). If sent, updates the Trigger.dev schedule; a timezone-only change re-syncs the schedule. A cron-only update preserves the existing time zone.
account_idstringUUID of the account to update the task for. Only applicable when the authenticated account has access to multiple accounts via organization membership. If not provided, the task is updated for the API key's own account.
format: uuid
artist_account_idstringUUID of the artist account to associate with the task after update
format: uuid
enabledbooleannullableWhether the task is enabled (true / false), or null to clear an explicit override depending on server rules.
modelstringAI model identifier to use when the task runs. If sent, must be a non-empty string.
minLength: 1
Change title and cron
{
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a",
"title": "Weekly Genre Pulse Check (rev)",
"schedule": "0 10 * * 4"
}Pause or resume a task
{
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a",
"enabled": false
}Switch model only
{
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a",
"model": "claude-sonnet-4-20250514"
}Responses
200Task updated successfully. Body is a TasksResponse with the updated task in tasks (typically one task).+
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.
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).
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.
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.
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 — missing id, empty strings where a field is provided, or other validation failure from the request body. The body reports the first Zod issue via missing_fields and error.+
application/json
statusstring · enumrequiredAlways error when validation fails
Values: "error"
missing_fieldsarray<one of>requiredJSON path segments to the first field that failed validation (from Zod), e.g. ["id"] or ["schedule"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredValidation message for the first failing field
401Unauthorized - missing or invalid credentials+
application/json
errorintegerrequiredformat: int32
messagestringrequired402Payment required - the account's plan does not allow this task. limit is task_count when the account already has task_limit enabled tasks, or min_cadence when the cron schedule fires more often than min_cadence_minutes allows. Nothing is written; upgrade at billingUrl.+
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.
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.
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).
minimum: 1
current_task_countintegerrequiredEnabled tasks the account has right now, excluding the one being created or updated.
minimum: 0
billingUrlstringrequiredStatic link to /plan in the Recoup app, where a human can upgrade. Constant; retrying creates nothing.
format: uri
Free account re-enabling a disabled task while another is enabled
{
"status": "error",
"error": "plan_limit",
"limit": "task_count",
"message": "Free includes 1 task. Starter includes 3, Pro is unlimited.",
"plan": "free",
"task_limit": 1,
"min_cadence_minutes": 10080,
"current_task_count": 1,
"billingUrl": "https://app.recoupable.dev/plan"
}Free account changing a task to a daily schedule
{
"status": "error",
"error": "plan_limit",
"limit": "min_cadence",
"message": "Free runs tasks weekly at most. Starter runs daily, Pro runs hourly.",
"plan": "free",
"task_limit": 1,
"min_cadence_minutes": 10080,
"current_task_count": 0,
"billingUrl": "https://app.recoupable.dev/plan"
}403Forbidden - account_id is outside caller authorization scope+
application/json
errorintegerrequiredformat: int32
messagestringrequired404No task exists with the given id.+
application/json
statusstring · enumrequiredAlways error for this response shape
Values: "error"
errorstringrequiredHuman-readable error message (for example Task not found on 404)
Unknown task id
{
"status": "error",
"error": "Task not found"
}500Internal server error while updating the task or syncing the Trigger.dev schedule.+
application/json
statusstring · enumrequiredAlways error for this response shape
Values: "error"
errorstringrequiredHuman-readable error message (for example Task not found on 404)
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download releases.jsonView operation source
{
"summary": "Update scheduled task",
"description": "Update an existing scheduled task. Only the id field is required; any additional fields you include will be updated on the task. The response shape matches the GET endpoint (an array containing the updated task).",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"requestBody": {
"description": "JSON object with `id` and optional fields to merge onto the task.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateTaskRequest"
},
"examples": {
"updateTitleAndSchedule": {
"summary": "Change title and cron",
"value": {
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a",
"title": "Weekly Genre Pulse Check (rev)",
"schedule": "0 10 * * 4"
}
},
"toggleEnabled": {
"summary": "Pause or resume a task",
"value": {
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a",
"enabled": false
}
},
"changeModel": {
"summary": "Switch model only",
"value": {
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a",
"model": "claude-sonnet-4-20250514"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Task updated successfully. Body is a `TasksResponse` with the updated task in `tasks` (typically one task).",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TasksResponse"
}
}
}
},
"400": {
"description": "Bad request — missing `id`, empty strings where a field is provided, or other validation failure from the request body. The body reports the first Zod issue via `missing_fields` and `error`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateTaskValidationErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized - missing or invalid credentials",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"402": {
"description": "Payment required - the account's plan does not allow this task. `limit` is `task_count` when the account already has `task_limit` enabled tasks, or `min_cadence` when the cron schedule fires more often than `min_cadence_minutes` allows. Nothing is written; upgrade at `billingUrl`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlanLimitError"
},
"examples": {
"taskCount": {
"summary": "Free account re-enabling a disabled task while another is enabled",
"value": {
"status": "error",
"error": "plan_limit",
"limit": "task_count",
"message": "Free includes 1 task. Starter includes 3, Pro is unlimited.",
"plan": "free",
"task_limit": 1,
"min_cadence_minutes": 10080,
"current_task_count": 1,
"billingUrl": "https://app.recoupable.dev/plan"
}
},
"minCadence": {
"summary": "Free account changing a task to a daily schedule",
"value": {
"status": "error",
"error": "plan_limit",
"limit": "min_cadence",
"message": "Free runs tasks weekly at most. Starter runs daily, Pro runs hourly.",
"plan": "free",
"task_limit": 1,
"min_cadence_minutes": 10080,
"current_task_count": 0,
"billingUrl": "https://app.recoupable.dev/plan"
}
}
}
}
}
},
"403": {
"description": "Forbidden - account_id is outside caller authorization scope",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "No task exists with the given `id`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateTaskFailureResponse"
},
"examples": {
"notFound": {
"summary": "Unknown task id",
"value": {
"status": "error",
"error": "Task not found"
}
}
}
}
}
},
"500": {
"description": "Internal server error while updating the task or syncing the Trigger.dev schedule.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateTaskFailureResponse"
}
}
}
}
}
}