Skip to content

Cron jobs

Scheduled tasks on a site. For the same in the control panel, see Schedule cron jobs.

Operations

OperationRequest
List a site's cron jobs GET /v1/sites/{siteId}/cron-jobs
Add a cron job to a site POST /v1/sites/{siteId}/cron-jobs
Change a cron job PUT /v1/sites/{siteId}/cron-jobs/{jobId}
Resume a paused cron job POST /v1/sites/{siteId}/cron-jobs/{jobId}/actions/enable
Pause a cron job POST /v1/sites/{siteId}/cron-jobs/{jobId}/actions/disable
Delete a cron job DELETE /v1/sites/{siteId}/cron-jobs/{jobId}
Run a cron job now POST /v1/sites/{siteId}/cron-jobs/{jobId}/actions/run
List a cron job's runs GET /v1/sites/{siteId}/cron-jobs/{jobId}/runs
Get which of a site's cron jobs are running GET /v1/sites/{siteId}/cron-status

The CronJob object

A scheduled task on a site, run by its server as the site's own user in the site's folder. Every job's runs are kept (the last 20, with their output).

FieldType and description
id

string

The cron job's id.

siteId

string

The site it runs on.

name

string

The job's name.

type

string

What the job runs: wp_cli (a WP-CLI command), php (a PHP script in the site), url (calls an address, as a visitor would) or command (a shell command).

Known values: wp_cliphpurlcommand More can appear.

target

string

What it runs, by type: the WP-CLI command without wp (transient delete --expired), the PHP script's path in the site and its arguments (/wp-content/tasks/report.php --quiet), the address it calls, or the shell command.

schedule

string

When it runs: a cron schedule of five fields (minute, hour, day of month, month, day of week) in UTC, like 0 3 * * * (every day at 03:00 UTC).

timeoutSeconds

integer

How long a run may take, in seconds, before it's stopped (60 to 7,200).

enabled

boolean

Whether it runs on its schedule. false: paused (it can still be run by hand).

createdAt

string An ISO 8601 time, in UTC

When the job was added.

updatedAt

string An ISO 8601 time, in UTC

When it was last changed.

Example

The CronJob object
{
  "id": "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
  "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "name": "Nightly clean-up",
  "type": "wp_cli",
  "target": "transient delete --expired",
  "schedule": "0 3 * * *",
  "timeoutSeconds": 900,
  "enabled": true,
  "createdAt": "2026-11-02T09:14:05.000Z",
  "updatedAt": "2026-11-02T09:14:05.000Z"
}

The CronJobRunStarted object

A run of a cron job, started by hand.

FieldType and description
running

boolean

Whether the run is still going. false: it already ended, and it's the first of the job's runs.

Example

The CronJobRunStarted object
{
  "running": true
}

The CronRun object

One run of a cron job: when, how it ended, and what it printed.

FieldType and description
id

string

The run's id. It stays the same for as long as the run is kept.

startedAt

string An ISO 8601 time, in UTC

When it started. For skipped runs folded together (repeats over 1), the latest of them.

finishedAt

string or null An ISO 8601 time, in UTC

When it ended. Null while it runs.

durationMs

integer or null

How long it took, in milliseconds. Null while it runs.

exitCode

integer or null

The exit code it ended with (0 is success). Null when it didn't start, was stopped, or still runs.

status

string

How it ended: success (exit code 0), failed (another exit code, or it couldn't start), timeout (stopped at the job's timeoutSeconds) or skipped (it didn't run: see reason).

Known values: successfailedtimeoutskipped More can appear.

trigger

string

What started it: schedule, or manual (run by hand, in the panel or with POST …/actions/run).

Known values: schedulemanual More can appear.

reason

string or null

Why it was skipped, stopped or couldn't start, in a sentence (for example, the previous run was still going). Null otherwise.

outputBytes

integer

The size of everything it printed, in bytes.

truncated

boolean

Whether only the end of its output is kept: the last 16 KB of a longer output.

repeats

integer

How many runs this entry stands for: skips in a row for the same reason are folded into one entry. 1 otherwise.

output

string

What the job printed (its output and errors together), the end of it when truncated.

Example

The CronRun object
{
  "id": "1795057200000-48213",
  "startedAt": "2026-11-19T03:00:00.000Z",
  "finishedAt": "2026-11-19T03:00:02.000Z",
  "durationMs": 2140,
  "exitCode": 0,
  "status": "success",
  "trigger": "schedule",
  "reason": null,
  "outputBytes": 40,
  "truncated": false,
  "repeats": 1,
  "output": "Success: 14 expired transients deleted.\n"
}

The CronStatus object

Which of a site's cron jobs are running now, and how each one's latest run went, as its server reports them.

FieldType and description
checkedAt

string An ISO 8601 time, in UTC

The time on the site's server when it was asked (UTC, the time zone of every schedule).

jobs

array of objects

Every cron job of the site, in the order of their ids.

jobId

string

The cron job's id.

running

boolean

Whether it's running now.

lastRun

object or null

Its latest run, without the output (GET /sites/{siteId}/cron-jobs/{jobId}/runs has it). Null when it hasn't run yet.

Show its 11 fields
FieldType and description
id

string

The run's id. It stays the same for as long as the run is kept.

startedAt

string An ISO 8601 time, in UTC

When it started. For skipped runs folded together (repeats over 1), the latest of them.

finishedAt

string or null An ISO 8601 time, in UTC

When it ended. Null while it runs.

durationMs

integer or null

How long it took, in milliseconds. Null while it runs.

exitCode

integer or null

The exit code it ended with (0 is success). Null when it didn't start, was stopped, or still runs.

status

string

How it ended: success (exit code 0), failed (another exit code, or it couldn't start), timeout (stopped at the job's timeoutSeconds) or skipped (it didn't run: see reason).

Known values: successfailedtimeoutskipped More can appear.

trigger

string

What started it: schedule, or manual (run by hand, in the panel or with POST …/actions/run).

Known values: schedulemanual More can appear.

reason

string or null

Why it was skipped, stopped or couldn't start, in a sentence (for example, the previous run was still going). Null otherwise.

outputBytes

integer

The size of everything it printed, in bytes.

truncated

boolean

Whether only the end of its output is kept: the last 16 KB of a longer output.

repeats

integer

How many runs this entry stands for: skips in a row for the same reason are folded into one entry. 1 otherwise.

Example

The CronStatus object
{
  "checkedAt": "2026-11-19T10:42:17.000Z",
  "jobs": [
    {
      "jobId": "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
      "running": false,
      "lastRun": {
        "id": "1795057200000-48213",
        "startedAt": "2026-11-19T03:00:00.000Z",
        "finishedAt": "2026-11-19T03:00:02.000Z",
        "durationMs": 2140,
        "exitCode": 0,
        "status": "success",
        "trigger": "schedule",
        "reason": null,
        "outputBytes": 40,
        "truncated": false,
        "repeats": 1
      }
    }
  ]
}

Popular

API docs