Schedules
What runs on its own - the built-in tasks and your custom schedules - with pause, resume and run now. :id also takes a built-in key such as wp-scan.
Reading needs Read only and changes need Manage, unless an endpoint says otherwise. How to read this page.
GET /api/schedules
Section titled “GET /api/schedules”Every schedule: built-in jobs, background tasks and custom ones, with next and last run.
- Level: Read only
- Returns:
{items: ScheduleDto[]}
GET /api/schedules/actions
Section titled “GET /api/schedules/actions”What a custom schedule can do, with JSON Schemas for its params, target and body.
- Level: Read only
- Returns:
{actions: [{action, label, targets, jobType, paramsSchema}], targetSchema, createBodySchema, …}
GET /api/schedules/:id
Section titled “GET /api/schedules/:id”One schedule.
- Level: Read only
- Returns:
{schedule}
POST /api/schedules
Section titled “POST /api/schedules”Create a custom schedule: an action, a target, and a cron (repeat) or runAt (once).
- Level: Manage
- Notes: Destructive
- Input:
{name, action, target: {kind: "sites", slugs}, params, cron: "0 3 * * *" | runAt, enabled?} - Returns:
201 {schedule}
PATCH /api/schedules/:id
Section titled “PATCH /api/schedules/:id”Pause or resume ({enabled}); a custom schedule also takes any field of the create body.
- Level: Manage
- Notes: Destructive
- Input:
{enabled: false} (a built-in one needs Full: it pauses backups, scans, housekeeping) - Returns:
{schedule}
DELETE /api/schedules/:id
Section titled “DELETE /api/schedules/:id”Delete a custom schedule.
- Level: Manage
- Notes: Destructive
POST /api/schedules/:id/run
Section titled “POST /api/schedules/:id/run”Run a schedule now, paused or not.
- Level: Manage
- Notes: Destructive
- Returns:
202 {jobs, skipped, running}; Location when it queued exactly one job