Data Machine REST API

Complete REST API reference for Data Machine.

Overview

Base URL: /wp-json/datamachine/v1/

Authentication: WordPress application password, WordPress admin cookie authentication, or endpoint-specific bearer-token authentication where noted.

Permissions: REST controllers use DataMachineAbilitiesPermissionHelper, not a single generic manage_options check. WordPress administrators still pass because manage_options grants the mapped Data Machine capabilities, but the canonical permissions are scoped actions such as manage_flows, manage_agents, manage_settings, chat, use_tools, view_logs, and create_own_agent.

Implementation: All REST route registrations live in inc/Api/. This inventory is sourced from register_routes() implementations in that directory.

Route Inventory

GroupRoutesPermission modelSourceDocs
AgentsRetired in #3456 — agent CRUD and tokens are REST-visible abilities; access grants go through Agents API’s agents/list-agent-users / grant-agent-access / revoke-agent-access run through /wp-abilities/v1/abilities/datamachine/<slug>/run; /agents/me is datamachine/get-agent with me: true (see Agents). The browser authorization routes (/agent/authorize, /agent/auth/*) remain on datamachine/v1.Each ability’s permission callback (manage_agents, create_own_agent, or chat through PermissionHelper, plus per-agent access checks on tokens and access management).inc/Abilities/AgentAbilities.php, inc/Abilities/AgentTokenAbilities.phpAgents
Agent Ping/agent-ping/confirm, /agent-ping/callback/{callback_id}Bearer-token callback auth using the configured agent-ping callback token. No WordPress capability check.inc/Api/AgentPing.phpAgent Ping
AnalyticsExtension-provided analytics routes via datamachine_analytics_ability_mapmanage_flows via PermissionHelper::can( 'manage_flows' ).inc/Api/Analytics.phpAnalytics
Auth/auth/providers, /auth/{handler_slug}, /auth/{handler_slug}/status, /auth/{handler_slug}/token, /auth/{handler_slug}/refreshmanage_settings through Auth::check_permission().inc/Api/Auth.phpAuth
Chat/chat, /chat/continue, /chat/{session_id}, /chat/sessions, /chat/sessions/{session_id}/read; /chat/pingChat routes require chat. /chat/ping uses the chat ping token verifier.inc/Api/Chat/Chat.phpChat, Chat Sessions
EmailRetired in #3456 — email send/fetch/manage operations are REST-visible abilities run through /wp-abilities/v1/abilities/datamachine/<slug>/run (see Email).Each ability’s permission callback (email family: PermissionHelper::can( 'use_tools' ) or PermissionHelper::can_manage(), plus agent-token ability scopes).inc/Abilities/Email/, inc/Abilities/Fetch/FetchEmailAbility.php, inc/Abilities/Publish/SendEmailAbility.phpEmail
Execute/executemanage_flows through the execute controller.inc/Api/Execute.phpExecute
Files/files (multipart upload)Multipart upload is a retained transport route; it requires a logged-in user plus PermissionHelper::can_manage(). Flow-file and agent-file listing/reads/writes are REST-visible abilities run through /wp-abilities/v1/abilities/datamachine/<slug>/run (see Files).inc/Api/FlowFiles.php, inc/Abilities/File/AgentFileAbilities.php, inc/Abilities/DailyMemoryAbilities.phpFiles
FlowsRetired in #3456 — flow CRUD, steps, queues, and memory files are REST-visible abilities run through /wp-abilities/v1/abilities/datamachine/<slug>/run (see Flows).Each ability’s permission callback (flow family: PermissionHelper::can_manage()).inc/Abilities/Flow/, inc/Abilities/FlowStep/Flows
HandlersRetired in #3456 — handler discovery and detail are REST-visible abilities run through /wp-abilities/v1/abilities/datamachine/<slug>/run (see Handlers).Each ability’s permission callback (PermissionHelper::can_manage()); the public wrapper routes are gone.inc/Abilities/HandlerAbilities.php, inc/Abilities/Handler/HandlerDetailAbility.phpHandlers
Internal LinksRetired in #3456 — link audit, orphans, backlinks, broken-link checks, and diagnostics are REST-visible abilities run through /wp-abilities/v1/abilities/datamachine/<slug>/run (see Internal Links).Each ability’s permission callback (internal-links family: PermissionHelper::can_manage()).inc/Abilities/InternalLinkingAbilities.phpInternal Links
JobsRetired in #3456 — job listing, lookup, and deletion are REST-visible abilities run through /wp-abilities/v1/abilities/datamachine/<slug>/run (see Jobs).Each ability’s permission callback (PermissionHelper::can_manage()) plus row-level ownership checks inside the abilities.inc/Abilities/Job/GetJobsAbility.php, inc/Abilities/Job/DeleteJobsAbility.phpJobs
LogsRetired in #3456 — log read/metadata/clear are REST-visible abilities run through /wp-abilities/v1/abilities/datamachine/<slug>/run (see Logs).Each ability’s permission callback allows view_logs, matching the retired wrapper routes.inc/Abilities/LogAbilities.phpLogs
PipelinesRetired in #3456 — pipeline CRUD, steps, and memory files are REST-visible abilities run through /wp-abilities/v1/abilities/datamachine/<slug>/run (see Pipelines).Each ability’s permission callback (pipeline family: PermissionHelper::can_manage()).inc/Abilities/Pipeline/, inc/Abilities/PipelineStepAbilities.phpPipelines
Processed ItemsRetired in #3456 — processed-items clearing is the REST-visible datamachine/clear-processed-items ability (see Processed Items).Ability permission callback (PermissionHelper::can_manage()).inc/Abilities/ProcessedItemsAbilities.phpProcessed Items
Providers/providersPublic provider metadata endpoint.inc/Api/Providers.phpProviders
SettingsRetired in #3456 — settings, scheduling intervals, tool config, handler defaults, and ping-secret generation are REST-visible abilities run through /wp-abilities/v1/abilities/datamachine/<slug>/run (see Settings).Each ability’s permission callback (PermissionHelper::can_manage()).inc/Abilities/SettingsAbilities.phpSettings, Scheduling Intervals
Step TypesRetired in #3456 — step-type discovery is the REST-visible datamachine/get-step-types ability (see Step Types).Ability permission callback (PermissionHelper::can_manage()); the public wrapper routes are gone.inc/Abilities/StepTypeAbilities.phpStep Types
System/system/status, /system/tasks, /system/tasks/{task_type}/run, /system/tasks/prompts, /system/tasks/prompts/{task_type}/{prompt_key}manage_settings through inline PermissionHelper::can( 'manage_settings' ) callbacks.inc/Api/System/System.phpSystem
Tools/toolsPublic tool metadata endpoint.inc/Api/Tools.phpTools
Users/users/{id}, /users/meUser preferences and current-user context. Cross-user access uses manage_flows; agent-level access uses manage_agents.inc/Api/Users.phpUsers
Webhook Triggers/trigger/{flow_id}Public route with per-flow bearer or HMAC verification. The callback is __return_true because authorization is performed by WebhookAuthResolver/WebhookVerifier, then ability execution runs inside a bounded authenticated context.inc/Api/WebhookTrigger.php, inc/Api/WebhookAuthResolver.php, inc/Api/WebhookVerifier.phpWebhook Triggers

Endpoint Categories

Workflow Execution

Pipeline & Flow Management

Agents, Memory & Chat

Tools, Providers & Handlers

Content, Email & Analytics

Configuration & Operations

Common Patterns

Authentication

Data Machine supports three authentication shapes:

  1. Application Password for external WordPress REST clients.
  2. Cookie Authentication for WordPress admin sessions.
  3. Endpoint-specific Bearer/HMAC auth for webhook-style callbacks that do not map cleanly to a logged-in WordPress user.

See Authentication.

Permission Resolution

PermissionHelper::can() maps Data Machine actions to concrete WordPress capabilities:

ActionWordPress capability
manage_agentsdatamachine_manage_agents
manage_flowsdatamachine_manage_flows
manage_settingsdatamachine_manage_settings
chatdatamachine_chat
use_toolsdatamachine_use_tools
view_logsdatamachine_view_logs
create_own_agentdatamachine_create_own_agent

Administrators retain access through manage_options, but docs and integrations should refer to the scoped Data Machine actions above.

Error Handling

All endpoints return standardized error responses following WordPress REST API conventions. Common error codes include:

  • rest_forbidden (403) – Insufficient permissions.
  • rest_invalid_param (400) – Invalid parameters.
  • Resource-specific errors (404, 422, 500).

See Error Handling Reference for complete error code documentation.

Pagination

Endpoints returning lists commonly support pagination parameters:

  • per_page – Number of items per page.
  • offset or page – Pagination offset.

Implementation Guide

REST handlers should stay thin: validate request shape, call the service or ability that owns the behavior, and return a WordPress REST response.

php
register_rest_route( 'datamachine/v1', '/pipelines', array(
    'methods'             => 'GET',
    'callback'            => array( Pipelines::class, 'get_pipelines' ),
    'permission_callback' => array( Pipelines::class, 'check_permission' ),
) );

For detailed implementation patterns, see the Development section for hooks and extension guides.


API Version: v1 Last Updated: 2026-05-12