API reference
Source commit: e1318eca83a40b9418d873ad85c31686ea6b57d0.
Generated by scripts/docs/generate_api_reference.py; do not edit by hand.
The 237 REST registrations below follow create_api_routes in exact order, using the same route-table mechanism as the parity test. Order matters for overlapping literal and parameter paths. Implicit aiohttp HEAD routes are not counted separately; GET registrations also accept HEAD. Purpose is the first handler-docstring line; — means the handler has no docstring, not a guessed description.
Authentication and authorization
The active HTTP middleware policy requires authentication on API routes except /api/auth/login, and makes API access admin-only by default except exact method/resource pairs in SELF_SERVICE_ROUTES. The older ADMIN_ONLY_PREFIXES constant remains in the source but is not the active decision rule: _is_admin_only_path is. The table evaluates that function and follows captured route-local admin_gate helpers and wrapped handlers. “Yes + local” indicates an admin requirement with a local gate. “No” does not mean public: self-service endpoints still enforce authentication and applicable identity, session, and tool restrictions.
This describes the normal authenticated deployment. With no configured tokens (including managed tokens), authentication/admin gates allow development-mode access. HTTP API credentials may be a bearer token or server-side session credential; the HTTP middleware also accepts the historical query-token carrier. WebSockets instead use the bearer subprotocol and reject URL query tokens.
REST routes
| Method | Path | Owning module / handler source | Admin-gated | Purpose |
|---|---|---|---|---|
| POST | /api/auth/login | src.web.api.security | No | — |
| POST | /api/auth/logout | src.web.api.security | No | — |
| GET | /api/auth/session | src.web.api.security | No | — |
| GET | /api/setup/status | src.web.api.config_admin | Yes | Check whether first-boot setup is needed. |
| POST | /api/setup/complete | src.web.api.config_admin | Yes | Receive wizard data and report restart-required settings, without restarting. |
| POST | /api/setup/listener | src.web.api.config_admin | Yes | Reauthenticate a raw admin bearer and consent to web.host on next restart. |
| GET | /api/status | src.web.api.config_admin | Yes | — |
| GET | /api/discord/guilds | src.web.api.config_admin | Yes | — |
| GET | /api/discord/members | src.web.api.config_admin | Yes | — |
| PUT | /api/discord/guild/{guild_id}/config | src.web.api.config_admin | Yes | — |
| PUT | /api/discord/channel/{channel_id}/config | src.web.api.config_admin | Yes | — |
| GET | /api/health/components | src.web.api.config_admin | Yes | — |
| GET | /api/resource-usage | src.web.api.config_admin | Yes | — |
| GET | /api/tool-streams | src.web.api.config_admin | Yes | — |
| GET | /api/config | src.web.api.config_admin | Yes | — |
| GET | /api/config/meta | src.web.api.config_admin | Yes | Every configuration leaf, and how it reaches the running bot. |
| POST | /api/config/image-models | src.web.api.config_admin | Yes | Adopt shipped defaults or pin transaction-current effective strings. |
| PUT | /api/config | src.web.api.config_admin | Yes | — |
| GET | /api/discord/connection | src.web.api.discord_connection | Yes + local | — |
| POST | /api/discord/connection | src.web.api.discord_connection | Yes + local | — |
| GET | /api/discord/users/{user_id} | src.web.api.discord_identity | Yes + local | — |
| POST | /api/restart | src.web.api.config_admin | Yes + local | Cleanly restart the running process, on operator request. |
| POST | /api/sessions/clear-all | src.web.api.config_admin | Yes + local | — |
| POST | /api/reload | src.web.api.config_admin | Yes | — |
| GET | /api/personality | src.web.api.config_admin | Yes | — |
| PUT | /api/personality | src.web.api.config_admin | Yes | — |
| POST | /api/personality/presets | src.web.api.config_admin | Yes | — |
| DELETE | /api/personality/presets/{name} | src.web.api.config_admin | Yes | — |
| GET | /api/update/check | src.web.api.self_update | Yes | — |
| POST | /api/update/apply | src.web.api.self_update | Yes | — |
| POST | /api/loops/stop-all | src.web.api.self_update | Yes | — |
| POST | /api/chat | src.web.api.sessions_chat | No | — |
| POST | /api/execute | src.web.api.sessions_chat | No | Stateless prompt execution — no session history, no persistence. |
| GET | /api/computer | src.web.api.computer | Yes | — |
| POST | /api/computer/stop | src.web.api.computer | Yes | — |
| POST | /api/computer/pause | src.web.api.computer | Yes | — |
| POST | /api/computer/observe | src.web.api.computer | Yes | — |
| GET | /api/computer/evidence/{id} | src.web.api.computer | Yes | — |
| POST | /api/computer/export | src.web.api.computer | Yes | — |
| GET | /api/computer/download/{id} | src.web.api.computer | Yes | — |
| POST | /api/computer/enabled | src.web.api.computer | Yes | — |
| POST | /api/computer/recover | src.web.api.computer | Yes | — |
| POST | /api/computer/release_owned_input | src.web.api.computer | Yes | — |
| POST | /api/computer/acknowledge_legacy | src.web.api.computer | Yes | — |
| POST | /api/computer/reconcile | src.web.api.computer | Yes | — |
| GET | /api/sessions | src.web.api.sessions_chat | No | — |
| GET | /api/sessions/token-usage | src.web.api.sessions_chat | Yes + local | — |
| GET | /api/sessions/activity | src.web.api.sessions_chat | Yes + local | — |
| GET | /api/sessions/search | src.web.api.sessions_chat | No | — |
| GET | /api/sessions/{channel_id} | src.web.api.sessions_chat | No | — |
| GET | /api/sessions/{channel_id}/export | src.web.api.sessions_chat | No | — |
| DELETE | /api/sessions/{channel_id} | src.web.api.sessions_chat | No | — |
| POST | /api/sessions/clear-bulk | src.web.api.sessions_chat | Yes + local | — |
| GET | /api/tools | src.web.api.observability | Yes | — |
| GET | /api/tools/stats | src.web.api.observability | Yes | — |
| GET | /api/tools/timeouts | src.web.api.observability | Yes | — |
| PUT | /api/tools/timeouts | src.web.api.observability | Yes | — |
| GET | /api/tools/builtins | src.web.api.observability | Yes | — |
| POST | /api/tools/builtins/{name}/enabled | src.web.api.observability | Yes | Single-purpose per-tool switch (Tools panel). Mutates ONLY the |
| GET | /api/tools/bulkheads | src.web.api.observability | Yes | — |
| GET | /api/pools/ssh | src.web.api.llm_admin | Yes | — |
| GET | /api/pools/http | src.web.api.llm_admin | Yes | — |
| POST | /api/pools/ssh/close | src.web.api.llm_admin | Yes | — |
| GET | /api/usage | src.web.api.observability | Yes | — |
| GET | /api/observability/context | src.web.api.observability | Yes | — |
| GET | /api/observability/failures | src.web.api.observability | Yes | — |
| GET | /api/usage/totals | src.web.api.observability | Yes | — |
| GET | /api/trajectories | src.web.api.sessions_chat | Yes | — |
| GET | /api/trajectories/{filename} | src.web.api.sessions_chat | Yes | — |
| GET | /api/trajectories/message/{message_id} | src.web.api.sessions_chat | Yes | — |
| GET | /api/trajectories/search/query | src.web.api.sessions_chat | Yes | — |
| GET | /api/skills | src.web.api.skills_api | Yes | — |
| POST | /api/skills | src.web.api.skills_api | Yes | — |
| PUT | /api/skills/{name} | src.web.api.skills_api | Yes | — |
| POST | /api/skills/{name}/test | src.web.api.skills_api | Yes | — |
| DELETE | /api/skills/{name} | src.web.api.skills_api | Yes | — |
| GET | /api/skills/{name} | src.web.api.skills_api | Yes | — |
| POST | /api/skills/validate | src.web.api.skills_api | Yes | — |
| POST | /api/skills/{name}/enable | src.web.api.skills_api | Yes | — |
| POST | /api/skills/{name}/disable | src.web.api.skills_api | Yes | — |
| GET | /api/skills/{name}/config | src.web.api.skills_api | Yes | — |
| PUT | /api/skills/{name}/config | src.web.api.skills_api | Yes | — |
| GET | /api/mcp/servers | src.web.api.integrations | Yes | — |
| GET | /api/mcp/servers/{name}/tools | src.web.api.integrations | Yes | — |
| POST | /api/mcp/servers | src.web.api.integrations | Yes | — |
| DELETE | /api/mcp/servers/{name} | src.web.api.integrations | Yes | — |
| PUT | /api/mcp/servers/{name} | src.web.api.integrations | Yes | — |
| POST | /api/mcp/servers/{name}/reconnect | src.web.api.integrations | Yes | — |
| POST | /api/mcp/servers/{name}/refresh-tools | src.web.api.integrations | Yes | — |
| GET | /api/mcp/status | src.web.api.integrations | Yes | — |
| POST | /api/mcp/enabled | src.web.api.integrations | Yes | — |
| POST | /api/mcp/limits | src.web.api.integrations | Yes | Persist only submitted limits; publication reads them live, without reconnecting. |
| POST | /api/mcp/servers/{name}/enabled | src.web.api.integrations | Yes | Single-purpose per-server switch (panel card toggle). |
| GET | /api/grafana-alerts/status | src.web.api.integrations | Yes | — |
| GET | /api/grafana-alerts/history | src.web.api.integrations | Yes | — |
| GET | /api/grafana-alerts/rules | src.web.api.integrations | Yes | — |
| POST | /api/grafana-alerts/rules | src.web.api.integrations | Yes | — |
| DELETE | /api/grafana-alerts/rules/{rule_id} | src.web.api.integrations | Yes | — |
| GET | /api/grafana-alerts/remediations | src.web.api.integrations | Yes | — |
| GET | /api/knowledge | src.web.api.knowledge_mem | Yes | — |
| POST | /api/knowledge | src.web.api.knowledge_mem | Yes | — |
| DELETE | /api/knowledge/{source} | src.web.api.knowledge_mem | Yes | — |
| POST | /api/knowledge/{source}/reingest | src.web.api.knowledge_mem | Yes | — |
| GET | /api/knowledge/search | src.web.api.knowledge_mem | Yes | — |
| GET | /api/knowledge/{source}/chunks | src.web.api.knowledge_mem | Yes | — |
| GET | /api/knowledge/duplicates | src.web.api.knowledge_mem | Yes | — |
| POST | /api/knowledge/merge | src.web.api.knowledge_mem | Yes | — |
| GET | /api/knowledge/{source}/versions | src.web.api.knowledge_mem | Yes | — |
| GET | /api/knowledge/{source}/versions/{version:\d+} | src.web.api.knowledge_mem | Yes | — |
| POST | /api/knowledge/{source}/versions/{version:\d+}/restore | src.web.api.knowledge_mem | Yes | — |
| GET | /api/knowledge/{source}/versions/{v1:\d+}/diff/{v2:\d+} | src.web.api.knowledge_mem | Yes | — |
| POST | /api/knowledge/import | src.web.api.knowledge_mem | Yes | — |
| GET | /api/schedules/status | src.web.api.schedules_api | Yes | — |
| GET | /api/schedules | src.web.api.schedules_api | Yes | — |
| POST | /api/schedules | src.web.api.schedules_api | Yes | — |
| PUT | /api/schedules/{schedule_id} | src.web.api.schedules_api | Yes | — |
| DELETE | /api/schedules/{schedule_id} | src.web.api.schedules_api | Yes | — |
| POST | /api/schedules/{schedule_id}/run | src.web.api.schedules_api | Yes | — |
| POST | /api/schedules/{schedule_id}/reset-failures | src.web.api.schedules_api | Yes | — |
| GET | /api/schedules/history | src.web.api.schedules_api | Yes | Global schedule execution history (most recent first). |
| GET | /api/schedules/{schedule_id}/history | src.web.api.schedules_api | Yes | Execution history for a specific schedule. |
| GET | /api/schedules/{schedule_id}/stats | src.web.api.schedules_api | Yes | Summary stats for a specific schedule. |
| POST | /api/schedules/validate-cron | src.web.api.schedules_api | Yes | — |
| GET | /api/loops | src.web.api.agents_loops | Yes | — |
| GET | /api/loops/{loop_id} | src.web.api.agents_loops | Yes | Full loop configuration plus its durable iteration history. |
| POST | /api/loops | src.web.api.agents_loops | Yes | — |
| DELETE | /api/loops/{loop_id} | src.web.api.agents_loops | Yes | — |
| POST | /api/loops/{loop_id}/restart | src.web.api.agents_loops | Yes | — |
| GET | /api/agents/model | src.web.api.agents_loops | Yes | — |
| PUT | /api/agents/model | src.web.api.agents_loops | Yes | — |
| GET | /api/agents | src.web.api.agents_loops | Yes | — |
| GET | /api/agents/{agent_id} | src.web.api.agents_loops | Yes | Full record for ONE agent — the modal's source. |
| DELETE | /api/agents/{agent_id} | src.web.api.agents_loops | Yes | — |
| GET | /api/agents/{agent_id}/children | src.web.api.agents_loops | Yes | — |
| GET | /api/agents/{agent_id}/lineage | src.web.api.agents_loops | Yes | — |
| GET | /api/agents/{agent_id}/descendants | src.web.api.agents_loops | Yes | — |
| GET | /api/processes | src.web.api.agents_loops | Yes | — |
| DELETE | /api/processes/{pid} | src.web.api.agents_loops | Yes | — |
| GET | /api/audit | src.web.api.observability | Yes | — |
| GET | /api/audit/diffs | src.web.api.observability | Yes | — |
| GET | /api/audit/verify | src.web.api.observability | Yes | — |
| GET | /api/logs/search | src.web.api.observability | Yes | — |
| GET | /api/logs/stats | src.web.api.observability | Yes | — |
| GET | /api/memory | src.web.api.knowledge_mem | Yes | — |
| GET | /api/memory/{scope} | src.web.api.knowledge_mem | Yes | Every key/value in one scope, in ONE request. |
| GET | /api/memory/{scope}/{key} | src.web.api.knowledge_mem | Yes | — |
| PUT | /api/memory/{scope}/{key} | src.web.api.knowledge_mem | Yes | — |
| DELETE | /api/memory/{scope}/{key} | src.web.api.knowledge_mem | Yes | — |
| POST | /api/memory/bulk-delete | src.web.api.knowledge_mem | Yes | — |
| GET | /api/risk/stats | src.web.api.observability | Yes | — |
| GET | /api/risk/recent | src.web.api.observability | Yes | — |
| GET | /api/governor/stats | src.web.api.observability | Yes | — |
| GET | /api/audit/risk | src.web.api.observability | Yes | — |
| GET | /api/permissions/tiers | src.web.api.security | Yes | — |
| POST | /api/permissions/user/{user_id}/repair | src.web.api.security | Yes | — |
| DELETE | /api/permissions/user/{user_id}/repair | src.web.api.security | Yes | — |
| GET | /api/permissions/user/{user_id} | src.web.api.security | Yes | — |
| PUT | /api/permissions/user/{user_id} | src.web.api.security | Yes | — |
| DELETE | /api/permissions/user/{user_id} | src.web.api.security | Yes | — |
| GET | /api/codex/status | src.web.api.codex_admin | Yes | — |
| POST | /api/codex/device-code | src.web.api.codex_admin | Yes | — |
| POST | /api/codex/device-poll | src.web.api.codex_admin | Yes | — |
| POST | /api/codex/account/{index}/refresh | src.web.api.codex_admin | Yes | — |
| POST | /api/codex/account/{index}/activate | src.web.api.codex_admin | Yes | — |
| POST | /api/codex/reload | src.web.api.codex_admin | Yes | — |
| PUT | /api/codex/account/{index}/label | src.web.api.codex_admin | Yes | — |
| DELETE | /api/codex/account/{index} | src.web.api.codex_admin | Yes | — |
| GET | /api/llm/status | src.web.api.llm_admin | Yes | — |
| POST | /api/llm/switch | src.web.api.llm_admin | Yes | — |
| PUT | /api/llm/main-model | src.web.api.llm_admin | Yes | Set the main model and persist its provider derived from the ref. |
| GET | /api/llm/data | src.web.api.llm_admin | Yes | — |
| GET | /api/llm/active | src.web.api.llm_admin | Yes | — |
| PUT | /api/llm/active | src.web.api.llm_admin | Yes | — |
| PUT | /api/llm/codex/config | src.web.api.llm_admin | Yes | — |
| PUT | /api/llm/auxiliary/config | src.web.api.llm_admin | Yes | — |
| PUT | /api/llm/ollama/config | src.web.api.llm_admin | Yes | — |
| PUT | /api/openai-compatible/config | src.web.api.llm_admin | Yes | — |
| GET | /api/context/windows | src.web.api.llm_admin | Yes | — |
| POST | /api/context/windows/clear | src.web.api.llm_admin | Yes | — |
| GET | /api/ollama/status | src.web.api.llm_admin | Yes | — |
| POST | /api/ollama/reload | src.web.api.llm_admin | Yes | — |
| POST | /api/ollama/probe-models | src.web.api.llm_admin | Yes | Fetch models from an arbitrary Ollama base_url — works even when client is disabled. |
| GET | /api/ollama/models | src.web.api.llm_admin | Yes | — |
| POST | /api/ollama/model | src.web.api.llm_admin | Yes | — |
| GET | /api/openrouter/catalogue | src.web.api.llm_admin | Yes | — |
| GET | /api/openrouter/models/{author}/{slug}/endpoints | src.web.api.llm_admin | Yes | — |
| POST | /api/openrouter/models/{author}/{slug}/select | src.web.api.llm_admin | Yes | Persist a route-derived profile and optional per-model provider pin. |
| GET | /api/openai-compatible/status | src.web.api.llm_admin | Yes | — |
| POST | /api/openai-compatible/reload | src.web.api.llm_admin | Yes | — |
| GET | /api/openai-compatible/models | src.web.api.llm_admin | Yes | — |
| POST | /api/openai-compatible/model | src.web.api.llm_admin | Yes | — |
| GET | /api/openai-compatible/diagnostic | src.web.api.llm_admin | Yes | Return bounded connectivity evidence without exposing credentials. |
| GET | /api/host-access | src.web.api.security | Yes + local | — |
| PUT | /api/host-access/user/{user_id} | src.web.api.security | Yes + local | — |
| DELETE | /api/host-access/user/{user_id} | src.web.api.security | Yes + local | — |
| PUT | /api/host-access/default-policy | src.web.api.security | Yes + local | — |
| GET | /api/hosts | src.web.api.hosts | Yes + local | — |
| POST | /api/hosts/settings | src.web.api.hosts | Yes + local | — |
| GET | /api/hosts/public-key | src.web.api.hosts | Yes + local | — |
| POST | /api/hosts/candidates | src.web.api.hosts | Yes + local | — |
| POST | /api/hosts/{alias}/import-legacy | src.web.api.hosts | Yes + local | — |
| POST | /api/hosts/candidates/{token}/test | src.web.api.hosts | Yes + local | — |
| POST | /api/hosts/candidates/{token}/commit | src.web.api.hosts | Yes + local | — |
| POST | /api/hosts/{alias}/enabled | src.web.api.hosts | Yes + local | — |
| GET | /api/hosts/{alias}/references | src.web.api.hosts | Yes + local | — |
| DELETE | /api/hosts/{alias} | src.web.api.hosts | Yes + local | — |
| POST | /api/hosts/{alias}/force-revoke | src.web.api.hosts | Yes + local | — |
| GET | /api/tokens | src.web.api.security | Yes + local | — |
| DELETE | /api/tokens/unusable/{index} | src.web.api.security | Yes + local | — |
| POST | /api/tokens | src.web.api.security | Yes + local | — |
| PUT | /api/tokens/{user_id} | src.web.api.security | Yes + local | — |
| POST | /api/tokens/{user_id}/regenerate | src.web.api.security | Yes + local | — |
| DELETE | /api/tokens/{user_id} | src.web.api.security | Yes + local | — |
| GET | /api/recovery/stats | src.web.api.observability | Yes | — |
| GET | /api/recovery/recent | src.web.api.observability | Yes | — |
| GET | /api/freshness/stats | src.web.api.observability | Yes | — |
| GET | /api/freshness/recent | src.web.api.observability | Yes | — |
| GET | /api/validation/stats | src.web.api.observability | Yes | — |
| GET | /api/learned | src.web.api.knowledge_mem | Yes | — |
| DELETE | /api/learned/{key} | src.web.api.knowledge_mem | Yes | — |
| PUT | /api/learned/{key} | src.web.api.knowledge_mem | Yes | — |
| GET | /api/affordances | src.web.api.observability | Yes | — |
| GET | /api/compression/stats | src.web.api.observability | Yes | — |
| GET | /api/startup/diagnostics | src.web.api.config_admin | Yes | — |
| GET | /api/subsystems/status | src.web.api.observability | Yes | — |
| GET | /api/agent-trajectories | src.web.api.sessions_chat | Yes | — |
| GET | /api/agent-trajectories/agent/{agent_id} | src.web.api.sessions_chat | Yes | — |
| GET | /api/agent-trajectories/search/query | src.web.api.sessions_chat | Yes | — |
| GET | /api/agent-trajectories/{filename} | src.web.api.sessions_chat | Yes | — |
| GET | /api/outbound-webhooks | src.web.api.integrations | Yes | — |
| POST | /api/outbound-webhooks | src.web.api.integrations | Yes | — |
| PUT | /api/outbound-webhooks/{webhook_id} | src.web.api.integrations | Yes | — |
| DELETE | /api/outbound-webhooks/{webhook_id} | src.web.api.integrations | Yes | — |
| POST | /api/outbound-webhooks/{webhook_id}/test | src.web.api.integrations | Yes | — |
| GET | /api/outbound-webhooks/stats | src.web.api.integrations | Yes | — |
| GET | /api/turn-state/turns | src.web.api.turn_state | Yes + local | — |
| GET | /api/turn-state/capacity-breakers | src.web.api.turn_state | Yes + local | — |
Other HTTP and WebSocket routes
Registered by HealthServer and setup_websocket; these are outside the REST table, including the /api/ws upgrade endpoint. GET rows also include implicit HEAD registration. No listener is started to generate this inventory.
| Method | Path | Owning module / handler source | Registration / access | Purpose |
|---|---|---|---|---|
| GET | /health | src.health.server | HealthServer construction; no API authentication | Combined health endpoint. |
| GET | /health/live | src.health.server | HealthServer construction; no API authentication | Liveness probe — always 200 if the process is running. |
| GET | /health/ready | src.health.server | HealthServer construction; no API authentication | Readiness probe — 200 only when the bot is fully initialised. |
| GET | /metrics | src.health.server | HealthServer construction; no API authentication | Prometheus metrics endpoint. |
| POST | /webhook/gitea | src.health.server | webhooks.enabled; handler verifies webhook signature/shared secret | — |
| POST | /webhook/grafana | src.health.server | webhooks.enabled; handler verifies webhook signature/shared secret | — |
| POST | /webhook/generic | src.health.server | webhooks.enabled; handler verifies webhook signature/shared secret | — |
| POST | /webhook/github | src.health.server | webhooks.enabled; handler verifies webhook signature/shared secret | — |
| POST | /webhook/gitlab | src.health.server | webhooks.enabled; handler verifies webhook signature/shared secret | — |
| GET | / | src.health.server | web.enabled + UI directory exists; no API authentication | Redirect / to /ui/. |
| GET | /ui/{path:.*} | src.health.server | web.enabled + UI directory exists; no API authentication | Serve static UI files, defaulting to index.html for SPA routing. |
| GET | /ui | src.health.server | web.enabled + UI directory exists; no API authentication | Redirect / to /ui/. |
| GET | /api/ws | src.web.websocket | web.enabled + set_bot; authenticated, not admin-only; scoped subscriptions | Handle a WebSocket connection at /api/ws. |
Conditional registration
The constructor always registers health/metrics, independently of the WebUI and webhook switches. Webhooks are registered only when webhooks.enabled. The UI requires web.enabled and an existing UI directory: it prefers ui/dist when ui/dist/index.html exists, otherwise falls back to ui; if the selected directory is absent, no UI routes are registered. The static file handler falls back to index.html for SPA routing. HealthServer.set_bot adds all REST routes and the WebSocket only when web.enabled; constructing the server alone does not add them. There is no setup_web_api function in this source revision.
Regenerate with python scripts/docs/generate_api_reference.py; verify without writing with python scripts/docs/generate_api_reference.py --check. Generation uses mocked bot dependencies and UI existence checks, never loads runtime configuration or persisted data, and never invokes handlers.