-
Notifications
You must be signed in to change notification settings - Fork 0
REST API Reference
All endpoints are under the openwp/v1 namespace. MCP endpoints use mcp/v1.
All openwp/v1 endpoints require:
- WordPress nonce (
X-WP-Nonceheader) - Logged-in user with
openwp_run_agentoropenwp_manage_settingscapability
All mcp/v1 endpoints require:
- Bearer token authentication (
Authorization: Bearer <token>)
All openwp/v1 responses include Cache-Control: no-store, no-cache, must-revalidate headers.
Returns configuration and capabilities for frontend initialization.
Permission: openwp_run_agent
Response:
{
"settings": {...},
"provider_status": {"has_openai_key": true, ...},
"actions": [...],
"capabilities": {...},
"onboarding": {...},
"mcp": {...}
}Execute agent command (synchronous).
Permission: openwp_run_agent
Body:
{
"prompt": "Create a blog post about AI",
"provider": "openai", // optional
"model": "gpt-5.2", // optional
"conversation_context": { // optional
"enabled": true,
"turns": [{"user": "...", "assistant": "..."}]
}
}Response:
{
"status": "success|failed|no_action|awaiting_approval",
"mode": "single",
"provider": "openai",
"model": "gpt-5.2",
"agent": {"thought": "...", "action": "...", "params": {}, "confidence": 0.9},
"execution": {"status": "success", "data": {...}, "log_id": 42},
"executions": [...],
"action_plan": [...],
"token_usage": {"input_tokens": 500, "output_tokens": 200}
}Execute agent command with SSE streaming.
Permission: openwp_run_agent
Same body as /agent/execute. Returns text/event-stream with typed events (see Agent Engine for event types).
Generate content for the Gutenberg editor block.
Permission: edit_posts
Body:
{
"prompt": "Write a hero section for a SaaS landing page",
"content_type": "hero_section",
"tone": "professional",
"provider": "openai",
"model": "gpt-5.2"
}List pending approvals.
Approve a pending action. For critical actions, requires typed_confirmation: "APPROVE".
Reject a pending action with optional decision_note.
List audit log entries with pagination.
Rollback a previously executed action using its stored snapshot.
Get current plugin settings.
Update plugin settings (merged with existing).
Save encrypted provider API keys.
Get MCP server settings including endpoints and module status.
Update MCP settings (enabled, modules, bearer token).
List backup records with pagination.
Restore a backup by ID (with checksum verification).
Delete a backup record and its file.
List agent memory entries.
Create or update a memory entry.
Delete a specific memory entry.
Clear all memory entries.
List all registered actions with schemas, risk levels, and categories.
Update per-action policy overrides (enable/disable, approval requirements).
Upload file attachments for the sitewide chatbot.
SSE transport - establishes event stream for MCP communication.
Direct JSON-RPC over SSE endpoint.
Message ingress for SSE transport sessions.
Streamable HTTP transport (primary recommended transport).
One-time upload endpoint for MCP file transfers.
See MCP Server for JSON-RPC methods and protocol details.
OpenWP v0.1.4 | GitHub Repository | GPLv2+