Cron jobs
Scheduled tasks on a site. For the same in the control panel, see Schedule cron jobs.
Operations
| Operation | Request |
|---|---|
| List a site's cron jobs | GET / |
| Add a cron job to a site | POST / |
| Change a cron job | PUT / |
| Resume a paused cron job | POST / |
| Pause a cron job | POST / |
| Delete a cron job | DELETE / |
| Run a cron job now | POST / |
| List a cron job's runs | GET / |
| Get which of a site's cron jobs are running | GET / |
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).
| Field | Type 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: Known values: |
target | string What it runs, by |
schedule | string When it runs: a cron schedule of five fields (minute, hour, day of month, month, day of week) in UTC, like |
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. |
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
{
"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.
| Field | Type and description |
|---|---|
running | boolean Whether the run is still going. |
Example
{
"running": true
} The CronRun object
One run of a cron job: when, how it ended, and what it printed.
| Field | Type 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 ( |
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: Known values: |
trigger | string What started it: Known values: |
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 |
Example
{
"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.
| Field | Type 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 ( Show its 11 fields
|
Example
{
"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
}
}
]
}