Skip to content

Operator REST API ​

The console drives the backend over a REST control-plane under /api/* (defined in operator_api/). This is the operator surface — managing one agent and its host. For talking to the agent as a client, use the A2A endpoints (/a2a) or the OpenAI-compatible /v1 surface instead.

All /api/* routes are gated by the same bearer auth as the rest of the server (set via A2A_AUTH_TOKEN / the configured token); the console attaches it automatically. This page is a map — operator_api/*.py is the source of truth for exact request/response shapes.

Error shapes ​

Every error body is {"detail": …}, in one of three shapes:

ShapeWhen
detail: "<message>" (a string)Most routes. 400 = the request's input was refused (the message says why), 404 = the named resource doesn't exist, 409 = the subsystem isn't loaded yet (setup incomplete), 503 = the feature isn't enabled. A 500 is a fault in the server: its detail is a generic message with a short error id (Internal server error (error id 1a2b3c4d); …) — the real exception is in the server log under that id, never in the response.
detail: [{loc, msg, type, …}, …] (a list)422 — the body or query failed type validation before the route ran (FastAPI's standard shape).
detail: {code, message, upstream_status, session_id, error_id} (an object)POST /api/chat when the turn failed — see below — and POST /api/subagents/run / /batch when the model provider failed (429 / 502). A few other routes use an object {code, reason} (noted per route).

A client should read detail as: a string → show it; an object → show message (or reason); a list → show the first item's msg.

Device-scope refusals (403 device_scope) ​

A paired phone or tablet authenticates as the operator but with device scope (ADR 0121 D4): it can use the whole API except the routes that change who can get in. Those answer 403 with:

json
{"error": "device_scope",
 "detail": {"code": "device_scope",
            "reason": "This device can't change pairing or credentials — use a full-access device.",
            "action": "install a plugin"}}

The same rule applies to the proxied form of each path (/agents/<slug>/…); the hub refuses it before it swaps in the fleet credential. Refused for device scope:

MethodPath
POST/api/pairing/start · /api/pairing/cancel · /api/fleet/remotes/pair
POST · DELETE/api/pairing/tailscale/serve
POST/api/restart
PATCH · DELETE/api/devices/{id} — except the caller's own id (rename or unpair yourself). Changing scope needs a full-scope caller even for your own id
POST/api/plugins/install · /sync · /install-deps · /ack · /api/plugins/{id}/update · /api/plugins/{id}/enabled
DELETE/api/plugins/{id}
POST · PUT · PATCH · DELETE/api/plugins/bundles/…
POST/api/mcp/servers · /api/mcp/servers/import
POST · PUT · PATCH · DELETE/api/mcp/servers/… ({name}, /promote, /forget)
any/api/plugin-setup/… · /api/secrets/… · /api/config/oauth/…

A device's own routes, GET /api/devices/self, POST /api/devices/self/rotate, POST /api/devices/self/handoff and GET · PUT · DELETE /api/devices/self/push, are not on the list: rotating your own token, moving yourself to another of the agent's addresses, or storing your own push subscription changes nothing about who can get in.

Plugin lifecycle and MCP servers are on the list because each is host code the server runs: a phone that installed a plugin or added an MCP server would leave it running after its token was revoked.

Config writes are checked by key instead of by path: POST /api/settings, /api/settings/reset, /api/config and /api/config/setup answer 403 device_scope when they would write a credential-plane key, with the refused keys in keys and named in detail.reason. A write that touches no such key saves as usual.

POST /api/watches and PATCH /api/watches/{id} answer 403 device_scope when they would set a command, test or ci verifier. A watch re-runs its verifier for as long as it lives, so such a watch is a command on the host that would keep running after a revoke. Other verifiers and every other watch field are open to a device.

A 502 with a string detail comes from the fleet hub's proxy (the agent isn't up or reachable yet) and is worth retrying; a 502 with an object detail is the agent itself reporting that its model provider failed, so retrying right away won't help. The console tells the two apart this way.

Runtime & health ​

MethodPathPurpose
GET/healthzLiveness probe
GET/api/runtime/statusSetup state, model, enabled middleware, knowledge/scheduler/skills counts, code_pane: {enabled} (the console gates the code pane on it), editor_command_configured (a host filesystem.editor_command is set — never the command itself)

Chat & sessions ​

MethodPathPurpose
GET/api/conversationsOther conversations (excluding the operator's console chats and internal or private threads). Returns {conversations: [...]}; see conversation fields below. Query: group=for_you|automated, before=<ISO-8601 timestamp>, limit (default 50, clamped to 1–50). Without a valid before, lists the last seven days; before pages older activity. An unrecognized group leaves the list unfiltered.
POST/api/chatRun a non-streaming chat turn (the streaming path is A2A /a2a). Success → {response, messages, session_id}. A failed turn is a real HTTP error with the same status policy as /v1: 429 when the provider rate-limited (with Retry-After when it sent one), 502 for any other upstream failure, an unreachable gateway, or a provider that closed the stream, 503 when the turn's model connection can't be set up right now (Retry-After), 400 when the request named an unknown model, 500 otherwise. The body is {"detail": {code, message, upstream_status, session_id, error_id}}: message is the turn's own user-facing reason (the same text the transcript records); only when the server itself crashed is it replaced by a generic message carrying error_id. error_id is always logged next to the real message.
GET/api/chat/sessionsRecent server-known chat sessions, newest activity first (?limit=, max 200; ?parked=true lists only sessions whose newest turn waits on the operator). Each row: {session_id, last_updated, turn_count, last_task_id, title} plus the ADR 0130 D1 server-held state — status (idle|running|paused, derived from the task store and the turn lock, never from a client), live_task_id (the running turn's task, or the parked task awaiting the operator; null when idle), last_change_seq (bus seq of the session's newest session.changed, null when none is recorded; compare against your /api/events cursor), updated_at (zoned ISO-8601 UTC of the session's last change). title is the server-held tab title (ADR 0130 S6, null when unnamed); the list carries only OPEN sessions (a just-created, turnless one included) and a top-level closed: [session_id, …] naming the sessions whose tab the server holds CLOSED (kept retrievable, hidden on every device) so a reconciling client can drop those tabs. When the server-held list could not be read, closed is omitted (not []) and a reason is set: an empty closed would read as "nothing is closed", so the client treats its absence as "closed list unknown this read" and leaves its local tab dismissals untouched until a trustworthy read lands
POST/api/chat/sessionsS6 register a session in the server-held list (first send): {session_id, title?, created_at?} → {ok, session_id}. Idempotent — creates it, reopens a closed one, or renames on a changed title; publishes session.created/reopened/renamed
PATCH/api/chat/sessions/{id}S6 rename and/or close/reopen a tab: {title?, closed?} → {ok, session_id}. closed: true hides the tab everywhere (chat kept, not deleted; session.closed), closed: false reopens it (session.reopened), title renames it (session.renamed)
POST/api/chat/sessions/migrateS6 one-time migration of a client's device-local open tabs + titles + dismissals into the server-held list: {sessions: [{session_id, title?, created_at?, closed?}]} → {ok, migrated} (count of new rows; create-if-absent, the server copy wins after). A store failure answers 503 {detail: {code: "migrate_failed"}} so the client retries rather than latching a loss
GET/api/chat/sessions/{id}One session + its busy signal: {session_id, active, turn_count, last_updated, last_state} plus the same ADR 0130 D1 state fields as the index (status, live_task_id, last_change_seq, updated_at). active is true while a turn is running on the session from any surface (console, A2A, /api/chat); the Zed shim polls it before sending so two turns never interleave. Unknown or deleted → 404 {detail: {code: "not_found"}}
DELETE/api/chat/sessions/{id}Delete a session (?harvest=true to extract memory first; ?forget=true to remove what it already wrote to memory: its compaction archives and harvested summaries/facts; ?retire=false clears it but keeps the id). S6: drops the server-held list row and publishes session.deleted so every device removes the tab
GET/api/chat/commandsSlash-command inventory (workflows / subagents / skills)
POST/api/chat/sessions/{id}/steerEnqueue a mid-turn steering message
GET/api/chat/sessions/{id}/steerPeek pending steers
DELETE/api/chat/sessions/{id}/steer/{msg_id}Cancel a queued steer
GET/api/chat/sessions/{id}/delegationsList running subagent delegations
POST/api/chat/sessions/{id}/delegations/{del_id}/cancelCancel one delegation (lead continues)
GET/api/chat/sessions/{id}/directivesThe chat's directive ledger: {directives: [{id, session_id, quote, conditions, scope, status, created_at, closed_at, close_reason, closed_by}], in_force}, oldest first. ?status=in_force|fulfilled|revoked narrows the list (another value → 400). A chat with none answers an empty list
DELETE/api/chat/sessions/{id}/directives/{directive_id}Revoke one directive as the operator (?reason= optional) → {directive} with closed_by: "operator". 404 when this chat holds no such id (another chat's included); 409 when already fulfilled or revoked

Conversation fields ​

Each /api/conversations row carries {session_id, title, origin_label, group, last_updated, turn_count, active, last_state}. last_updated is a UTC ISO-8601 timestamp or null; active says a turn is running in that session, and last_state is the latest stored task state. title uses the stored title, then the first user message's first line, then an origin-based fallback.

origin_label is display text such as From Claude Code for Josh, Delegation from protoEngineer, From the API, or From another agent. group is for_you when caller_kind is person or on_behalf_of is set; otherwise it is automated. Rows sort by group (for_you first), then those waiting on an answer, then running, then newest activity within each bucket.

Optional caller, caller_kind (person or agent), and on_behalf_of strings come from the opening turn's stored origin. Missing fields and unrecognized caller kinds are omitted, not returned as null. These fields are for display, not authorization.

Rows with open tasks bound to their session_id also carry tasks: [{id, title, status}, …]. tasks is omitted when none are found or the task store cannot be read. Failure to read the conversation index returns {conversations: [], reason} instead of failing the request.

Goals (goal mode) ​

MethodPathPurpose
GET/api/goalsList goals across sessions
GET/api/goals/{session_id}One goal's detail — status + its durable plan artifact (plan, the .plan.md the agent maintains via update_goal_plan, ADR 0079)
POST/api/goalsSet a goal: {session_id, condition, verifier?, max_iterations?, no_progress_limit?, outcome?, constraints?, boundaries?, stop_when?, kick?}. Optional completion-contract fields (ADR 0073) + kick (default true; the console panel sends false and drives the goal from a dedicated chat tab instead of a headless turn). max_iterations is a whole number 1..1000 and no_progress_limit 1..100 (omit either for the config default); a wrong type or out-of-range value is a 422. A refused goal (missing condition, unknown verifier) is a 400
PATCH/api/goals/{session_id}Edit only supplied outcome, constraints, boundaries, stop_when, max_iterations and no_progress_limit fields. List fields also accept a single string; budget bounds match goal creation. Other keys or a budget below the current iteration return 400; unknown session returns 404; disabled goal mode returns 503
POST/api/goals/{session_id}/rearmRe-arm: extend an active goal's iteration budget (add_iterations), or reactivate a terminal one and kick a fresh drive turn
POST/api/goals/{session_id}/resumeKick a headless continuation for an active goal (used when a chat tab driving it is closed but the goal is kept running)
DELETE/api/goals/{session_id}Clear (stop) a goal. ?close_tasks=true also closes the goal's session-scoped task backlog (ADR 0079)

Subagents & tools ​

MethodPathPurpose
GET/api/subagentsRegistered subagents (allowlists, max turns)
POST/api/subagents/runRun one subagent manually. A model-provider failure is 429 (mirrored, with Retry-After when the provider sent one) or 502 (any other upstream failure or an unreachable gateway), with the object detail {code, message, upstream_status, session_id, error_id}; the same applies to /batch
POST/api/subagents/batchRun several subagents concurrently: {session_id?, tasks: [{prompt, description?, type?, subagent_type?}]}, at most 20 tasks. Every task needs a non-empty prompt — one task without it fails the whole batch with 422 (it used to run the others and report that task as an error)
GET/api/toolsWired tools (core / plugin / MCP)
GET/api/acp-agentsDetected ACP coding agents

Background jobs & scheduler ​

MethodPathPurpose
GET/api/backgroundBackground subagent jobs. ?status= must be one of running, completed, failed, canceled (else 400)
GET/api/background/{job_id}One job's full row by id (full result text; ADR 0070)
POST/api/background/{job_id}/cancel · /api/background/clearCancel one / clear finished
DELETE/api/background/{job_id}Remove a job row. Every /api/background/{job_id} route checks the id is bg-<12 hex> (else 400)
GET · POST/api/scheduler/jobsList / create scheduled jobs. A malformed schedule (not a 5-field cron expression or an ISO-8601 datetime) or timezone (not an IANA name) is a 400
PUT/api/scheduler/jobs/{job_id}Edit a job in place (partial: only the fields sent change). Unknown id → 404
DELETE/api/scheduler/jobs/{job_id}Delete a scheduled job → {canceled: true}. Unknown id → 404 (was 200 {canceled: false})
GET/api/scheduler/jobs/{job_id}/runsA job's past runs, newest first → {job_id, runs, next_cursor}, read from the scheduler's occurrences ledger. Each run has scheduled_for, state, task_state, ok and error, plus started_at (when the fire was sent), ended_at (when it settled), duration_s and reported (true = a completed run posted its result card, false = it completed with nothing to report); each of those four is null when unknown. ?limit= bounds the list (default 50, clamped to 1–200). To page past it, send the response's next_cursor back as ?before=: only runs older than that position are returned. next_cursor is an opaque string when the page came back full and null otherwise, so the page after a full one can be empty; an unreadable before → 400. Runs outlive a finished or canceled job; an id with neither a job nor a run → 404

Knowledge & skills ​

MethodPathPurpose
GET/api/knowledge/searchBrowse/search the knowledge store
POST/api/knowledge/ingestIngest a file / URL / text
POST/api/knowledge/attachAttach a chat upload (tiered inline-vs-index)
POST · PUT · DELETE/api/knowledge/chunks[/{id}]Add / edit / delete a chunk
POST/api/knowledge/delete-by-source · /api/knowledge/restore-by-sourceBulk soft-delete / restore every chunk from one ingest (reversible, grace-swept)
GET/api/playbooks · /api/playbooks/{id}List / fetch skills ("playbooks")
POST · PUT · DELETE/api/playbooks[/{id}]Create / edit / delete a skill
POST/api/playbooks/{id}/promotePromote a private skill into the commons

Memory inspector ​

The audit surface for the memory delivery layer (ADR 0069 D7): the persisted session summaries behind the <prior_sessions> digest, the hot-memory chunks (of which the newest ride each turn's injection window), and the per-turn injection record.

MethodPathPurpose
GET/api/memory/sessionsList session summaries (digest fields: id, timestamp, surface, topic, message count, size, plus in_digest: whether the session is in the current <prior_sessions> injection window)
GET · DELETE/api/memory/sessions/{session_id}Full rendered summary (what recall_session returns) / delete one
GET/api/memory/hotList hot-memory chunks (domain="hot"); each row carries injecting: whether the chunk is in the current per-turn injection window (omitted on backends without the id-attributed reader)
PUT · DELETE/api/memory/hot/{chunk_id}Edit (revision stays hot) / delete a hot chunk
GET/api/memory/injectionsPer-model-call injection records (ADR 0069 D6), newest first: which digest sessions / hot chunk ids / RAG chunk ids entered each turn, at what approximate token cost. ?session_id= filters to one session; ?limit= clamps to 1–500 (default 50)

Activity, inbox & events ​

MethodPathPurpose
GET/api/activityProvenance activity feed
GET · POST/api/inboxRead / add inbox items. POST takes text, priority (now · next · later), source, dedup_key, and deliver: "thread" folds the item into the operator's live chat at the next model call, as information only, instead of firing a turn or waiting for check_inbox (what protoagent dm sends); with it, session (a chat-… id) addresses one thread so only that chat reads it
GET/api/inbox/{item_id}One inbox item with its delivery state (delivered_at, delivered_session) and the agent's reply to a direct message (reply_text, replied_at). ?wait=<seconds> long-polls (capped at 25) and returns as soon as the agent replies; 404 for an unknown id
POST/api/inbox/{item_id}/deliverMark an inbox item handled (sets delivered_at). Despite the name it does not start a turn or run the item — it only takes the item out of the pending queue so check_inbox and the idle retry-when-free path skip it. The Work view's Dismiss uses this to clear a page without acting on it
GET/api/eventsServer-sent event stream (console live updates). Carries session.changed (ADR 0130 S2): one event per session transition — turn start/end, a HITL/decision park, a consumed steer, delete — with {session_id, status, live_task_id, reason, updated_at}, where status is idle|running|paused or deleted (event-only). Recorded in the durable change log, so a Last-Event-ID resume replays missed transitions; a client treats it as a cue to refetch the session
POST/api/events/publishPublish an event to the bus
GET · POST · PATCH · DELETE/api/tasks/...Tasks issue store (status, init, issues CRUD, close). An unknown issue id on PATCH, close or DELETE is a 404 (DELETE used to answer 200 {deleted: false}). With no task store wired, /api/tasks/status reports {initialized: false} and every other task route answers 503 "tasks not enabled"

POST /api/inbox also accepts optional origin_session (string, default "") and origin (object, default null). origin_session names the chat that caused the item; origin carries only caller, caller_kind (person or agent), and on_behalf_of. These record provenance; they do not route or authorize delivery. Use session with deliver: "thread" to address a thread.

GET /api/tasks/issues returns {issues: [...]}. Task rows include:

FieldShape and meaning
activityAdvisory driven, idle, or stalled, added only to in_progress tasks. driven means unresolved linked work or a session driver is present (or a driver source failed to read); stalled means no driver and more than 30 minutes since updated_at; otherwise idle, including an unreadable timestamp. Omitted if activity annotation fails.
askString containing the operator-facing question or action needed; empty string when unset. Set with PATCH /api/tasks/issues/{issue_id}; ask: "" clears it.
linksA JSON-encoded string, or "" when no links are stored. Decode it to [{ref, kind, state, reason}, …]: kind is card, directive, pr, job, url, or conversation; state is open or done; reason is a string. A conversation entry also carries owner, context_id, and roles (a deduped list of requester/coder/reviewer/related); its ref is conv:<owner>/<context_id>.
rel_versionInteger schema version of the row's relationship metadata — 1 on rows created with correlation/provenance recorded, 0 on legacy rows.
requestThe decoded request-correlation object the work came from, or {} when unknown. When set it carries a subset of kind (inbox or a2a), owner, context_id, message_id, task_id, item_id. Display-only provenance — never an authorization input. Server-derived; a client cannot set it.
requesterThe decoded requester-provenance object, or {} when unknown. When set it carries a subset of caller, caller_kind, on_behalf_of. Display-only, server-derived, not client-settable.

POST /api/tasks/issues and PATCH /api/tasks/issues/{issue_id} accept links as a list whose entries are either reference strings (card ids, directive ids, PR URLs, or scheduler job ids) or related-conversation objects{"kind": "conversation", "role": "requester"|"coder"|"reviewer"|"related", "owner": "<agent name>", "context_id": "<chat context>"}. On PATCH, the list replaces the references while preserving the resolution of retained references (and the roles of a retained conversation); [] clears it, and omitted or null leaves it unchanged. request, requester, and promotion_key are server-derived only — sending them in the body is ignored. Create and update return {issue: {...}}.

A conversation link is accepted only when its owner is this agent's own name and its context_id is one of this agent's own conversations (a context present in its A2A task store) that is not a server/execution context (job:, background:, system:, palette-). A link with a forged owner, an unknown context_id, a server context, or another agent's equal context string is rejected with 403 and nothing is written (no partial link list is stored). The owner/context_id is provenance for Work to display later; it never grants read access to that conversation.

Config, setup & settings ​

MethodPathPurpose
GET · POST/api/configRead / write langgraph-config.yaml (+ SOUL)
GET/api/config/setup-statusWizard state
POST/api/config/setup · /api/config/reset-setupComplete / reset the setup wizard
GET/api/config/presets/{name}A SOUL/archetype preset
POST/api/config/models · /api/config/test-modelList gateway models / test the connection
GET/api/settings/schemaSettings UI schema
POST/api/settings · /api/settings/resetApply / reset settings
GET/api/operationsThe ops-layer catalog — every operation (name, read/write, summary); mirrors protoagent operations (ADR 0075 D2)

Files & code pane ​

Read-only. browse is the settings folder picker and deliberately reaches outside the fs fence (names only, never contents). The other three stay inside it — the same registry.resolve chokepoint read_file uses (ADR 0007) — and file/diff never return a secret-like file's content (ADR 0112).

MethodPathPurpose
GET/api/fs/browseList the server's directories for a path picker (?path=&files=&hidden=)
GET/api/fs/roots{roots: {project: absolute root}} — the live fs fence
GET/api/fs/fileCode pane toolset only (filesystem.code_pane, default off — otherwise 404 {code: "disabled"}). ?project=&path=[&start=&end=] → {project, path, size, line_count, start, end, truncated, language, binary, text}. Lines are \n-delimited, endings preserved; capped at 2 MB / 20,000 lines / 2,000 chars per line (truncated: true, page with start=end+1). Binary → text: null. Errors carry detail: {code, reason}: bad_path 400 (unknown project / fence escape), denied 403 (secret-like name, checked before existence), not_found 404, not_a_file / bad_range (also a non-integer start/end) / unreadable 400
GET/api/fs/diffCode pane toolset only (off → 404 {code: "disabled"}). ?project= → the working tree vs HEAD: {project, is_git, head, branch, files: [{path, status: M|A|D|R|?, additions, deletions, binary, denied, old_path?, reason?, too_large?}], patch, truncated}. Hardened git (no external diff, textconv, filter, fsmonitor, hook or submodule recursion can run), scoped to the project root, untracked text files ≤ 256 KB as synthetic new-file patches, secret-like paths — and symlinks resolving outside the project or onto one — listed denied (with a reason) and content omitted, larger untracked files flagged too_large, patch capped at 1 MB and the file list at 5,000 entries (truncated: true). Not a repo → {is_git: false, files: [], patch: ""}; 10 s timeout → 504
POST/api/fs/open-in-editorBody {project, path, line?} → {ok, editor}: opens the fenced file in the host's filesystem.editor_command (the agent's open_in_editor, for the console's "Open in editor" fallback). Only for a console on the server's own machine — loopback peer and a loopback/desktop Origin — else 403 not_local. No editor command → 404 disabled; fence escape → 400 bad_path; secret-like name → 403 denied (before existence); not_found 404; not_a_file / bad_line / bad_request 400; a missing or failing editor CLI → 502 launch_failed. /api/runtime/status editor_command_configured says whether one is set (never the command)

Editor hand-off ​

Continue a console chat in Zed's agent panel. Zed can't deep-link into an agent thread, so the console (Continue in Zed) or open_in_editor offers the session and the protoagent-acp shim claims it when the operator starts a thread. In memory, per instance; one offer per project root (latest wins) and one per chat (a new offer for a chat replaces its older ones under every root; a claim removes them all), 120 s TTL, one-shot.

MethodPathPurpose
POST/api/editor/handoffBody {session_id, project?, path?, line?, title?} → {id, expires_at, root}. project resolves through the fs fence to its root; omitted → root: null, which matches any folder. Unknown session → 404 not_found; a project outside the fence → 400 unknown_project; a path escaping it → 400 bad_path; a missing session_id, a path without a project, or a line that isn't a positive integer → 400 bad_request
POST/api/editor/handoff/claimBody {cwd} → 200 {session_id, project, path, line, title} (and the offer is removed) or 204. Matches when cwd is the root, inside it, or a parent of it at most 3 levels up; the newest unexpired match wins. A filesystem/volume root (/) never matches, and the home directory itself never matches a project offer (only a project-less one)

Fleet & agents ​

MethodPathPurpose
GET · POST/api/fleetList / create workspace agents
PATCH · DELETE/api/fleet/{name}Rename / remove an agent
POST/api/fleet/{name}/{start,stop,activate} · /api/fleet/downLifecycle control
GET/api/fleet/discoverDiscover agents (LAN mDNS + tailnet)
POST · DELETE/api/fleet/remotes[/{ident}]Register / remove a remote member
POST/api/pairing/start · /api/pairing/cancelMint a phone (default) or agent ({"kind": "agent"}) pairing code with the addresses it works on, best first (hosts[].via: serve → magicdns → ip), plus reach (Tailscale status, restart facts) / drop pending codes of that kind (ADR 0087, ADR 0113). 409 when nothing is reachable yet
POST/api/pairing/claimRedeem a code for a per-device token ({code, name} → {ok, device, token, moved, addresses}, Cache-Control: no-store). addresses is the phone's address set (absent for an agent code). moved is true for a handoff code: it rebinds the device that minted it, with the same id, name and scope and a new token, instead of adding a device. The only unauthenticated /api/* route; one 403 for every bad code. 429 with Retry-After (seconds) and {ok: false, error, retry_after} when the claim throttle is empty (5 wrong codes per client per 5 min, 30 per ingress class per min; ADR 0121 D3). A 429 claim is never compared with any code, and no claim cancels a pending code
GET/api/devicesPaired devices and hubs: id, name, kind, scope (full or device, ADR 0121 D4; agents are always full), created_at, last_seen_at, active (used within the last-seen write throttle, about 6 minutes), expired and expires_at (idle expiry, ADR 0121 D5: expires_at is epoch seconds, or null for a device that never expires), and rotated_at. Never the token or its hash. caller is the credential that asked: {scope, device_id} (device_id is null unless a device token was used)
PATCH/api/devices/{id}Rename ({name}: 1–64 printable characters on one line) and/or promote or limit ({scope: "full" | "device"}). Changing scope needs a full-scope caller (403 device_scope otherwise, so a phone can't promote itself); limiting an agent is a 400. 400 with the reason for an unusable name or scope, 404 for an unknown id. The token is untouched
DELETE/api/devices/{id}Revoke one device; its token stops working on the next request, and its open streams close within one keepalive
GET/api/devices/selfThe caller's own device (ADR 0121 D5): {device: {id, name, kind, scope, created_at, last_seen_at, active, expired, expires_at, rotated_at, rotate_due, handed_off}, addresses}. rotate_due is true for a device-scope token 7 days after its last rotation (or its pairing). handed_off is true when the presented token was handed off to another address and the new address has used its token: the caller should forget the token. addresses is the address set. A credential that isn't a paired device (the auth token, X-API-Key, open mode) gets 200 {"device": null}, which a client can tell apart from an older server's 404
POST/api/devices/self/rotateA new token for the caller's device, returned once: {ok, device, token} with Cache-Control: no-store. The presented token stays valid until the new one is first used, then for 120 seconds; presented after that, it revokes the device and writes a device.revoked_token_reuse audit entry. 409 rotation_in_progress when the presented token is the previous one and an unused rotation is under two minutes old (keep the stored token); 409 not_rotatable for a previous token whose successor is already in use, or a full-access device (only Limited tokens rotate); 404 not_a_device (and no token) for a non-device credential
POST/api/devices/self/handoffMove the caller's device to another of this agent's addresses (ADR 0121 D1). {origin} → {ok, code, expires_at, ttl, origin, url} with Cache-Control: no-store: a 60-second, single-use code in the pairing-code format, bound to the caller's device, and url = <origin>/app/#pair=<code>. origin must equal one of the address set's origins after normalisation (scheme and host lowercased, default port and one trailing / dropped); anything else is 400 origin_not_offered, and url is always built from the offered origin. A newer handoff replaces the device's pending one. Claiming the code rotates the device's token: the old token stays valid until the new one is first used, then for 120 seconds, then is refused without revoking the device. 404 not_a_device for a credential that isn't a paired device; 409 not_movable for an agent pairing, an expired device, or a token already rotated out
GET/api/devices/self/pushPush enrollment for the caller's own device (ADR 0135 W2): {ok, public_key, version, binding, renew} with Cache-Control: no-store. public_key is this agent's active VAPID public key (unpadded base64url, the applicationServerKey for PushManager.subscribe) and version its keyring version; the keyring is generated on first use. binding is the caller's stored subscription as safe status only, {vapid_version, generation, created_at, renewed_at}, or null; generation also rises when the device's token is rotated. renew is why this agent removed the caller's subscription, or null: vapid_key (its key version was retired or left its 30-day migration window), handoff (the device moved to another origin, which enrolls its own) or idle; the console subscribes again and PUTs the result. Paired phones and browsers only: the device is the one the caller's token resolves to, and any other credential (the auth token, X-API-Key, an agent pairing, open mode) is 403 not_a_device. 503 push_keyring_unavailable when the keyring is corrupt, or missing while devices are enrolled
PUT/api/devices/self/pushStore or renew the caller's own push subscription on its device record: {endpoint, keys: {p256dh, auth}, vapid_version} (a browser PushSubscription's JSON plus the version it subscribed under) → {ok, binding}. The same subscription again is a renewal (new renewed_at); a different one replaces it and raises generation. One subscription per device, and no route addresses another device's. 400 invalid_endpoint unless the endpoint is an https URL on a supported Apple, Google or Mozilla push host that resolves to public addresses; 400 invalid_keys unless p256dh is a valid P-256 point and auth is 16 bytes; 409 stale_vapid_version unless vapid_version is the active key or a rotated-out one still inside its 30-day window; 409 endpoint_in_use when another device holds the endpoint; 409 not_enrollable for an expired device or a token the device has already replaced (in its rotation or handoff grace); 403 not_a_device as for GET. A refusal stores nothing. The endpoint and keys are never returned by this or any other route. Unpairing the device deletes its subscription with it
DELETE/api/devices/self/pushDelete the caller's own push subscription: {ok, removed} (removed is false when there was none). Same caller rules as PUT
POST/api/fleet/noticesA fleet member hands its hub a notice for the operator's devices (ADR 0135 W2): {member, notice_id, kind, importance, created_at, expires_at} → {ok, queued}. The notice's identity only: no text and no link cross. The hub raises it through its own notice path under its own wording (A notice from <member>), so it is published on the hub's /api/events stream as a notice event and queued to every notice adapter the hub runs, the push ledger included. A routine notice held by the hub's quiet hours is still accepted (queued true) but reaches neither the stream nor an adapter until the hub's digest. The hub remembers which member raised it until the notice expires. queued is false when this agent runs no push sender. Accepted from the fleet service token only (403 not_a_member otherwise, including in open mode). 400 invalid_notice for a member this hub does not run or a malformed notice; a member can shorten a notice's lifetime, never extend it. A full push ledger is logged by the hub and no longer fails the handoff (the member does not retry)
GET/api/notices/{id}Which agent raised a notice: {ok, agent} with Cache-Control: no-store. agent is the member's id for a notice a member handed over, and null for this agent's own or one it no longer remembers. The console reads it after a notification is clicked, because the push payload names no agent, and opens the decision in that agent's console
GET/api/homeThis instance's Home chat (ADR 0135 D9): {session_id, last_read_at} with Cache-Control: no-store. session_id is generated once, stored in instance state and never changes; it is shaped chat-home-…, so Home is an ordinary operator chat. last_read_at is ISO-8601 UTC, or null before the first read. Also adds Home to the chat session list when it is not there. 404 while the home_conversation developer flag is off (the default); 503 when instance state cannot be read
GET/api/home/entriesThe briefs, alerts and decision pointers the server wrote into Home's thread: {session_id, entries: [{id, content, additional_kwargs: {protoagent_home_entry: {kind, importance, source, notice_id}, protoagent_sent_at}}]} with Cache-Control: no-store. Read from Home's checkpoint (they are not A2A turns), oldest first, bounded to the newest 200. 404 while the home_conversation developer flag is off; 503 when instance state, the graph or the checkpoint cannot be read — a client keeps its last good copy
POST/api/home/readMark Home read now: sets last_read_at and returns the same {session_id, last_read_at}. 404 while the home_conversation developer flag is off
GET/api/pairing/reachHow this agent can be reached: bind, listening port, offered and bindable addresses, auth_configured, tailscale (dns_name, https, served), restart (supported, bind_pinned, container, pending, hint)
POST · DELETE/api/pairing/tailscale/serveServe this agent over tailnet HTTPS with tailscale serve --bg / turn off only its own handler. POST is 409 no_token until an auth token is set; 409 https_disabled carries enable_url
POST/api/restartGraceful self-restart: drain, then re-exec with the same command line (202)
POST/api/fleet/remotes/pairPair with a remote by claiming a code minted on it ({url, code, name?}); stores the per-device token, adds or re-tokens the member (ADR 0113)
GET/api/archetypesStarter agent types (catalog + installed bundles); ?include_held=1 adds the catalog's held preview entries (held: true)
GET/api/archetypes/{id}/previewPeek a bundle archetype's members/MCP/secrets before install
GET/api/archetypes/from-url?url=&ref=Peek an uncatalogued bundle by git URL (+ optional ref): its archetype row, the bundle peek, and whether the source is trusted

Device address set ​

A phone's claim and GET /api/devices/self carry addresses: the origins this agent offers right now, best first, in the order /api/pairing/start lists its hosts (ADR 0121 D1).

kindExample originrequirement
tailnet_httpshttps://box.tail1234.ts.nettailscale (omitted when Tailscale Funnel makes it public)
publichttps://console.example.comnone. Present only when network.public_console_url is set
tailnethttp://box.tail1234.ts.net:7870, http://100.64.0.5:7870tailscale
lanhttp://192.168.1.20:7870same_network

Every entry is an origin (scheme://host[:port]). The only public origin is the declared network.public_console_url; discovered addresses are tailnet or private only. The console keeps the set beside the device token for its offline notice and Move this phone to….

Plugins & MCP ​

MethodPathPurpose
GET/api/plugins/installed · /api/plugins/catalog · /api/plugins/updatesInstalled / host catalog / available updates
POST/api/plugins/install · /api/plugins/syncInstall from git URL / re-sync from lock
POST/api/plugins/{id}/enabled · /api/plugins/{id}/updateEnable-disable / update one
DELETE/api/plugins/{id}Uninstall
POST/api/mcp/servers · /api/mcp/servers/importAdd / import an MCP server
DELETE/api/mcp/servers/{name}Remove an MCP server
GET/api/mcp/catalog · /api/mcp/exposedCurated server catalog / operator-MCP tools this instance exposes (effective allowlist + profile)

Telemetry & theme ​

MethodPathPurpose
GET/api/telemetry/{summary,recent,export,insights}Cost/usage telemetry
GET/api/telemetry/tools?since=7dOperator-only tool usage: {enabled, since, tools}. Each tool has tool, calls, errors, error_rate (fraction), p50_ms, and p95_ms. Optional since accepts an ISO date/time or a relative window such as 7d; omitted means all retained calls. Invalid cutoffs return 422; a disabled store returns enabled: false and an empty tool list.
GET/api/usage/fleetOperator-only subscription usage, deduplicated by account_key; each account lists its member slugs and members reports reachability. The host reads its usual usage store; peers supply cached snapshots over the fleet proxy with paired bearers. Host snapshots take precedence. Member reads never poll (/api/usage?cache_only=true); cold caches report unknown and stale caches retain last-known windows. Unreachable peers do not fail the rollup.
GET/api/telemetry/llm-lanesModel in-flight-limiter lane snapshot (ADR 0115)
POST · GET/api/feedbackPer-turn thumbs rating + Langfuse user_feedback score (ADR 0126 E2/D3)
GET · PUT · DELETE/api/themeRead / set / clear the saved theme

/api/feedback (ADR 0126, operator-tier, same auth as its telemetry neighbours) records a thumbs up/down on one assistant turn. POST takes {session_id, trace_id?, value: 1|0|null, note?, incognito?}: it stores the rating in the telemetry store's feedback table (keyed by session_id + trace_id) and, when trace_id is present and tracing is live, mirrors it to Langfuse as a user_feedback score on that turn's past trace — pinned to a deterministic score id, so a second rating on the same turn replaces the first in both places rather than stacking. value: null un-rates: it deletes the local row and the mirrored Langfuse score. An incognito session is refused 409 and nothing is stored or scored; a request with no trace_id (tracing was off for that turn) is stored locally but not scored (scored: false). GET /api/feedback?session_id= returns {enabled, tracing_enabled, turns: [{task_id, trace_id, created_at, rating, note}]} — one entry per recorded turn leg, oldest first — so the console can map a rendered assistant message back to its trace (by task_id, else by turn order) and show which turns it has already rated.

GET /api/telemetry/llm-lanes (operator-tier, same auth as its neighbours) returns the per-lane state of the model in-flight limiter (ADR 0115, see Operate the model in-flight limiter). It reads the per-process limiter snapshot straight from memory — no network or DB call — so it is cheap enough to poll every tick. When the limiter is off (model.max_inflight: 0, the default) it returns {"enabled": false}. When on:

json
{"enabled": true, "generated_at": "2026-09-28T17:04:11+00:00",
 "lanes": [{"lane": "https://gw/v1|protolabs/smart", "limit": 6, "reserve": 1,
            "inflight": 6, "queued": 9,
            "queued_by_priority": {"interactive": 0, "default": 2, "bulk": 7},
            "oldest_wait_s": 212.4, "wait_p50_s_5m": 38.0, "wait_p90_s_5m": 171.0,
            "queue_timeouts_5m": 2, "saturated": true}]}

One entry per lane this process has touched. saturated is true when queued > 0 has held continuously for 60 s or more; the percentiles and queue_timeouts_5m cover a rolling 5-minute window. The same snapshot is available in-process to plugins via sdk.llm_lanes().

Diagnostics ​

Member-local, read-only reads for inspecting a fleet member without shell access (#3168). Served on every member, so the hub reaches a local peer and a registered remote alike via /agents/{slug}/api/diagnostics/....

MethodPathPurpose
GET/api/diagnostics/logs?lines=NBounded tail of this member's log ring. lines is clamped (1–1000, default 200) rather than rejected; the response carries note when it was adjusted.
GET/api/diagnostics/tasks/{task_id}One exact A2A task: state, status_message, history, artifacts, accumulated_text, context_id, last_updated.

Diagnostics output is sensitive operator data — logs and task rows can carry prompts, user content, and tool arguments. Both endpoints are operator-tier (the ADR 0066 federation credential is denied /api outright), read-only, bounded in history/artifact/text size, and scrubbed by the shared credential redactor before returning.

Responses degrade rather than 500: an unknown task is 404, a member with no task store is 503, and a malformed store row returns 200 with the unparseable columns named in malformed[]. A stopped or unreachable member is the proxy's case and answers 409/502/504 from /agents/{slug}/*. Truncation is always reported in truncated[] — a partial history is never presented as a complete one.

The log source is an in-process ring buffer sized by LOG_BUFFER_LINES, not agent.log; see environment variables for why.

Part of the protoLabs autonomous development studio.