Skip to main content
GET
Get a scheduled task
A task is visible to its creator, to admins, to roles granting ScheduledTasksRead or ScheduledTasksManage on the deployment, and to whoever it is shared with; anyone else gets 404.

Authorizations

Authorization
string
header
required

Token authentication. Send Authorization: Bearer <YOUR_TOKEN>.

Path Parameters

deploymentId
integer
required
taskId
integer
required

Response

200 - application/json
deploymentId
integer
required
id
integer
required
isEnabled
boolean
required

False while the schedule is paused.

name
string
required
notification
object
required

Who a finished run notifies, and how.

notificationEnabled
boolean
required
deprecated

Deprecated: read notification instead. Whether a finished run notifies the creator in Cube's notification inbox.

prompt
string
required

What the agent is asked on every run, shown as the task's Instructions in Cube. Each run starts a new chat thread, so the prompt has to stand on its own.

timezone
string
required

IANA time zone the cron is read in, e.g. America/New_York. Defaults to UTC.

userId
integer
required

The creator. Every run executes as this user, and only they or an admin may change, delete or run the task.

agentId
integer | null

The agent that runs the task; null runs the deployment default.

condition
object | null

Notify only when: on each fire the measure is read once, before the agent runs, and the agent runs only when the condition starts to hold, with the crossing facts at the top of its thread; it runs again only after the condition has stopped holding. A change or anomaly rule needs timeDimension and granularity. A request that sends notification must leave a task with a condition notifying someone (400 otherwise); one that does not, on the deprecated notificationEnabled shape, keeps its earlier behaviour. Null runs the agent on every fire.

cronExpression
string | null

Standard 5-field cron (minute hour day-of-month month day-of-week), e.g. 0 9 * * 1-5 for 9:00 on weekdays. Null when the task is Manual: it runs only when started with POST /scheduled-tasks/{taskId}/run.

description
string | null
lastConditionCheck
object | null

The latest condition check; null before the first one.

nextRunAt
string | null

When the schedule next fires (ISO 8601, UTC); null for a Manual or paused task.