Implementation: inc/Api/Jobs.php
Base URL: /wp-json/datamachine/v1/jobs
Jobs expose workflow execution history and cleanup operations.
Requires the Data Machine manage_flows permission (PermissionHelper::can( 'manage_flows' )). Requests may be user-scoped or agent-scoped through PermissionHelper.
List jobs with filtering, sorting, and pagination.
Query parameters:
orderby(string, optional, defaultjob_id): field to order by.order(string, optional, defaultDESC):ASCorDESC.per_page(integer, optional, default50, max100): page size.offset(integer, optional, default0): pagination offset.pipeline_id(integer, optional): filter by pipeline.flow_id(integer, optional): filter by flow.status(string, optional): filter by job status.user_id(integer, optional): filter by user when allowed by the permission scope.parent_job_id(integer, optional): filter child jobs by parent job.hide_children(boolean, optional, defaultfalse): omit child jobs from top-level lists.
Success response:
{
"success": true,
"data": [],
"total": 0,
"per_page": 50,
"offset": 0
}Get one job by ID.
Success response:
{
"success": true,
"data": {}
}Errors:
job_not_found(404): no matching job.
Clear jobs.
Body parameters:
type(string, required):allorfailed.cleanup_processed(boolean, optional, defaultfalse): also clear processed item tracking.
Success response:
{
"success": true,
"message": "Jobs cleared successfully.",
"jobs_deleted": 42,
"processed_items_cleaned": false
}Batch processing uses parent/child jobs. Use parent_job_id to list children and hide_children=true for a top-level-only job list.
curl "https://example.com/wp-json/datamachine/v1/jobs?parent_job_id=100" \
-u username:application_password- REST does not expose job undo. Undo is CLI-only via
wp datamachine jobs undo <job_id>. - Job objects are returned by
GetJobsAbility; fields depend on stored job data and may includeengine_datafor task effects.