All endpoints are served by the APM v4/v5 Phoenix server on port 3032. CORS headers (Access-Control-Allow-Origin: *) are included on all API responses. API authentication is enforced via the ApiAuth plug using bearer tokens from apm_config.json.
v5 Addition: AG-UI protocol endpoints are available under
/api/v2/ag-ui/*. See the AG-UI v2 Endpoints section below.
http://localhost:3032
Many endpoints support project scoping via the ?project=<name> query parameter. When omitted, the active project from apm_config.json is used.
Server health check (v3 compatible, outside /api scope).
Response:
{
"status": "ok",
"uptime": 3600.5,
"total_projects": 10,
"active_project": "ccem",
"projects": [
{"name": "ccem", "status": "active", "agent_count": 3, "session_count": 2}
],
"session_id": "7cb282f4-..."
}Server status with version and capability info.
List all registered projects with summary data.
Response:
{
"projects": [
{
"name": "ccem",
"root": "/Users/jeremiah/Developer/ccem",
"status": "active",
"agent_count": 3,
"session_count": 2,
"ralph_passed": 19,
"ralph_total": 19
}
],
"active_project": "ccem"
}Master aggregation endpoint. Returns all dashboard data for the active (or specified) project.
Query params: ?project=<name>
Response:
{
"timestamp": "2026-02-19T15:00:00Z",
"session_id": "7cb282f4-...",
"project": "ccem",
"summary": {
"total_agents": 5,
"completed": 3,
"running": 2,
"total_tokens_in": 150000,
"total_tokens_out": 45000,
"total_tokens_cache": 80000,
"total_tokens": 275000,
"total_tool_calls": 340,
"total_api_calls": 120
},
"agents": [...],
"edges": [{"source": "agent-1", "target": "agent-2"}],
"tasks": [...],
"plane": {},
"notifications": {"unread": 2, "recent": [...]},
"ralph": {...},
"slash_commands": [...],
"input_requests": [...]
}List all registered agents.
Register a new agent (original v4 endpoint).
Body:
{
"id": "agent-abc",
"name": "Schema Validator",
"tier": 1,
"status": "running",
"deps": ["agent-xyz"],
"metadata": {"linear_issue": "PEG-123"},
"project_name": "ccem"
}Alias for /api/register (v3 compatibility).
Update an existing agent's fields.
Body:
{
"id": "agent-abc",
"status": "completed",
"tier": 2
}Trigger an agent discovery scan of tasks_dir/*.output files. Returns newly discovered agents.
Query params: ?project=<name>
Response:
{
"discovered": ["agent-1", "agent-2"],
"total_agents": 5,
"project": "ccem"
}Agent heartbeat (token usage, status update).
List recent notifications (up to 50).
Response:
{
"notifications": [
{
"id": 1,
"title": "Agent Completed",
"body": "Schema Validator has finished execution",
"category": "success",
"agent_id": "agent-abc",
"timestamp": "2026-02-19T15:00:00Z",
"read": false
}
]
}Add a notification.
Body:
{
"title": "Build Failed",
"body": "TypeScript compilation error in src/merge/",
"category": "error",
"agent_id": "agent-abc"
}Categories: info, success, warning, error, input, system
Mark all notifications as read.
Alias for notification creation (original v4 endpoint).
Get Ralph PRD data for the active project. Returns user stories with pass/fail status.
Query params: ?project=<name>
Response:
{
"project": "CCEM APM v4",
"branch": "ralph/apm-v4-gap-closure",
"description": "Close v3 backward-compatibility gaps...",
"stories": [
{
"id": "US-013",
"title": "ConfigLoader GenServer for apm_config.json",
"priority": 1,
"passes": true,
"module": "",
"namespace": "",
"notes": "Implemented by PID 9591 session"
}
],
"total": 19,
"passed": 19
}D3.js-compatible nodes and edges for the Ralph flowchart.
Response:
{
"nodes": [
{
"id": "US-013",
"title": "ConfigLoader GenServer",
"priority": 1,
"status": "passed",
"module": "",
"notes": ""
}
],
"edges": [
{"source": "US-013", "target": "US-014"}
]
}List registered slash commands for the active project.
Register slash commands. Accepts a single command object or an array.
Body:
{
"name": "fix",
"description": "Run the fix loop methodology",
"category": "development",
"status": "available"
}Get unresponded input requests (up to 10).
Response:
{
"requests": [
{
"id": 1,
"prompt": "Choose merge strategy",
"options": ["recommended", "conservative", "hybrid"],
"context": {},
"timestamp": "2026-02-19T15:00:00Z",
"responded": false,
"response": null
}
]
}Create an input request.
Body:
{
"prompt": "Approve deployment to production?",
"options": ["Approve", "Reject", "Defer"],
"context": {"environment": "production"}
}Respond to an input request.
Body:
{
"id": 1,
"choice": "Approve"
}Replace the active project's task list.
Body:
{
"tasks": [
{"id": 1, "subject": "Implement merge engine", "status": "completed"},
{"id": 2, "subject": "Add security audit", "status": "in_progress"}
]
}Trigger ConfigLoader to re-read apm_config.json from disk. Broadcasts config change via PubSub. Called automatically by session_init.sh after registering a new session.
Response:
{
"ok": true,
"active_project": "ccem",
"total_projects": 10
}Update the active project's Plane PM context (issue counts, states, etc.).
Body:
{
"project_name": "ccem",
"total_issues": 25,
"states": {
"Backlog": {"count": 10, "color": "#8b949e"},
"In Progress": {"count": 5, "color": "#d29922"},
"Done": {"count": 10, "color": "#3fb950"}
}
}List tracked skill invocations.
Record a skill invocation.
List all discovered Claude Code environments (projects with .claude/ directories).
Response:
{
"environments": [
{
"name": "ccem",
"root": "/Users/jeremiah/Developer/ccem",
"has_claude_md": true,
"session_count": 5,
"last_session_date": "2026-02-19T14:58:02Z"
}
]
}Full detail for a specific environment: CLAUDE.md content, hooks list, recent sessions, configuration.
Execute a shell command in the environment's project root.
Body:
{
"command": "mix test",
"timeout": 60
}Response:
{
"exit_code": 0,
"output": "233 tests, 0 failures\n"
}Safety: Dangerous commands are rejected. Timeout defaults to 30s, max 120s. Localhost-only.
Launch a Claude Code session in the specified environment.
Body:
{
"with_ccem": true
}Stop a running Claude Code session in the specified environment.
Advanced endpoints under /api/v2/:
| Method | Path | Description |
|---|---|---|
| GET | /api/v2/agents |
List agents with filtering |
| GET | /api/v2/agents/:id |
Get agent detail |
| GET | /api/v2/sessions |
List sessions |
| GET | /api/v2/metrics |
Fleet-wide metrics |
| GET | /api/v2/metrics/:agent_id |
Per-agent metrics |
| GET | /api/v2/slos |
List SLO definitions |
| GET | /api/v2/slos/:name |
Get SLO detail |
| GET | /api/v2/alerts |
List alerts |
| GET | /api/v2/alerts/rules |
List alert rules |
| POST | /api/v2/alerts/rules |
Create alert rule |
| GET | /api/v2/audit |
Audit log |
| GET | /api/v2/openapi.json |
OpenAPI spec |
The AG-UI (Agent-User Interaction) protocol endpoints enable standardized, transport-agnostic event streaming for agent activity. These are served by ApmV4Web.V2.AgUiV2Controller and backed by three GenServers: EventRouter, HookBridge, and StateManager.
Emit one or more AG-UI events into the router. Events are dispatched to AgentRegistry, FormationStore, Dashboard, and MetricsCollector.
Body:
{
"type": "RUN_STARTED",
"thread_id": "thread-123",
"run_id": "run-456",
"timestamp": 1710100000000
}SSE stream of all AG-UI events. Clients receive events as text/event-stream. Supports ?types=RUN_STARTED,TEXT_MESSAGE_CONTENT for type filtering.
SSE stream filtered to events for a single agent.
Get the current state snapshot for an agent.
Response:
{
"agent_id": "agent-abc",
"state": {"status": "running", "tokens_in": 5000},
"version": 3,
"updated_at": "2026-03-11T10:00:00Z"
}Replace agent state with a full snapshot (STATE_SNAPSHOT).
Body:
{
"state": {"status": "completed", "tokens_in": 12000, "tokens_out": 3500}
}Apply an RFC 6902 JSON Patch delta to agent state (STATE_DELTA).
Body:
{
"delta": [
{"op": "replace", "path": "/status", "value": "completed"},
{"op": "add", "path": "/tokens_out", "value": 3500}
]
}Routing statistics: total events processed, subscriber count, events by type.
| Method | Path | Description |
|---|---|---|
| GET | /api/v2/export |
Export all data |
| POST | /api/v2/import |
Import data |
| GET | /api/ag-ui/events |
AG-UI SSE event stream (v1, pre-existing) |
| GET | /api/a2ui/components |
A2UI component listing |
| Path | Component | Description |
|---|---|---|
/ |
DashboardLive |
Main dashboard with project selector |
/apm-all |
AllProjectsLive |
All-projects overview grid |
/ralph |
RalphFlowchartLive |
Ralph methodology flowchart |
/skills |
SkillsLive |
Skills tracking view |
/timeline |
SessionTimelineLive |
Session timeline |
/dev/dashboard |
Phoenix LiveDashboard | (dev only) System metrics |