Reference
View as MarkdownTasks API
9 operations. Every call needs a session cookie or an Authorization: Bearer nct_… token unless marked Public. Conventions, errors and scopes
/services/{serviceId}/runRun a one-off command
Runs the command (argv, no shell) in a throwaway container of the service's current image with its environment, on the service's server, with the service's resource limits and a timeout (default 30 minutes). Requires deployments:write; audited. Returns 202 with the queued run; follow the output through GET /task-runs/{runId}/logs?follow=true.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
serviceIdrequired | path | string |
Request body · application/json · required
- commandstring[] | nullrequiredArgv, run without a shell. Wrap in ["sh","-c",…] for shell syntax.
- timeoutSecondsinteger (int64)Default 1800 (30 minutes).
Response 202 · Accepted · application/json
- actorLabelstring
- commandstring[] | nullrequired
- createdAtstring (date-time)required
- errorstringWhy the run failed, timed out or was skipped.
- exitCodeinteger (int64)
- finishedAtstring (date-time)
- idstringrequired
- logLinesinteger (int64)required
- namestringrequiredThe task's name, or "one-off" for a command.
- scheduledForstring (date-time)
- serviceIdstringrequired
- sourcestringrequiredcron, manual (Run now), one_off (run command) or a feature such as preview_seed.
- startedAtstring (date-time)
- statusenum: queued | running | succeeded | failed | timed_out | skippedrequired
- taskIdstring
- timeoutSecondsinteger (int64)required
401Unauthorized403Forbidden404Not Found409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/task-runsRun history of a service's tasks and one-off commands
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string | |
taskId | query | string (uuid) | Only the runs of this task. |
limit | query | integer (int64) |
Response 200 · OK · application/json
- RunView[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/tasksList a service's cron tasks
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Response 200 · OK · application/json
- TaskView[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/tasksSchedule a recurring command
A cron task runs its command in a throwaway container of the service's current image, with the service's environment and networks, on the service's server. The schedule is evaluated in timezone (IANA name, default UTC); one run at most per minute. Keeps the last 50 runs.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
serviceIdrequired | path | string |
Request body · application/json · required
- commandstring[] | nullrequiredArgv, run without a shell in a container of the service's current image. Wrap in ["sh","-c",…] for shell syntax.
- concurrencyenum: forbid | allowforbid (default) skips a tick while the previous run is still active.
- enabledbooleanDefault true.
- namestringrequired
- schedulestringrequired5-field cron expression (minute hour day-of-month month day-of-week) or @hourly/@daily/@weekly/@monthly/@yearly, evaluated in timezone.
- timeoutSecondsinteger (int64)Default 1800 (30 minutes).
- timezonestringIANA time zone the schedule is evaluated in, e.g. Europe/Berlin. Default UTC.
Response 201 · Created · application/json
- commandstring[] | nullrequiredArgv, run without a shell.
- concurrencyenum: forbid | allowrequired
- createdAtstring (date-time)required
- enabledbooleanrequired
- idstringrequired
- RunView
- lastRunAtstring (date-time)
- namestringrequired
- nextRunAtstring (date-time)
- schedulestringrequired5-field cron expression or @macro, evaluated in timezone.
- serviceIdstringrequired
- timeoutSecondsinteger (int64)required
- timezonestringrequiredIANA time zone the schedule is evaluated in (default UTC). A daylight-saving gap skips that day's run; a repeated hour runs once.
- updatedAtstring (date-time)required
401Unauthorized403Forbidden404Not Found409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/task-runs/{runId}Get a task run
| Parameter | In | Type | Description |
|---|---|---|---|
runIdrequired | path | string |
Response 200 · OK · application/json
- actorLabelstring
- commandstring[] | nullrequired
- createdAtstring (date-time)required
- errorstringWhy the run failed, timed out or was skipped.
- exitCodeinteger (int64)
- finishedAtstring (date-time)
- idstringrequired
- logLinesinteger (int64)required
- namestringrequiredThe task's name, or "one-off" for a command.
- scheduledForstring (date-time)
- serviceIdstringrequired
- sourcestringrequiredcron, manual (Run now), one_off (run command) or a feature such as preview_seed.
- startedAtstring (date-time)
- statusenum: queued | running | succeeded | failed | timed_out | skippedrequired
- taskIdstring
- timeoutSecondsinteger (int64)required
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/task-schedules/previewDescribe a cron expression
Validates the expression and returns a plain-English summary (naming the time zone) and the next runs as UTC instants, computed in timezone (default UTC). An invalid expression or zone answers 200 with valid: false and the reason in error.
Request body · application/json · required
- countinteger (int64)How many upcoming runs to return (default 5).
- schedulestringrequired
- timezonestringIANA zone the schedule is evaluated in (default UTC).
Response 200 · OK · application/json
- descriptionstringHuman-readable summary naming the time zone.
- errorstring
- nextRunsstring (date-time)[] | nullrequiredThe next runs as UTC instants.
- timezonestringThe normalized zone the preview was computed in.
- validbooleanrequired
401Unauthorized403Forbidden422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/tasks/{taskId}Update a cron task
| Parameter | In | Type | Description |
|---|---|---|---|
taskIdrequired | path | string |
Request body · application/json · required
- commandstring[]
- concurrencyenum: forbid | allow
- enabledboolean
- namestring
- schedulestring
- timeoutSecondsinteger (int64)
- timezonestringIANA zone; changing it recomputes the next run.
Response 200 · OK · application/json
- commandstring[] | nullrequiredArgv, run without a shell.
- concurrencyenum: forbid | allowrequired
- createdAtstring (date-time)required
- enabledbooleanrequired
- idstringrequired
- RunView
- lastRunAtstring (date-time)
- namestringrequired
- nextRunAtstring (date-time)
- schedulestringrequired5-field cron expression or @macro, evaluated in timezone.
- serviceIdstringrequired
- timeoutSecondsinteger (int64)required
- timezonestringrequiredIANA time zone the schedule is evaluated in (default UTC). A daylight-saving gap skips that day's run; a repeated hour runs once.
- updatedAtstring (date-time)required
401Unauthorized403Forbidden404Not Found409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/tasks/{taskId}Delete a cron task and its run history
| Parameter | In | Type | Description |
|---|---|---|---|
taskIdrequired | path | string |
Response 204 · No Content
No body.
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/tasks/{taskId}/runRun a cron task now
Starts a run immediately, whatever the schedule and concurrency policy. Returns 202 with the queued run; follow it through GET /task-runs/{runId}/logs?follow=true. 409 not_deployed / server_offline when it can not start.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
taskIdrequired | path | string |
Response 202 · Accepted · application/json
- actorLabelstring
- commandstring[] | nullrequired
- createdAtstring (date-time)required
- errorstringWhy the run failed, timed out or was skipped.
- exitCodeinteger (int64)
- finishedAtstring (date-time)
- idstringrequired
- logLinesinteger (int64)required
- namestringrequiredThe task's name, or "one-off" for a command.
- scheduledForstring (date-time)
- serviceIdstringrequired
- sourcestringrequiredcron, manual (Run now), one_off (run command) or a feature such as preview_seed.
- startedAtstring (date-time)
- statusenum: queued | running | succeeded | failed | timed_out | skippedrequired
- taskIdstring
- timeoutSecondsinteger (int64)required
401Unauthorized403Forbidden404Not Found409Conflictnot_deployed422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.