List a cron job's runs
/v1/sites/{siteId}/cron-jobs/{jobId}/runs Lists the job's last 20 runs, newest first, each with what it printed (the end of it, for long output). Skips in a row for the same reason are folded into one entry (repeats). They're read from the site's server, so it must be running. What a job prints can hold a password or a key, so every call is written to the token's request log.
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
sites:files - Files and logins. File Manager, WordPress logins, cron jobs, backup downloads and backup storage. Full access to the sites' code and data.
Path parameters
| Field | Type and description |
|---|---|
siteId Required | string The site's id. |
jobId Required | string The cron job's id. |
Query parameters
| Field | Type and description |
|---|---|
limit | integer 1 to 100 Default How many items to return, from 1 to 100. Default 25. |
cursor | string 1 to 1,024 characters The |
sort | string Default The field to sort by. Each list names the fields it can be sorted by. One of: |
order | string Default
One of: |
status | string Only runs that ended this way. One of: |
trigger | string Only runs started this way. One of: |
Example request
curl "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/runs?status=success" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/runs?status=success", {
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
},
});
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data, pagination } = await res.json();
console.log(data, pagination.nextCursor); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });
for await (const item of rf.sites.cronJobs.runs.list({
siteId: "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
jobId: "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
status: "success",
})) {
console.log(item);
} <?php
$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/runs?status=success');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
$answer = json_decode($body, true);
print_r($answer['data']);
echo $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL; import os
import requests
response = requests.get(
"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/runs",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
params={
"status": "success",
},
timeout=120,
)
response.raise_for_status()
answer = response.json()
print(answer["data"], answer["pagination"]["nextCursor"]) Response
200 OK Returns a list of CronRun objects in data, with a Pagination object in pagination.
The CronRun object's fields 12 fields
| 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 response
{
"data": [
{
"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"
}
],
"pagination": {
"limit": 25,
"hasMore": false,
"nextCursor": null
}
} Errors
The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).
| Status and code | When, and what to do |
|---|---|
400 invalid_ | A query parameter is unknown or has a wrong value ( Correct or remove the parameter named in |
400 invalid_ | The cursor isn't one this list gave, or was made with other filters or another sort. Start again from the first page, or keep the filters and sort the cursor was made with. |
403 trial_ | The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept. Keep the server in the control panel: they switch on by themselves. |
404 not_ | The resource doesn't exist, or isn't this account's. Check the id. Ids of other accounts' resources answer the same way. |
409 site_ | The site isn't in a state that allows this (for example, it's still installing). Wait until the site is active, then try again. |
409 server_ | The server isn't in a state that allows this (for example, it's off or still being set up). Start the server, or wait until it's active, then try again. |
409 server_ | The server is being restored, and nothing else can change it or its sites until that's done. Wait until the restore finishes (the server's |
502 server_ | The server didn't answer, or didn't finish the request. Check that the server is running, then try again in a minute. |