Skip to main content
POST
Create schedule

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

Schedule a saved crew template to run on a cron.

template_id
string<uuid>
required

ID of a crew template you own or that is shared with you.

cron
string
required

Five-field cron: minute hour day-of-month month day-of-week, e.g. 0 6 * * 1-5 for 06:00 on weekdays.

Maximum string length: 100
timezone
string
default:UTC

IANA time zone the cron is read in, e.g. Europe/London.

Maximum string length: 64
task_input
Task Input · object

Values for the template's variables, fixed for every run. Validated against the template now and again at each run.

name
string
default:""

Label for the schedule. Defaults to the template's name.

Maximum string length: 200
enabled
boolean
default:true

Whether the schedule fires.

run_as_identity_id
string<uuid> | null

Run as this service identity (GET /api/registry/identities) instead of as you. You must be allowed to use it, now and at every run. Omit to run as yourself.

Response

Successful Response

A crew schedule with its last and next run.

id
string
required
template_id
string
required
name
string
required
owner_id
string
required

Username of the user the schedule belongs to.

cron
string
required
timezone
string
required
task_input
Task Input · object
required
enabled
boolean
required
is_owner
boolean
required

Whether the caller owns this schedule.

created_at
string
required
updated_at
string
required
template_name
string | null

Null if the template can no longer be read.

run_as_kind
string
default:owner

owner: runs act as the owner. identity: as a service identity.

run_as
string | null

Username its runs act as: the owner's, or the service identity's service account. Null if that identity no longer exists.

run_as_identity_id
string | null

The service identity it runs as, if any.

next_run_at
string | null

Next slot (ISO 8601, UTC). Null while disabled.

last_run_at
string | null

When a slot last fired or was skipped (UTC).

last_run_id
string | null

Crew-run id of the last run it started.

last_run_status
string | null

Status of that run: pending, running, completed or failed.

last_error
string | null

Why the last slot did not start a run.