Skip to main content
PUT
Create or replace one database schedule

Authorizations

Authorization
string
header
required

WorkOS access JWT or a user-owned WorkOS API key. User keys are bound to one organization and restricted to their enabled product permissions. Session-only onboarding and session revocation require an interactive access JWT. No cookie session is assumed.

Headers

X-Request-Id
string

Optional caller-provided correlation identifier.

Required string length: 1 - 128

Path Parameters

project_id
string
required

Project identifier.

Pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
name
string
required

Database schedule name, unique per project environment.

Pattern: ^[a-z][a-z0-9_-]{0,62}$

Query Parameters

environment
enum<string>
required

Application environment the mutation applies to.

Available options:
dev,
prod

Body

application/json
cron
string
required

Five-field cron expression evaluated in UTC. Send exactly one of cron or every_seconds.

Required string length: 9 - 120
statements
string[]
required

Statements run in order by the application's runtime role. At most 16 KiB per statement and 64 KiB in total.

Required array length: 1 - 20 elements
Required string length: 1 - 16384
Pattern: \S
confirm
boolean
required

Confirms that the statements run with the application's runtime role.

every_seconds
integer

Interval in seconds between runs. Send exactly one of cron or every_seconds.

Required range: 60 <= x <= 2678400
timeout_ms
integer
default:10000
Required range: 1000 <= x <= 30000
enabled
boolean
default:true

Response

The schedule as stored.

cron
string
required
Required string length: 9 - 120
every_seconds
null
required
name
string
required
Pattern: ^[a-z][a-z0-9_-]{0,62}$
environment
enum<string>
required
Available options:
dev,
prod
statements
string[]
required
Maximum array length: 20
timeout_ms
integer
required
Required range: 1000 <= x <= 30000
enabled
boolean
required
next_run_at
string<date-time> | null
required
created_at
string<date-time>
required