POST
Create a cron job

Authorizations

Authorization
string
header
required

Bearer token for authentication. Format: 'Bearer {token}'

Headers

X-Workspace-Id
string

Workspace ID (uses default workspace if not provided)

Path Parameters

uuid
string
required

Application UUID

Body

application/json

Create a cron job

label
string
required

Human-readable display name for the cron job. The identifier the platform runs it under is generated and returned as name.

command
string
required

Shell command to execute (e.g., 'rake db:cleanup', 'python script.py')

schedule_type
enum<string>
default:interval

Schedule type: 'cron' for custom cron expression, 'interval' for predefined intervals

Available options:
cron,
interval
cron
string

Cron expression (e.g., '0 * * * *' for hourly). Required for cron schedule type.

interval_type
enum<string>

Predefined interval: 'every_10_minutes', 'hourly', or 'daily'. Only for interval schedule type.

Available options:
every_10_minutes,
hourly,
daily
daily_time
string

Execution time for daily jobs in HH:MM format (24-hour). Only for daily interval.

minute
string

Minute component for scheduling (0-59)

hour
string

Hour component for scheduling (0-23)

size
string

A size code from GET /api/v1/apps/{uuid}/cronjobs/sizes, e.g. hobby-1c-1g: the CPU and RAM each run gets, billed for the time each run takes whether the app is on a resource or on Usage Billing. Sizes follow the app's CPU class; defaults to the smallest with at least the app's RAM, the largest if none has that much.

max_run_seconds
integer<int32>

How long a run may take, in seconds, from 1 to 86400 (24 hours): a run still going then is stopped and ends failed with reason DeadlineExceeded (GET .../runs). Leave it out or null for no limit.

overage
enum<string>

What the cron job does once its resource's cron minutes for the billing cycle are used up: 'pause' (the default) until the next renewal, which resumes it, or 'bill', each run past them billed by the second at its size's price on Usage Billing. Choosing 'bill' needs apps:manage and starts Usage Billing's $5 monthly minimum when the subscription pays for nothing else (422 with a checkout_url to complete first). Only where the resource has cron minutes (cron_minutes on GET /api/v1/resources/{uuid}) and is not on an enterprise contract; elsewhere it is ignored: on Usage Billing or a plan that costs nothing every run is billed, and a contract's cron jobs pause at its limit.

Available options:
pause,
bill

Response

Create a cron job

Api_V1_Entities_Cronjob model

uuid
string
required

Cron job UUID

name
string
required

Cron job name

label
string
required

Human-readable display name

schedule_type
string
required

Schedule type (cron, interval)

interval_type
string
required

Interval type (every_10_minutes, hourly, daily)

hour
string
required

Hour component

minute
string
required

Minute component

cron_expression
string
required

Cron expression for custom schedules

command
string
required

Command to execute

size
string
required

The size code each run gets, e.g. hobby-1c-1g; null for a cron job created before sizes, which keeps its CPU and RAM until one is set

overage
string
required

What a run past its resource's cron minutes does: 'pause' until the next renewal, or 'bill', billed by the second. Always 'bill' on Usage Billing or a plan that costs nothing, which include no cron minutes, and 'pause' on an enterprise contract with a cron minute limit; null where its runs are not billed (an enterprise contract without a limit, a resource exempted from billing on a plan that costs nothing, the workspace pool)

max_run_seconds
integer<int32>
required

How long a run may take, in seconds, before it is stopped and ends failed with reason DeadlineExceeded; null for no limit

suspended
boolean
required

Whether the cron job is paused: it starts no run and is not billed. POST .../pause and .../resume change it

status
string
required

Current status (running, stopped)

last_job_name
string
required

Name of the most recent run

last_job_status
string
required

Status of the most recent run (e.g. running, complete, failed)

last_job_run_at
string<date-time>
required

Last execution timestamp

created_at
string<date-time>
required

Creation timestamp

updated_at
string<date-time>
required

Last update timestamp