Overview
Creates a newIMPERATIVE schedule that triggers the specified task according to a CRON expression. Imperative schedules are created programmatically (as opposed to DECLARATIVE schedules, which are declared in code using schedules.task({ cron: ... })).
Authentication with a secret key is required.
Endpoint
Request body
The identifier of an existing scheduled task to trigger. The task must be defined with
schedules.task().A standard 5-field CRON expression defining when the task should run. For example,
"0 9 * * 1-5" runs every weekday at 9am.A unique key to prevent accidentally creating duplicate schedules. If a schedule with this key already exists, the existing schedule is returned.
An IANA timezone name (e.g.
"America/New_York"). Defaults to "UTC". When set, the CRON expression is evaluated in that timezone and respects daylight saving time.An arbitrary string you can use to associate the schedule with a record in your own system — for example a user ID or organization ID.
Response
Returns a Schedule object:Schedule ID, prefixed with
sched_.Task identifier this schedule triggers.
Always
IMPERATIVE for schedules created via this endpoint.Whether the schedule is currently active.
true by default.The deduplication key provided on creation.
The external ID provided on creation, if any.
CRON generator details.
IANA timezone.
ISO 8601 timestamp of the next scheduled execution.
Environments this schedule is active in.