Setyenv · Docs
  • English
  • Spanish
  • Chinese
  • Japanese
  • Arabic
  • German
  • French
  • Hindi
  • Indonesian
  • Italian
  • Dutch
  • Portuguese
  • Russian
  • Turkish

REST API reference

Complete reference for all WP-PFWorkflow REST API endpoints. Base URL: /wp-json/pfw-workflow/v1/

Authentication

All endpoints require WordPress authentication unless marked Public. Send X-WP-Nonce header with a nonce from wp_create_nonce('wp_rest').

Workflows

MethodRouteDescription
GET/workflowsList workflows (query: status, tag, q, per_page, page)
POST/workflowsCreate a new workflow
GET/workflows/{id}Get workflow with full graph
PUT/workflows/{id}Update workflow
DELETE/workflows/{id}Soft-delete (trash)
GET/workflows/{id}/exportExport as JSON
POST/workflows/importImport from JSON body
POST/workflows/{id}/validateValidate graph structure
POST/workflows/{id}/runExecute manually
POST/workflows/{id}/test-runDry-run (no side effects)

Executions

MethodRouteDescription
GET/workflows/{id}/logsExecution logs (filter: status, since, until, limit 1-100)
GET/workflows/{id}/executions/{eid}/supportFull support package (timeline + logs + replay data)
POST/workflows/{id}/executions/{eid}/cancelCancel a running execution
POST/workflows/{id}/executions/{eid}/resumeResume from a specific node

Nodes & catalog

MethodRouteDescription
GET/catalogFull node catalog (categories + nodes)
GET/catalog/contractsTyped node contracts (inputs, outputs, config schema)
GET/nodes/{key}Inspect a specific node's contract
POST/nodes/{key}/executeExecute a node in isolation
POST/nodes/{key}/dry-runDry-run a node without side effects

Templates

MethodRouteDescription
GET/templatesList pre-built templates
GET/templates/{id}/install-planDependencies needed before installing

Studio

MethodRouteDescription
GET/studio/contextSite info and environment
GET/studio/optionsAvailable async option providers
GET/studio/options/{source}Resolved options from a provider
GET/studio/tokensFull token catalog

Webhooks

MethodRouteAuthDescription
GET,POST/webhooks/incomingPublicGeneric incoming webhook receiver
POST/webhooks/incoming/{key}PublicKeyed incoming webhook receiver

Remote workers

MethodRouteDescription
GET/remote/workersList workers
POST/remote/workersCreate worker (token shown once)
GET/remote/workers/{id}Get worker details
DELETE/remote/workers/{id}Delete worker
POST/remote/workers/{id}/rotateRotate bearer token
POST/remote/workers/{id}/enableEnable worker
POST/remote/workers/{id}/disableDisable worker

Remote queue

MethodRouteAuthDescription
GET/remote/contractPublicWorker self-discovery
POST/remote/queue/claimBearerWorker claims jobs
POST/remote/queue/{jobId}/heartbeatBearerLease extension
POST/remote/queue/{jobId}/resultBearerReport job result
GET/remote/queueWP authList all jobs
POST/remote/queueWP authEnqueue a job
GET/remote/queue/statsWP authQueue statistics
GET/remote/queue/{jobId}WP authGet job details
DELETE/remote/queue/{jobId}WP authCancel job

Approvals

MethodRouteDescription
GET/approvals/pendingList pending approvals
GET/approvals/{id}Get approval details
POST/approvals/{id}/approveApprove (optional note)
POST/approvals/{id}/rejectReject (optional note)

OAuth2

MethodRouteDescription
POST/oauth/startStart authorisation code flow
GET/oauth/callbackProvider redirect target (state-guarded)

Agent integration

MethodRouteDescription
GET/agent/contractTyped contract for agent tool use
GET/agent/workflows/{id}Workflow snapshot for agent

System

MethodRouteAuthDescription
GET/diagnosticsWP authFull diagnostics report
GET/heartbeatPublicQueue tick (rate-limited 30s/IP)
POST/loopback/runHMACSelf-initiated queue processing

Error format

All errors follow this envelope:

{
  "status": "fail",
  "error": "workflow_not_found",
  "detail": "No workflow exists with id 42"
}

HTTP status codes: 400 (bad request), 401 (unauthorised), 403 (forbidden), 404 (not found), 409 (conflict), 422 (validation), 429 (rate limit), 500 (internal error), 502 (bad gateway).