Skip to Main
schemawp
Back to docs

Agent REST API

The Agent REST API is a token-authenticated alternative to MCP, introduced in SchemaWP 1.2.0. It exposes the same tools, the same session briefing, and the same History auditing as the MCP server — but over plain REST, so any agent that can make HTTP requests can use it, no MCP support required.

Creating a connection

  1. Go to SchemaWP → Connections and select API as the connection method
  2. Give the connection a friendly name and click Create Connection
  3. Copy the generated connection brief — it contains the site URL, the API base URL, the Bearer token, and the required session workflow. The token is shown once; only its prefix remains visible afterwards
  4. Paste the brief into your AI chat — that’s the whole setup

Active connections are listed in the Connections sidebar, where each token can be revoked at any time.

Authentication

Every request carries the token in the Authorization header:

Authorization: Bearer scwp_…

Endpoints

The API lives under:

https://yoursite.com/wp-json/scwp-agent/v1
  • GET /bootstrap — session briefing: core_rules (the same ACSS identity, constraints, and procedures MCP delivers on initialize.instructions), plus the required workflow
  • GET /instructions — the full ACSS core design-system rules (fallback if bootstrap was skipped or truncated)
  • GET /capabilities — enabled operations with their full inputSchema (REST equivalent of MCP tools/list)
  • GET /context — current site context
  • GET /history — recent patch history (limit parameter, default 10)
  • POST /actions/{tool} — run a tool with a JSON body of arguments, e.g. POST /actions/schemawp_acss_get_config

Session workflow

The connection brief instructs the agent to follow the same session order as MCP:

  1. Call GET /bootstrap once at session start and treat core_rules as the system prompt
  2. Call GET /capabilities to discover operations and schemas; if the catalog is truncated, POST /actions/schemawp_acss_get_tool_schema
  3. Before any writes: GET /context and GET /history
  4. Load domain skills (POST /actions/schemawp_acss_get_skill) and read current values (POST /actions/schemawp_acss_get_config) before patching
  5. Run mutations with POST /actions/{tool} — History is the source of truth for what changed

Notes

  • The available operations mirror the Agent Tools toggles in SchemaWP Settings — tools disabled there are absent from /capabilities on all surfaces
  • All mutating calls are audited in Patch History, exactly like MCP tool calls
  • The Agent REST API works on WordPress 6.7+ — it does not require the Abilities API