Skip to main content

Overview

Creates a new IMPERATIVE 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

string
required
The identifier of an existing scheduled task to trigger. The task must be defined with schedules.task().
string
required
A standard 5-field CRON expression defining when the task should run. For example, "0 9 * * 1-5" runs every weekday at 9am.
string
required
A unique key to prevent accidentally creating duplicate schedules. If a schedule with this key already exists, the existing schedule is returned.
string
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.
string
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:
string
Schedule ID, prefixed with sched_.
string
Task identifier this schedule triggers.
string
Always IMPERATIVE for schedules created via this endpoint.
boolean
Whether the schedule is currently active. true by default.
string
The deduplication key provided on creation.
string
The external ID provided on creation, if any.
object
CRON generator details.
string
IANA timezone.
string
ISO 8601 timestamp of the next scheduled execution.
object[]
Environments this schedule is active in.

Examples

Response example