Scheduler
Manage Grav's cron-based scheduler. List registered jobs, inspect cron installation status, review execution history, and trigger manual runs. Permissions: api.scheduler.read / api.scheduler.write.
Manage Grav's cron-based scheduler. List registered jobs, inspect cron installation status, review execution history, and trigger manual runs.
Permissions: api.scheduler.read / api.scheduler.write.
List Scheduler Jobs
/scheduler/jobs
{"data": [{"id": "cache-purge", "command": "bin/grav cache --purge", "expression": "0 4 * * *", "enabled": true, "status": "success", "last_run": "2026-04-17T04:00:00+00:00", "error": null}]}
Response Codes
Scheduler Status
/scheduler/status
{"data": {"crontab_status": "installed", "cron_detection": "crontab", "process_available": true, "last_run": "2026-08-20T12:00:00+00:00", "environment": "www.example.com", "environment_has_overrides": true, "last_run_environment": "cli", "cron_command": "* * * * * cd /path/to/grav && /usr/bin/php bin/grav scheduler", "scheduler_command": "bin/grav scheduler", "whoami": "www-data", "health": {}, "triggers": [], "webhook_installed": false, "webhook_enabled": false}}
Response Codes
crontab_status is one of: not_installed, installed, error, unknown.
environment is the environment this request resolved to (normally the hostname), environment_has_overrides says whether it has its own user/env/<name>/config folder, and last_run_environment is the environment the scheduler last actually ran under (cli for a crontab line that does not pass --env). When the last two disagree and overrides exist, jobs defined only in the override never run from that trigger; scheduler_command already carries the --env flag to fix the crontab line.
Job History
/scheduler/history
Parameters
| Name | Type | Description |
|---|---|---|
| page optional | integer | Page number (default 1). |
| per_page optional | integer | Items per page. |
{"data": [{"job_id": "cache-purge", "status": "success", "last_run": "2026-04-17T04:00:00+00:00", "error": null}], "meta": {"total": 12, "page": 1, "per_page": 50}}
Response Codes
Run Scheduler
/scheduler/run
Parameters
| Name | Type | Description |
|---|---|---|
| force optional | boolean | If true, run all jobs now regardless of schedule. Defaults to false. |
{"force": true}
{"data": {"message": "Scheduler run completed.", "forced": true, "job_states": {"cache-purge": {"state": "success", "last-run": 1713355200}}}}