Skip to main content
POST
Create a cron trigger

Authorizations

hookie_session
string
cookie
required

The console's sealed session cookie, set by WorkOS AuthKit. Mutating requests also require the X-Requested-With CSRF header.

Headers

Idempotency-Key
string

Makes a POST safe to retry for 24 hours: the same key, credential, path and body returns the stored response (Idempotent-Replayed: true) instead of running again. 422 if the key was used for a different request; 409 while the first is in flight.

Required string length: 1 - 255

Path Parameters

project_id
string
required

Body

application/json
name
string
required

Trimmed before validation.

Required string length: 1 - 80
schedule
string
required

5-field cron expression (minute hour day-of-month month day-of-week), read in timezone. Two firings may not be closer than 5 minutes (the scheduler's tick): * * * * *, */2 * * * * and 0,58 * * * * are refused.

payload

JSON template fired on each run. A string is stored verbatim; any other value is JSON.stringify'd; omitted becomes '{}'. Must still parse as JSON after {{now}}/{{iso}}/{{ts}} substitution.

dataset
string | null

Optional identity dataset: every run is stored in it as one record. When absent, each run is routed through the project's mapping rules, and a run none of them matches is stored whole, as one record, in the dataset default (#284) rather than kept as a submission with no record.

timezone
string
default:UTC

IANA time zone, e.g. America/New_York (#165, FLOW-14). The schedule keeps local time across daylight-saving changes: a local time that happens twice fires once (its first occurrence); one skipped by the spring change fires just after the gap. Normalised to its canonical name.

Response

Created and enabled. NOTE: this handler returns 200, not 201.

id
string
required
next_run_at
string<date-time>
required
timezone
string
required
next_runs
string<date-time>[]
required

The next three fire times (UTC instants).

cron_trigger
object

The created cron trigger, as GET by id returns it (#201).