Skip to content

HTTP API reference

The daemon listens on http://127.0.0.1:8080 by default and, on loopback with no configured credentials, requires its per-daemon local API token (see below). JSON errors generally use { "error": "message" }. The router in axocoatl-server/src/lib.rs and handler Serde types remain authoritative; there is not yet a generated OpenAPI document.

The docs content check compares every literal router path with this page and the WebSocket reference.

Every workbench and control-router route that reads or changes state requires a credential. The dedicated Preview virtual Host is intercepted before that router and is constrained separately by its exact Session/port Host and browser-origin boundary.

Local token (default). On a loopback listener with no server.auth credentials, the credential is the per-daemon token in the data root’s local-api-token file. Send it in one of three forms:

Authorization: Bearer <token>
x-api-key: <token>
Cookie: axocoatl-token-<port>=<token>

Browsers get the cookie by opening the sign-in link that axocoatl dev, axocoatl serve, or axocoatl url prints. GET /?token=<token> answers 303 See Other to the same path and query without token, sets the cookie (HttpOnly, SameSite=Strict, Path=/, Max-Age=2592000) and a secret-free axocoatl-token-<port>-signed-in=1 (HttpOnly, SameSite=Lax, same path and age), and sends Referrer-Policy: no-referrer and Cache-Control: no-store. A wrong token, or / without a credential, returns 401 with a short sign-in page. One exception: a GET / on 127.0.0.1 without ?token= and without a valid credential, marked Sec-Fetch-Site: none and Sec-Fetch-Mode: navigate with Sec-Fetch-Dest: document or no Sec-Fetch-Dest, that carries axocoatl-token-<port>-signed-in=1 (Safari after the redirect from localhost, or a token cookie from before the token changed) returns 200 with a page that opens the same address again from its own origin and clears the signed-in cookie. The token cookie is ignored on requests marked Sec-Fetch-Site: cross-site or same-site; the signed-in cookie is never a credential. The Cookie header is read as bytes, and a request carrying several axocoatl-token-<port> cookies is accepted when any of them holds the token, so neither a cookie that is not ASCII nor a forged cookie of the same name hides the real one. Public paths in this mode: /health, /health/ready, /health/live, /ui/*, /vendor/*, /lattice/*, /brand/*, /axo-tap.js, and the sign-in page at /. server.auth.allow_unauthenticated: true turns the token off but keeps the Host check described below.

Configured credentials. With server.auth.api_keys or bearer_tokens, send one of:

x-api-key: <key>
Authorization: Bearer <token>

Only the health probes are public, there is no sign-in cookie, and an empty configured value never matches. All comparisons are constant time.

Checks run in this order: an unexpected Host (421), a disallowed browser origin (403), then the credential (401). An empty server.cors_origins allows same-origin workbench requests only. Browser writes and WebSockets with an opaque Origin: null are always rejected; other cross-origin browser writes require an explicitly allowed origin. On a loopback listener without configured credentials, including with allow_unauthenticated, a Host other than localhost or a loopback IP literal is rejected to prevent DNS rebinding. Origin-less CLI clients remain supported. Cross-origin preflight for the control router advertises HEAD, GET, POST, PUT, PATCH, and DELETE. Control-router rate limiting is disabled by default and applies per client IP when enabled; Preview traffic stays outside that middleware.

Preview applications use a separate virtual origin shaped like <session>-p<port>.localhost:<listener-port>. That Host is intercepted before the workbench router, so no /api, /ws, app-shell, or static-asset path can fall through to the control origin. Each Session and logical port has its own browser storage/cookie origin. Modern browsers can block ordinary app cookies while that origin is embedded; the workbench’s Open full preview action opens the same virtual URL top-level with noopener, where host-only cookies work without becoming shared sibling cookies. Safari on macOS also lets a top-level page’s script on a *.localhost address set a Domain=localhost cookie, and sends it to every Preview and every other localhost address (never to the workbench, which is served at 127.0.0.1), so in Safari a Preview never runs top-level: the daemon answers a request for a Preview page Safari would show in a tab or window of its own with 403 and a page that says why, and the workbench keeps Previews embedded and offers no Open full preview (Security). With the local token, a browser GET or HEAD for the exact / workbench document on localhost or a loopback IP literal other than 127.0.0.1 answers 307 Temporary Redirect to 127.0.0.1 on the same listener and preserves the query; from localhost it also removes this daemon’s two sign-in cookies there (Max-Age=0), where sign-in links before 1.5.0 stored them. API, health, and asset URLs do not redirect. With configured credentials or allow_unauthenticated there is no sign-in cookie and no redirect: / is served at the loopback name the request used, so a proxy on the same host may send Host: localhost or Host: 127.0.0.1.

MethodPathPurpose
GET/Embedded Session-first workbench; the only interactive browser destination. With the local token: the sign-in redirect for ?token=, and the sign-in page without a credential
GET/ui/{*file}Embedded UI modules and styles (public with the local token)
GET/vendor/{*file}Vendored Monaco, xterm, highlighting, fonts, and icons (public with the local token)
GET/lattice/{file}Lattice web-component assets (public with the local token)
GET/brand/{file}Canonical brand assets (public with the local token)
GET/.axocoatl/preview-picker.js on a Preview HostPicker bridge for the dedicated Preview origin; communication is limited to source-and-origin-validated postMessage events
GET/axo-tap.jsCompatibility picker asset for the response-sandboxed legacy proxy (public with the local token)
GET/healthOverall status, Agent count, the running Axocoatl’s version and started_at_ms, when this daemon started, before it read its configuration (Unix milliseconds) (public)
GET/health/ready200 when at least one Agent is spawned, otherwise 503 (public)
GET/health/liveLiveness probe (public)
MethodPathRequest / behavior
GET/api/llm-healthOllama-only reachability and missing-model summary
GET/api/readinessWhat the first Session needs, checked as axocoatl doctor checks it: {ready, version, sessions_blocked, sections: {sandbox, models, writers, daemon}}, each item {id, name, status, detail, fix} with status ok, warn or fail. ready is true when nothing fails; a stopped Podman machine is ok because a Session starts it. sessions_blocked says why no Session can be created yet (Podman not installed, or no machine). Nothing on the machine changes
GET/api/llm/models?agent=<id>Live Ollama list; curated hosted lists; current Agent model is always included
GET/api/agentsConfig projection for every Agent; live status is separate
GET/api/agents/{agent_id}/statusCurrent actor status
POST/api/agents/{agent_id}/execute{input, system_override?, model_override?, stateless?}; waits for output and returns input/output/reasoning/total tokens plus token_usage_known
POST/api/agents/{agent_id}/restartRestart from current in-memory config and latest checkpoint
PATCH/api/agents/{agent_id}Temporary in-memory name/model/prompt/dependency/budget patch; defaults to restart
GET/api/tokens/reportPer-Agent and total runtime token counts

An execute override implies stateless execution. Agent PATCH does not update YAML. /api/agents does not make one status request per Agent; consumers that need liveness must call the status route. Stateless execution performs one provider inference, advertises no tools, and does not enter a tool loop. An execution error carries the same token fields. A false known flag marks the numeric value as a known subtotal rather than an exact total.

These routes resolve the Workspace through its owning Session. Human edits name the expected note revision; stale revisions are conflicts. The full inspector workflow is documented in Workspace knowledge.

MethodPathRequest / behavior
GET/api/sessions/{id}/knowledgeNotes, proposals, source index and freshness; optional q search
POST/api/sessions/{id}/knowledgeCreate a note with expected_revision: 0
PUT/api/sessions/{id}/knowledge/{note_id}Edit this exact note with its recorded expected_revision
POST/api/sessions/{id}/knowledge/indexRefresh the observed source index
GET/api/sessions/{id}/knowledge/exportDownload accepted knowledge as Markdown; note_id selects one round-trippable note
POST/api/sessions/{id}/knowledge/import-preview{markdown}; validate one exported note and return an edit for explicit review/save
POST/api/sessions/{id}/knowledge/{note_id}/attachAttach the selected expected_revision to Session context
POST/api/sessions/{id}/knowledge/proposals/{proposal_id}/acceptExplicitly accept the proposal at its expected_revision
POST/api/sessions/{id}/knowledge/proposals/{proposal_id}/rejectRetain an explicit rejection

Note edits include id, title, body, kind, expected_revision, links, and sources. Links contain a kind and target note ID. Sources contain a repository path, sha256, and optional symbol. Model provenance is assigned by the host; an API payload cannot claim an arbitrary accepted activation as its origin.

These routes use the same authenticated Session owner as ordinary Send. A preview is read-only; Apply binds the reviewed request and exact revisions. Retrying an uncertain reply must reuse that request unchanged. Stale revisions are conflicts, not permission to choose another activation or team.

MethodPathRequest / behavior
GET/api/sessions/{id}/teamCurrent team revision, selected templates, explicit limits, and expiry. required_checks lists the applied team’s checks; suggested_check is the Session’s detected check command as an argument array, offered only and never run unless an Apply includes it. required_review is the applied team’s review setting, when it has one, and reviewers lists the templates that may review: read-only Workers. warnings lists warnings about the applied team, such as {"code": "same_model_reviewer", "message": …} when the required reviewer runs a writer’s provider and model. suggested_budget is {from, agent, helper, free_providers, expires_in_ms}: the limits the app fills in for an Agent or a helper that has none yet, from the built-in fix loadout (cost_microunits is 0 for a model of a provider in free_providers), and how long such a budget lasts (expires_in_ms, 24 hours): the app sets the expiry to that long after it fills the Agent in, so two reads of the same team are equal; it approves nothing
POST/api/sessions/{id}/team/previewTyped whole-team edit; resolves and reviews future-turn definitions and authority. The review’s changes give each Agent’s kind (added, retained, replaced or removed; saved when the Apply was already saved) and its history (preserved, new conversation, or retained in history for a removed Agent). observed_again, present when not empty, lists {slot_id, helper?, reason} for each Agent, or helper (helper names its Worker template), kept as it was whose model is observed again because its retained provider profile can no longer serve: an Ollama profile recorded on Ollama 0.20.6, at another endpoint than providers.ollama.base_url names now, or for a model pulled again or with other capabilities since; an OpenRouter profile whose endpoint lists other terms (a price, a limit, its parameters) or can no longer be used while another endpoint serves the model. Such an Agent starts a new conversation. A slot’s writes is the whole list of paths that Agent may change: null allows any file and [] is read-only. Leaving it out keeps the scope of the template or current definition the slot starts from, so omitting it never widens what the Agent may change; the app always sends it. The edit’s optional required_checks is an array of argument arrays, such as [["sh", "-c", "npm test"]], that the host runs after every turn’s required Agents finish; it is refused when no required Agent has bash. The optional check_options is aligned by index with required_checks, one {name?, timeout_ms?, report?, egress?} per check or none at all: timeout_ms is 1,000 to 1,800,000 (180,000 when omitted), egress: true gives the check’s process its own egress credential under network: egress (an e2e check sets it; other checks have no network there), and report is {format, path}, with format junit or e2e_report_json and path under /tmp/axocoatl-check-reports/; a loadout run reads it for its e2e checks and parses it into the run’s Outcome, bound to the check’s run by the digest it prints (see The e2e check), and a workbench turn does not read it. The optional required_review is {"template_id", "max_rounds", "limits", "max_output_tokens"}: a read-only Worker template the host runs after every turn’s required Agents and checks, 1 to 3 rounds (2 when omitted), the reviewer’s limits for all rounds of one turn, and its output bound per request (the template’s when omitted). An edit whose limits cannot pay for what it names (a missing or zero limit, a missing or past expiry or one more than a year away, a token limit below what a turn of that Agent reserves (one model call, and with tools a call and the one after it, named in tokens with the model’s context and output), a helper over its lead’s limits, review rounds outside 1 to 3, or a check payer, reviewer or lead budget too small for its rounds) is refused with 422 and the reason alone; a stale configuration revision is 409. A refusal from a native provider check (a model or an Ollama version native Sessions refuse, a Team to review again after an Ollama upgrade) is a 422 too and carries that check’s message alone, without the internal “Provider setup failed: Session dispatch: Invalid request for ollama:” layers
POST/api/sessions/{id}/team/apply{edit, review_digest}; exact reviewed future-turn edit
POST/api/sessions/{id}/team/cancelCancel the referenced team draft without changing current authority
POST/api/sessions/{id}/turns/{turn_id}/control-commandsTyped human action with exact command/activation/revision identities; returns the canonical receipt
POST/api/sessions/{id}/turns/{turn_id}/graph-edits/previewReview AddAgent or ReplaceFutureAgent against the exact graph revision. The new work starts from one of the Session team’s Agents (agent.source_slot_id) or a configured template (agent.template_id), exactly one of the two, and keeps what that Agent may change; agent.writes may only narrow it
POST/api/sessions/{id}/turns/{turn_id}/graph-edits/applyApply the original reviewed graph edit and digest
GET/api/sessions/{id}/turns/{turn_id}/grants{grants, proposals}: each grant’s policy, authority_revision, revoked_at_revision and cumulative usage (activations, invocations, tokens, cost_microunits charged so far: a running call’s reservation, then what the settled call reported), and retained expansion proposals
POST/api/sessions/{id}/turns/{turn_id}/grants/previewExplicit total limits, expiry, delegated operations, graph bounds, and reason
POST/api/sessions/{id}/turns/{turn_id}/grants/decide{request, review_digest, approve, reason}; exact approval or decline
POST/api/sessions/{id}/turns/{turn_id}/grants/revoke{grant_id, expected_grant_revision}; closes new dispatch without undoing started effects
GET/api/sessions/{id}/ways-historyRetention limits, retained decision records, and deletion tombstones
POST/api/sessions/{id}/ways-history/configuration{limits: {version, field_bytes, record_bytes, aggregate_bytes, records, candidates, items_per_field}}; every numerical limit is explicit
GET/api/sessions/{id}/ways-history/{decision}Export the retained record and protected patch bodies
DELETE/api/sessions/{id}/ways-history/{decision}Explicit deletion after runtime cleanup; retains a tombstone

Loadouts and the runs axocoatl run starts. Errors are {"error": "…"}: 404 for an unknown loadout or run, 422 for a usage error (a loadout file that cannot be used, a missing or unknown parameter, a QA URL the browser cannot reach), 409 for a conflict, 501 for a part this build does not implement, 400 otherwise, including a host that cannot run the Session under egress with the hardened workload. When another run or Session’s turn holds the repository’s Workspace, POST /api/runs answers 409 at once with "code": "workspace_busy" beside error, which names that Session and turn; axocoatl run exits 7.

MethodPathRequest / behavior
GET/api/loadoutsEvery built-in and user loadout: [{id, version, name, description, kind, builtin, opt_in, digest, params, warnings, error?, path?}]. params lists each parameter’s name, kind, required, default and description. A user file that cannot be used has its path and error and empty version, kind and digest. While a user file declares a built-in id, that built-in’s warnings hold user_loadout_uses_builtin_id (also in GET /api/loadouts/{id}), and POST /api/runs for the id answers 422 naming the file
GET/api/loadouts/{id}{summary, file, text, graph}: the summary row, the parsed file, its exact text and a display graph of nodes ({id, kind, label, detail}, kind one of agent, check, review, area_workers) and edges ({from, to}). The graph is for display only
POST/api/loadouts/validate{text}, at most 128 KiB. Returns {valid, error?, warnings, summary?} without saving anything
POST/api/runsStart a run: {loadout, task, repo, params?, keep?, check_command?, setup_command?, request_id}. repo is canonicalized and found or created as a Workspace, under the rules of POST /api/workspaces: one of Axocoatl’s own directories is the problem workspace_protected, and a folder too broad to be a Workspace is workspace_too_broad until its Workspace records the person’s confirmation (POST /api/workspaces with confirm_broad first); keep is none (the default), branch or pr; a repeat with the same request_id returns the same run, and is 409 while the first is still being admitted; params falls back to the configuration’s run.models. Answers 202 with {run_id, session_id, workspace_id, warnings}. A run admission refuses answers with every problem it found in error (Before a run starts): 422 when one asks for a change, 404 for an unknown loadout alone, 400 for infrastructure problems only. Admission runs to its end even when the client goes away before it answers (Ctrl-C in axocoatl run): a refused run is cleaned up as always, and a run admitted then is stopped before its first turn (verdict interrupted, with a stopping phase that says why) and its Session’s runtime stops. It takes no dry_run: a request with a dry_run query, whatever its value, is refused with 400 and nothing is started (a dry run is POST /api/runs/preflight)
POST/api/runs/preflightCheck a run as admission would, without starting it: the body of POST /api/runs, with task and request_id optional (a run without task is checked without it) and load_models (default true). Answers 200 with {loadout, ready, exit_code, problems: [{code, exit_code, message}], params, defaults, warnings, notes, sandbox?, ollama_models: [{model, loaded, context_tokens?}]}; nothing is created, started or recorded, and a stopped Podman machine is not started. With load_models true each Ollama model is loaded once without a prompt and probed with the contract probes (a few bounded requests), as a run’s admission does; with false only Ollama’s metadata is read, so a model that is not already loaded keeps its memory free and its context is not checked (context_tokens absent). A daemon older than 1.5 answers 405 here, never a run (The dry run)
GET/api/runsEvery run, newest first: [{run_id, session_id, loadout, state, phase, started_at_ms, outcome?, keep?, receipt?}]; state is preparing, running, finished, or failed when the run ended with an error
GET/api/runs/{run_id}One run, with its Outcome once finished, keep after Keep as PR, and receipt once its signed receipt is written: {key_id, files, removed, source, complete, statement_sha256} (the signing key’s id, the files covered and removed, where their digests come from, whether every changed path is covered, and the SHA-256 of the signed statement)
GET/api/runs/{run_id}/events?after=<seq>&limit=<1-1000>&wait_ms=<0-5000>{events, next_after, finished}; each event is [seq, {kind, at_ms, …}] with kind phase, turn_started, turn_ended, warning, adjudication, finding, not_covered, provider_retry or ended. limit is 200 when omitted. With nothing new and the run unfinished, the request waits up to wait_ms (1,000 when omitted) for an event. Keep results arrive after ended as phase events named keep
POST/api/runs/{run_id}/stopStop the run’s turn; answers 202. The run ends interrupted
GET/api/runs/{run_id}/junitThe run’s JUnit file, application/xml
GET/api/runs/{run_id}/recordThe run’s record bundle, streamed as application/vnd.axocoatl.record+jsonl. Schema axocoatl.record-bundle/2; its last section is the run’s receipt. Its header carries the time the run finished, so every download of a finished run is the same bytes while its record and Session do not change
GET/api/runs/{run_id}/receiptThe run’s signed receipt exactly as written, a DSSE envelope (application/vnd.dsse.envelope.v1+json). 404 with the reason until the run has finished, and for a finished run without one (its signing failed: the Outcome’s receipt_unavailable warning says why)
GET/api/receipts/keyThis data root’s public signing key: {algorithm, public_key, key_id, line}; public_key is the base64 raw Ed25519 key, key_id is sha256: + its hex SHA-256, and line is the trusted-keys line axocoatl receipt key prints. The key is made when there is none yet; the private key is never served
POST/api/sessions/{id}/keep-prKeep as PR: {run_id, branch?, open_pr?, remote?, title?}. Returns {branch, commit, paths, pushed_to?, pull_request_url?, base?, not_committed?, warnings?, receipt?}, receipt being the sha256: of the receipt’s statement the commit names; 422 for a malformed request such as an invalid branch name; 409 with the reason when Keep refuses, for example when the run did not pass, a run path was dirty before the run or changed after it ended, HEAD moved, the branch exists, the branch is the remote’s default branch, the remote branch exists, or a path’s content is not the one the run’s receipt covers

The Outcome (schema axocoatl.run-outcome/1) holds run_id, session_id, workspace_id, loadout ({id, version, kind, digest, builtin}), task, started_at_ms, finished_at_ms, verdict (pass, checks_failed, needs_attention, interrupted or error), exit_code (7 with verdict error when a turn could not start because the Workspace was held), attention (the reasons, in words), turns, checks (each with name, argv, state, timeout_ms, exit_code, output tails, candidate_sha256, report and reason), review (the reviewer and every round’s verdict and numbered findings), adjudications (round, finding_id, finding, decision accept, reject or missing, reason), findings (with repro and its classification: confirmed, fails_on_clean_build, reproduced, not_reproduced, repro_error or missing), not_covered (area, class, detail), notes (what the run noticed that is neither a gap nor a warning, in words; absent when there are none), warnings, usage (input_tokens, output_tokens, cost_microunits, complete, cost_known, cost_computed, retries and unreported; cost_known is false when a call’s cost is not known, such as a Codex writer’s on a model without a price, and cost_microunits then counts what those calls reserved; cost_computed is true, and absent otherwise, when part of the cost was computed from a program’s reported tokens at its model’s price, such as a Codex writer’s; retries counts the calls sent again, a call moved to another OpenRouter endpoint included; unreported names, when some calls reported no usage or no cost, each Agent and generation with how many of its calls, and is absent otherwise), network (event, connection and route request counts), openrouter_endpoints (by model, the OpenRouter endpoints the run’s native calls went to, in the order each was first counted, each with endpoint, provider, the calls it answered and the calls moved from it to another endpoint after it failed them; absent when there are none), keep and error.

A Session that a run created carries loadout: {run_id, loadout: {id, version, kind, digest, builtin}, network, workload}. Every other Session has no loadout field, and its behavior is unchanged.

The ChatGPT sign-in axocoatl connect codex stores, which axocoatl connect codex --refresh asks the daemon to refresh. The route answers only an authenticated request from a loopback address: 403 with {"error": "…"} when the daemon accepts API requests without authentication (server.auth.allow_unauthenticated), and for a request from any other address.

MethodPathRequest / behavior
POST/api/connect/codex/refreshNo body. Refresh the stored sign-in now, whether or not it is due, with the broker that refreshes it before a request (the same request to OpenAI, rotation, atomic write under the secret store’s lock and remembered refusal, one refresh at a time). Returns {outcome, …}, never a token: refreshed (200, {refreshed_at_ms, expires_at_ms}; expires_at_ms is the new access token’s JWT exp in milliseconds, null without one), replaced (200, the same fields for a sign-in axocoatl connect codex stored while the refresh ran, kept instead of the new tokens), not_stored (500, the times and message: the new tokens could not be written; the daemon uses them from memory and writes them again on their next use), no_sign_in (404, message), unusable (422, message: the stored value cannot be read or is not a sign-in), refused (409, {message, sent}: OpenAI refused the refresh token for good; sent is false when it had already refused it and it was not sent again), failed (502, message: the token endpoint could not be reached, did not answer in time, or gave an answer that is neither new tokens nor a refusal; the stored sign-in is unchanged), unavailable (503, message: the daemon has no broker for the sign-in). The daemon logs the request and its outcome without a value

MCP, configured Skills, and event projections

Section titled “MCP, configured Skills, and event projections”
MethodPathRequest / behavior
GET/api/mcp/catalogBundled catalog JSON
POST/api/mcp/install{slug, values?, name?}; connect in the live registry only
GET/api/mcp/serversConnected server name, transport, tool count
POST/api/mcp/servers/{name}Reconnect cached live transport
DELETE/api/mcp/servers/{name}Remove from live registry
GET/api/mcp/toolsDiscovered tool name, server, and description
GET/api/mcp/permissionsDurable saved permission decisions
DELETE/api/mcp/permissions?server=…&agent_id=…&tool=…Revoke matching decision; Agent/tool are optional
GET/api/skillsConfigured YAML Skills: id, name, description, emits
POST/api/skills/{id}/firePublish every event in the Skill’s emits list on the event feed
GET/api/events/recentThe last 200 event-feed events, in memory

Catalog connection changes are not persisted to YAML and do not rebuild already-created Agent tool executors. Approval decisions use the WebSocket command described in the next reference.

Legacy workflow, schedule, and proactive projections

Section titled “Legacy workflow, schedule, and proactive projections”
MethodPathRequest / behavior
GET/api/workflowsManual canonical Automations projected as workflows
POST/api/workflows/{workflow_id}/execute{input}; execute compatibility workflow and wait; handled step failures and structural failures return a measured error
GET/api/schedulesSchedule-triggered Automation projection and observations
PATCH/api/schedules/{id}{enabled?, every?, input?} on the canonical record
POST/api/schedules/{id}/runRun the schedule immediately and wait; success and failure retain completeness-aware usage
GET/api/proactiveEvent-, Skill-, and legacy proactive schedule projection

These are compatibility views. Full Automation records use the canonical API below.

MethodPathRequest / behavior
GET/api/session-teamsConfig-owned Lattice teams available to Session creation; separate from mutable Automations
GET/api/workspacesEvery persisted named Workspace, including one with no Sessions
POST/api/workspacesRegister {path, name?, confirm_broad?}; canonical path is unique and an omitted name preserves an existing custom label. The file system root, the home folder, the folders above it and a folder that contains one of Axocoatl’s own directories are a 409 with "code": "workspace_too_broad" unless confirm_broad is true, and the Workspace then records that confirmation as broad_confirmed_at (seconds since the epoch), which Session creation and runs on that folder need: a broad folder registered without it, as Axocoatl 1.4 did, is refused there until it is confirmed here; a folder at or below Axocoatl’s data, lease, control-socket or per-user configuration directory is a 409 with "code": "workspace_protected" always
GET/api/workspaces/{id}One Workspace
PATCH/api/workspaces/{id}Rename with {name}; the filesystem path does not change
DELETE/api/workspaces/{id}Remove the Workspace from the list and return it; its folder is never touched. A Workspace with a Session that is not closed is a 409 with "code": "workspace_has_open_sessions". Its closed Sessions stay listed
GET/api/workspaces/{id}/sessionsEvery Session owned by the Workspace, including closed records
POST/api/workspaces/{id}/sessionsCreate from {name, mode, enabled_skills?, exposed_ports?, image?, setup_command?, setup_approved?, setup_reviewed?} under the Workspace’s fixed path. While a Session’s turn holds the Workspace, answers 409 at once with "code": "workspace_busy", naming that Session, its run and its turn, and creates nothing (see A busy Workspace)
GET/api/sessionsEvery persisted Session, including closed records
POST/api/sessionsCompatibility create from {name, working_dir, mode, enabled_skills?, exposed_ports?, image?, setup_command?, setup_approved?, setup_reviewed?}; finds or creates the matching Workspace. A busy Workspace is a 409 with "code": "workspace_busy" at once, as above; a folder that POST /api/workspaces refuses without confirm_broad and whose Workspace has no broad_confirmed_at, or that it refuses always, is the same 409 with workspace_too_broad or workspace_protected; any other refusal is a 400
GET/api/sessions/{id}One persisted Session, or 404; a Session a loadout run created carries loadout
PATCH/api/sessions/{id}Rename with {name}
DELETE/api/sessions/{id}?force=falseClose: stops the Session’s containers and removes the Podman volumes its runtime fills again on start (axo-egr-, axo-egi-, axo-svc-, axo-ca-); the Node dependency volume stays for Reopen. force=true deletes the Session record and that volume too. While another Session’s turn or any other operation holds the Workspace (another Session’s file or Git change, Ways, creation or run admission), both answer 409 at once with {"error": "…", "code": "workspace_busy"}, naming that Session and turn or that operation, and change nothing. They wait only for this Session’s own work, which they stop: its turn, until its command reaches a safe point (at most 30 seconds), and its running Ways or checks, which they interrupt (at most 15 seconds). A second Close or Delete of the Session while one is in progress is the same 409 at once. Another conflict is a 409 without code
PUT/api/sessions/{id}/environmentReview/change {image, setup_command, setup_approved, setup_reviewed:true} and synchronously prepare that exact generation
POST/api/sessions/{id}/environment/rebuildRemove the old runtime and reproduce the persisted reviewed environment plan
POST/api/sessions/{id}/environment/confirm-runtime-cleanupHigh-friction E2B recovery acknowledgment. Send exactly one target: {runtime_id, confirmed:true} after manually deleting that retained runtime, or {creation_token, confirmed_all_matching_sandboxes_deleted:true} after manually deleting every sandbox whose metadata contains axocoatl_creation_token=<exact token>
POST/api/sessions/{id}/reopenExplicitly reactivate a closed Session before any live runtime can be resumed or reconstructed
POST/api/sessions/{id}/execute{input} synchronous compatibility execution with completeness-aware success/error usage; other execute override fields are ignored here. A refusal from a native provider check (such as “Ollama was upgraded from 0.20.6 to 0.40.8; review Team & budget again”) is a 422 with that check’s message alone, a conflict a 409, and any other failure a 500
GET/api/sessions/{id}/messagesTranscript projection; history_version selects its form
GET/api/sessions/{id}/turnsCanonical visible durable turns; history_version selects their form
GET/api/sessions/{id}/active-turnExact live run/turn ownership for Stop, or null
GET/api/sessions/{id}/turns/{turn_id}One canonical turn owned by this Session, in the same form as the list
GET/api/sessions/{id}/turns/{turn_id}/control-planeVersioned read-only execution evidence for the exact Session and turn
GET/api/sessions/{id}/turns/{turn_id}/receipt/statusRead-only native turn receipt availability; never creates a signature
GET/api/sessions/{id}/turns/{turn_id}/receiptSign and download a finished native turn’s retained evidence, or return the cached envelope for that exact revision; never hashes the current checkout
GET/api/sessions/{id}/network?after=<seq>&limit=<1-1000>The Session’s network record: mode, egress policy and recorded events after after (default limit 200)
POST/api/sessions/{id}/network/allow{command_id, scope, host, ports?}; under network: egress, allow one exact host for this Session. Returns {revision, digest}
POST/api/sessions/{id}/network/revoke{command_id, scope, host}; remove this Session’s allows for one host and close the connections they admitted. Returns {revision, digest}
GET/api/sessions/{id}/network/screenshots/{sha256}One screenshot a browser tool kept beside the Session’s network record, as image/jpeg or image/png; 404 when absent
POST/api/sessions/{id}/network/proposals/{proposal_id}/approve{command_id}; approve a host an Agent asked for: it is allowed for this Session. Returns {proposal_id, state, revision, digest}
POST/api/sessions/{id}/network/proposals/{proposal_id}/reject{command_id}; reject a host an Agent asked for. Returns {proposal_id, state}
POST/api/network/reloadRead the daemon’s configuration file again and apply its allowlists to new and running Sessions. Returns {applied, unchanged, restart_required, revisions, changes}, with 503 and failed when a running Session kept its policy
GET/api/session-turns/search?q=…&session_id=…Literal case-insensitive search; omit Session ID for all. With a Session ID and no history_version, answers in that Session’s form
GET/api/sessions/{id}/export?format=markdownMarkdown by default; accepts markdown, md, or json. Without history_version, a Session whose History holds native execution (every loadout run’s) exports in the versioned form, as its record bundle does. An unknown Session is a 404
POST/api/sessions/{id}/rewind{keep_through_turn_id?}; legacy {keep} is raw message count

GET /api/session-teams returns config-owned records of this shape:

[
{
"id": "feature-team",
"name": "Feature team",
"agents": ["planner", "coder", "reviewer"],
"entry_point": "planner"
}
]

The workflow_id stored by a Lattice Session must be an id from this response. This inventory is deliberately independent of the mutable Automation records returned by /api/workflows.

Workspace paths and Session working_dir values are canonical absolute paths. Every Session response carries its durable workspace_id; working_dir remains for execution and compatibility clients.

environment.state is unprepared, awaiting_approval, preparing, ready, or failed. A setup command is executable only when the durable Session record binds setup_approved:true to that exact text. A reviewed API request can grant that approval; the operator’s visible devcontainer default described below can grant it only while the Session remains unreviewed. Clearing the command with setup_reviewed:true is an explicit no-setup decision. Expected runtime/setup failures return the updated Session in failed state so clients can render retained evidence; malformed consent is 400, and an active turn or Attempt ownership conflict is 409. File, task, Git, Preview, turn, and Ways execution fail closed until the environment is Ready.

Live-checkout routes return 404 for a missing Session and 409 for every existing non-Ready environment. This applies to Session file tree/read/write, tasks and terminal attach, Git, Preview, HTTP execute, and Ways routes that start work or inspect a live checkout. Durable History and attachments, environment review/rebuild, completed Attempt results and cost, and the exact Keep/Discard recovery actions remain available so a failed Session can still be understood or resolved.

GET /api/fs/project?path=… includes runtime capability metadata. Under E2B, supports_session_image is false and template names the daemon-configured runtime; create or reconfigure rejects an explicit/devcontainer OCI image before provisioning. auto_approve_devcontainer_setup exposes the operator default for the exact devcontainer command. A browser/API request with setup_reviewed:true remains authoritative, including an unchecked veto; lockfile-detected commands are never covered by that policy.

Session mode is tagged JSON such as {"kind":"single_agent","agent_id":"coder"} or {"kind":"lattice","workflow_id":"feature-team"} or {"kind":"custom","agents":["planner","coder","reviewer"]}. In compatibility (legacy_v1) execution, Lattice mode resolves its stored team ID and Custom mode resolves its stored Agent IDs against the current daemon configuration when each turn starts. A single-Agent Session, a one-Agent team, a team whose entry point is a Coordinator, or a request targeted to one Agent runs directly. A turn that would run two or more Agents is refused before it starts; the error tells the operator to stop Axocoatl, make a cold backup, and run axocoatl session upgrade --confirm.

/turns, /turns/{turn_id}, and /messages take an optional history_version query parameter:

  • history_version=1 returns the legacy 1.0 shape: turn records with id, user_input, final_output, status, and their execution events from /turns, and role/content messages from /messages. A Session whose History holds native execution refuses it with 400, because legacy rows cannot represent that work.
  • history_version=2 returns versioned entries. Each names its source: {"history_version": "legacy_v1", "turn": {…}} for a turn recorded by the compatibility path, and {"history_version": "execution_v2", "turn": {…}} for a native turn. /messages entries carry content in place of turn.
  • Without the parameter, a Session whose History holds native execution answers as history_version=2, and every other Session answers exactly as history_version=1. Read each entry’s history_version rather than assuming one shape.
Terminal window
# curl reads the header from stdin, so the token stays out of the process list.
# DATA_ROOT is the daemon's data root, which holds local-api-token.
printf 'Authorization: Bearer %s\n' "$(cat "$DATA_ROOT/local-api-token")" |
curl -s -H @- "http://127.0.0.1:8080/api/sessions/$SESSION/turns?history_version=2"
[
{
"history_version": "execution_v2",
"turn": {
"owner": { "workspace_id": "…", "session_id": "…" },
"turn_id": "turn-3f0c…",
"revision": 14,
"state": "needs_attention",
"superseded": false,
"epochs": [],
"legacy_predecessor": null,
"request": {
"status": "available",
"reference": "…",
"content": { "display_input": "Fix the failing test", "…": "…" }
},
"activations": []
}
}
]

A native turn’s state is running, needs_attention, completed, cancelled, or finished. Evidence such as request and each activation’s output carries a status of available, missing, or not_recorded; only available has content. The control-plane endpoint below is the per-turn detail view.

A new request while a turn needs attention

Section titled “A new request while a turn needs attention”

A native Session runs one turn at a time. While its current turn needs attention, a new request (POST /api/sessions/{id}/execute or the WebSocket session command) is refused with 409 or session-request-rejected, and nothing starts or closes. The error names the turn and the two ways out, both through POST /api/sessions/{id}/turns/{turn_id}/control-commands:

  • Continue that turn with the message: action revise, the exact activation of an Agent with an accepted answer, and the message as instruction. continue restarts stopped work without a message.
  • Finish it as it is, then send the request again as a new turn: action finish with a confirmed partial_finish built from turn_controls.partial_finish in the turn’s control-plane. Only the accepted final answers it selects carry into the next turn’s conversation; an activation that failed or was interrupted has no accepted answer, so its work does not carry forward.

The app offers the same two choices when a message is sent while the turn needs attention.

A turn holds its Session’s Workspace for as long as it runs or needs attention. A request that acts on the Workspace never waits for a turn: while a turn of any Session of the Workspace holds it, the request is refused at once with 409, naming that Session, its loadout run and its turn, and nothing changes; send it again once the turn has ended, or stop the turn.

A lifecycle action never waits for another Session’s work at all: creating, closing, deleting or reopening a Session, changing or repairing its environment, confirming its runtime cleanup and starting several Ways are refused at once whatever else holds the Workspace (another Session being created and its environment prepared, a run’s admission, a file or Git change, Ways or their checks), naming that operation, and nothing changes. Close and Delete wait only for the Session’s own work, which they stop: its turn, until its running command reaches a safe point (at most 30 seconds), its running Ways or Ways checks, which they interrupt, and its runtime while it starts (at most 15 seconds each); after that they are refused the same way. Other requests (attachment, file and Git changes, the Ways reads, checks, judge and Keep) wait up to 10 seconds for an operation that is not a turn; when it has not ended by then, the request is refused the same way, naming that operation.

Creating a Session (POST /api/sessions, POST /api/workspaces/{id}/sessions), Close and Delete carry "code": "workspace_busy" beside error; attachment changes, environment changes, Reopen, file and Git changes and the Ways reads, checks, judge and Keep answer the same 409 without it. POST /api/runs refuses at once whatever holds the Workspace.

GET /api/sessions/{id}/network returns the Session’s network mode and the events in its network record. Reading never creates a record: a Session with no network activity returns an empty list.

{
"session_id": "ses-…",
"mode": "bridge",
"sidecar": null,
"policies": [],
"private_destinations": [],
"record": {"events": 3, "bytes": 412, "gaps": 0},
"events": [
{"v": 1, "seq": 1, "ts_ms": 1790000000000, "event": {"kind": "sidecar", "state": "ready", "generation": 1}}
],
"next_after": 1,
"warnings": ["Axocoatl's config file is inside this Workspace; Agents can read it. Keep secrets in environment variables."],
"proposals": []
}

mode is sandbox.network. Pass next_after back as after to read on. Each event has a kind: policy, sidecar, bind, unbind, open, close, request, response, web_request, web, browser, proposal or limit. An open event names the destination host and port, its conn_kind (connect for a tunnel or http), the decision (allow or deny) with its reason and status, the rule that decided (route#0 for an egress route), the addresses used, and the tool call (binding) whose credential it presented. Credentials appear only as 16-hex tags. In a Session container with workload users under network: egress, an open event also has peer: the program that opened the connection as the container’s first process found it, with pid, uid, gid, exe (its path), exe_sha256 (of the file’s contents), ancestors (the paths of up to 8 parent programs, nearest first) and, for what it could not find, error (no_access, not_found, timeout, foreign_namespace for a program run from a mount namespace of its own, whose path is left out, or unsupported). A close event adds the bytes sent and received and the duration, and for a route’s connection the reason the daemon ended it, if it was not an ordinary close. On a route, each HTTP request is a request event written before the request is sent (conn, seq_in_conn, method, path without its query, host, the rule that allowed it, decision, reason, and the credential’s name, never its value), and a response event says how an allowed one ended (status, up, down, ms, outcome, and cookies_dropped when a credentialed route removed Set-Cookie or Set-Cookie2 fields). record counts the events kept and the bytes of their lines; gaps counts places where a sequence number was skipped. The record keeps every event for the Session’s life, so the max_events and full fields of 1.2.0 are gone. An open or close event’s conn is g<generation>:<id>; generations continue across proxy restarts and runtime starts, so conn is unique in one record. A limit event with what: "unrecorded_refusals" counts refusals of connections without a valid credential that were not recorded one by one. warnings is present when the person should know something about the Session, such as Axocoatl’s config file being inside its Workspace. Under network: egress, sidecar reports the egress proxy of the Session’s running runtime (state is starting, ready, restarting, failed or stopped, with its generation and the number of restarts), and policies lists each scope’s compiled policy: session (your sandbox.egress list plus this Session’s allows), provisioning (the Alpine, Debian and Ubuntu mirrors) and, when browser: is configured, browser (browser.allow plus this Session’s browser allows), which only the browser’s credentials are checked against. Each rule has an id, its text and its source (preset, config, session, or route for an entry of sandbox.egress.routes in the session policy). A policy event’s source is config (the configuration the decision point opened with), config_reload (a reload), session_allow or session_revoke. proposals lists the hosts Agents asked for, pending ones first. Under bridge and none, sidecar and policies describe only the browser’s own egress sidecar and its browser policy, once a browser call with declared hosts (browser.allow) has started them. Otherwise, and while an egress Session has no running runtime, they are empty.

A web_request event is written before a web_search or web_fetch call with valid arguments sends anything: the tool, its invocation_id, activation_id and agent, and either the url a fetch requests or a search’s query_sha256 and query_bytes. If it cannot be written, nothing is sent. A web event with the same invocation_id follows when the call finishes; a call with invalid arguments has only the web event.

A web event records how one call ended: the tool, its invocation_id, activation_id and agent, the decision and reason, the source_ids it returned, retrieved_at_ms and ms. A search adds query_sha256 and query_bytes (not the query text), results, unresponsive_engines and sources (each {id, url}, URLs cut to 512 bytes and then marked url_truncated). A fetch adds url, final_url, redirects, status, bytes, content_sha256 and text_sha256. Each fetch URL, in web_request too, is cut to 1,024 bytes; url_truncated, final_url_truncated and redirects_truncated are present and true only when one was cut. The full URL is in the tool call’s recorded arguments.

{"v": 1, "seq": 6, "ts_ms": 1790000000000, "event": {"kind": "web_request",
"tool": "web_fetch", "invocation_id": "tool-…", "activation_id": "…", "agent": "…",
"url": "https://www.rust-lang.org/"}}
{"v": 1, "seq": 7, "ts_ms": 1790000000412, "event": {"kind": "web", "tool": "web_fetch",
"invocation_id": "tool-…", "activation_id": "…", "agent": "…", "decision": "allow",
"url": "https://www.rust-lang.org/", "final_url": "https://www.rust-lang.org/",
"status": 200, "redirects": [], "unresponsive_engines": [], "bytes": 18234,
"content_sha256": "…", "text_sha256": "…", "source_ids": ["S1a2b3c4d"],
"retrieved_at_ms": 1790000000412, "ms": 412}}

A browser event is one browser or browser_check call: tool, the invocation_id, activation_id and agent, ok, the url, final_url and status (or the test_path and check_status), the number of blocked requests, the egress credential’s token tag when the call used declared hosts, ms, and a screenshot {sha256, media_type, bytes} when one was kept (or screenshot_dropped with the reason). A call that failed before it produced a result has ok: false and the reason in error. GET /api/sessions/{id}/network/screenshots/{sha256} returns the image. Screenshots are for people; no model sees them.

Under network: egress, a person can allow a host that the Session’s list refuses, for this Session only, and take that back:

POST /api/sessions/{id}/network/allow
{"command_id": "c-41f2", "scope": "session", "host": "api.example.com", "ports": [443]}
{"revision": 4, "digest": "9f47a9dc…"}
  • scope is session, or browser for the browser’s declared hosts when browser: is configured. The panel sends the scope of the refused connection.
  • host is one exact host name. A wildcard, an IP address or a private range is refused; put those under sandbox.egress instead. ports defaults to [443].
  • The change is written to the Session’s network record as a policy event with source session_allow or session_revoke, the change (including the command_id) and actor human, then applies to new connections at once, also while the Session’s runtime is stopped. The answer is the scope’s new policy revision and digest.
  • Revoke removes every allow this Session added for the host and closes the open connections they admitted. A host from your configuration cannot be revoked here.
  • Each command_id (1 to 128 characters) is used once. A resend, also after a daemon restart, gets 409. A validation failure gets 400 with the reason, a closed Session 409, and an unknown Session 404.

Agents have no tool or route that reaches these changes. An Agent can only ask, as below.

Under network: egress, a writer Agent whose tools list request_network_access can ask for one exact host, with its ports (default [443]) and a reason. The request is written to the record as a proposal event with state: pending, its id (prop_ and 16 hex digits), host, ports, reason, and the agent, invocation_id and activation_id of the call, and the tool call waits for a person (up to wait_secs, default 120, at most 600). An identical pending request joins the first one. A Session keeps at most 16 pending requests. GET /api/sessions/{id}/network lists them under proposals:

{"id": "prop_6f1c0b3e9a2d4c71", "state": "pending", "host": "api.example.com",
"ports": [443], "reason": "The build downloads its schema from here.",
"agent": "writer", "invocation_id": "tool-…", "activation_id": "…"}
POST /api/sessions/{id}/network/proposals/prop_6f1c0b3e9a2d4c71/approve
{"command_id": "c-7a10"}
{"proposal_id": "prop_6f1c0b3e9a2d4c71", "state": "approved", "revision": 5, "digest": "…"}
  • Approve is the per-Session allow above, in the session scope: a policy event with source session_allow, actor human and change.proposal_id, then a proposal event with state: approved and the revision. The waiting tool call returns approved, and new connections to the host are allowed at once. Revoke it like any other Session allow.
  • Reject records a proposal event with state: rejected; nothing is allowed, and the tool call returns rejected.
  • A call that nobody answers in time returns pending; the request stays in the list and a later call for the same host and ports waits on it again. A request still pending when the daemon stops is listed again, and can be decided, once the Session’s runtime runs after the restart.
  • A decided proposal gets 409, as does a reused command_id. An unknown Session or proposal gets 404, a malformed proposal id or a daemon that does not run network: egress 400.

Nothing approves a request by itself, and no Agent can reach these routes.

POST /api/network/reload (and axocoatl network reload) reads the configuration file the daemon was started with again and validates all of it. Only six settings apply while the daemon runs: sandbox.egress.allow, sandbox.egress.private_destinations, sandbox.egress.routes, credentials, browser.allow and browser.private_destinations.

POST /api/network/reload
{"applied": ["sandbox.egress.allow"],
"unchanged": ["sandbox.egress.private_destinations", "sandbox.egress.routes", "credentials",
"browser.allow", "browser.private_destinations"],
"restart_required": ["sandbox.egress.max_connections"],
"revisions": [{"session_id": "ses-…", "scope": "session", "revision": 6, "digest": "…", "closed": 1}],
"changes": [{"key": "sandbox.egress.allow",
"added": ["registry.npmjs.org:443 (preset npm)"],
"removed": ["old.example.com:443 (config)"]}]}
  • changes names, for each list that changed, every entry it gained and lost compared with the lists in force before: allow entries as the rules they compile to (a preset as each of its hosts, with its ports), private ranges as ranges, routes as their configuration in JSON and credentials as their name and where they are read (github: env GITHUB_TOKEN; there is no value to show). Read it to see exactly what a reload widens.

  • New Sessions use the new lists. Each running Session whose policy changed records it as a policy event with source config_reload and actor human, and uses it for new connections at once. Its own per-Session allows stay.

  • Open connections admitted by a rule the new list no longer has, unchanged, are closed (closed counts them per Session and scope). A rule whose position in the list moved gets a new id, so its connections are closed too and reconnect. Removing a private range closes that scope’s open connections. A route that changed in any way (its rules, credential, for or other settings) closes the connections it was serving, and a new route closes the plain tunnels already open to its host on its ports.

  • A Session whose runtime started without routes has no trust files for the Session’s authority, so its clients refuse the certificates of routes a reload adds until the runtime starts again; see What the client sees.

  • restart_required names every other setting that differs from the configuration the daemon started with, such as sandbox.network, sandbox.egress.sidecar_network, sandbox.egress.max_connections, adding or removing the browser block, Agents or providers. Only key names are reported, never values. These are not applied.

  • failed lists running Sessions whose new policy could not be recorded, with the scope that failed (none when the Session’s lists did not compile at all). That scope keeps its old policy, its old lists and the connections they admitted. The answer is then 503 with the same report and an error; every other Session uses the new lists. The next reload, even of an unchanged file, applies the lists to each Session that has not taken them yet, so send it again.

  • An invalid file, or a daemon not started from a file, gets 400 with the reason, and nothing changes.

  • So does a configuration file inside the Workspace of any of the daemon’s Sessions: that Session’s Agents can edit it, so it is not applied to every running Session while the daemon runs. Check the file and restart the daemon, or start the daemon from a file outside every Workspace.

The control-plane endpoint returns schema_version: 1, the source history_version, exact Session and turn identities, nodes, activation histories, and causal evidence. Evidence values carry an explicit status: available, not_recorded, unknown, missing, unavailable, or truncated. A truncated preview includes its original byte length. Clients must not turn unavailable usage into zero or missing output into a successful empty answer.

An activation whose tool calls opened or were refused connections through an egress proxy (under network: egress, or through the browser’s declared hosts), or called web_search or web_fetch, has one evidence item of kind network. Its summary names each destination, such as registry.npmjs.org:443 allowed ×3 (1.2 MB in); evil.test:443 refused (not_allowed), with by node, curl after a destination when the record names the programs behind its connections, and counts web calls, followed by the requests made on routes; its details holds up to 200 of the matching open, close, request, response and web lines from the network record, with truncated set when there were more. Events are joined to the activation through the tool call whose credential they presented. Setup, terminal and unattributed events appear only in the network record.

An activation that used web_search or web_fetch has one evidence item of kind sources. Its details.sources lists each source id the activation received with url, final_url, searched, fetched, status, retrieved_at_ms, content_sha256, text_sha256, the invocations that returned it and cited, which is true when the activation’s final output cites the id in square brackets ([S1a2b3c4d] or [S1a2b3c4d ¶3]). details.unknown_citations lists ids the output cites that no web tool returned to that activation.

In a native turn, an edge of kind delegated_by runs from a lead’s node to a helper node the lead admitted through delegate; its summary names the helper template and its evidence is the helper’s admission grant. It is not a dependency: the lead waits for the helper inside its own activation, and the helper does not gate it.

Compatibility Session history is identified as legacy_v1. Its activation references retain their recorded generation when available; they do not invent execution epochs or current Agent definitions. Per-activation Stop, Retry, Guide, and Revise capabilities are disabled for these historical identities. Reading this endpoint does not mutate the turn or start execution.

Native execution_v2 capability entries distinguish an enabled live action from an optional requires_revalidation: true request after restart. A recovery request keeps enabled: false: the read did not attach a runtime or establish authority. The existing control-command POST reconnects the Session and validates its exact revision, epoch, repository, grant, and remaining budget before applying it. Recovered Revise, Continue, and Finish retain their original identities and may be refused. Failed or interrupted work in a paused epoch is selected through Continue. Closed turns, superseded conversation history, and isolated Ways do not offer these cooperative recovery requests.

Native turn history retains repository_reattachments with the exact original and reacquired repository descriptors; these records document host reattachment without changing original activation inputs or grants, authorizing work, or replaying it.

Captured inline context has its own reference_id in the receiving turn. For a coordination_reference, metadata.reference_id identifies the original evidence alongside its exact source Session, turn, epoch, activation, and generation; for a ways_decision, metadata.decision_id identifies the retained decision.

A native lead’s delegate call whose raw return was lost retains a labeled reconciliation result read from the command that admitted the helper and the helper’s canonical outcome: its accepted answer, or the error for a refused, failed, or stopped helper. Recovery does not run the helper again or repeat a provider request. An admitting command left requested or accepted by a crash admitted no helper; the same reopen records that, and the lead may call delegate again. Ordinary shell/tool effects are not automatically replayed.

For native cooperative turns, turn_controls.partial_finish supplies the exact review for a human partial finish. The existing control-command POST uses action: "finish" and an optional partial_finish object containing selected_activations, stop_activations, missing_conditions, unrun_nodes, and confirmed: true. Selected results must be current accepted sinks; the other lists must match the reviewed state. Stale reviews are refused. Omitting partial_finish retains normal Finish semantics. Partial finish records missing work explicitly and waits for safe settlement; it does not grant an Agent permission to bypass checks.

A native turn whose team has required checks also carries required_checks in its control plane: for each check, in order, its argv and the state of its latest run (pending, passed, failed, timed_out, outcome_unknown, unavailable and so on), with exit_code, run_id, process_status and bounded stdout and stderr previews when recorded. Timeout, interruption, launch failure, no dispatch and a missing outcome stay distinct, and a successful exit alone is not a readiness verdict. A check whose record cannot be read is unavailable with a reason; it does not hide the rest of the turn. required_check_readiness carries that verdict: state (passed, failed, not_run, skipped or unavailable), a reason in words, and the candidate_sha256 tree it judged. Its conditions are named required-check:0 (the capture before), required-check:1 to required-check:n (the checks), required-check:n+1 (the capture after) and required-check:ready. Selecting any of them in a Continue request, or restarting any Agent, reruns both captures, every check and readiness. A check-only Continue that the paying Agent’s budget cannot cover is refused with the reason.

A native turn whose team has a required review carries required_review in its control plane: the reviewer template, state (not_run, running, approved, changes, failed, skipped or unavailable), a reason in words, the verdict (approve, changes or unreadable), bounded findings, the round and max_rounds, current (whether the verdict is about the current result) and the candidate_sha256 tree the reviewer was shown. The reviewer is the graph node required-review and its verdict the condition required-review:verdict; selecting that condition in a Continue request runs the reviewer again, and rerun checks or restarted work run it again too.

The directory must already exist when registering a new Workspace. The server has no configured folder allowlist.

Rewind is blocked during an active turn or unresolved Attempt set and currently requires an autonomous single-Agent Session. It changes the logical conversation head; it does not restore files or reverse effects.

MethodPathRequest / behavior
GET/api/sessions/{id}/attachmentsActive composer relations
POST/api/sessions/{id}/attachments?scope=this_turnMultipart file; scope is this_turn or session
GET/api/sessions/{id}/attachments/{reference_id}Metadata for one owned reference
PATCH/api/sessions/{id}/attachments/{reference_id}{scope} before a one-turn relation is consumed
DELETE/api/sessions/{id}/attachments/{reference_id}Remove future selection while retaining historical pins when used
GET/api/sessions/{id}/attachments/{reference_id}/contentDownload/preview bytes through owning relation

Declared images are capped at 10 MiB; other documents at 25 MiB. Extracted/OCR text is bounded. Attempts do not receive these references.

Session files, tasks, Terminal, and Preview

Section titled “Session files, tasks, Terminal, and Preview”
MethodPathRequest / behavior
GET/api/sessions/{id}/tree?path=…Lazy one-level directory listing within Session root
GET/api/sessions/{id}/file?path=…Read one file, capped at 512 KiB
POST/api/sessions/{id}/file?path=…Atomically overwrite existing resolved path with {content}
GET/api/sessions/{id}/tasksBackground task and terminal state
POST/api/sessions/{id}/tasks{command, interactive?, rows?, cols?}; uses or reconstructs the already-Ready sandbox and never prepares an unreviewed environment implicitly
GET (WS)/api/sessions/{id}/terminals/{tid}/wsRaw PTY output as binary; input binary/text; resize JSON
Any HTTP method/api/sessions/{id}/proxy/{port}Legacy response-sandboxed Preview proxy root, for programs and fetch()
Any HTTP method/api/sessions/{id}/proxy/{port}/{*tail}Legacy response-sandboxed Preview proxy path, for programs and fetch()

File resolution rejects paths outside the canonical Session root. Tree, read, and write execute through the Ready sandbox: local Podman operates on the read-write Workspace bind, while E2B operates on its remote clone. There is no host-filesystem fallback for a failed remote runtime or a container-local dependency volume. The write endpoint does not create missing parent directories. Terminal resize is {"kind":"resize","rows":30,"cols":100}.

The workbench opens the virtual Preview Host, not the legacy path. The Host boundary validates the exact Session and logical port, resolves that pair to the sandbox’s dynamically assigned loopback transport (a port Podman publishes on [::1] on macOS or 127.0.0.2 on Linux, never on the workbench’s 127.0.0.1), and forwards normal app HTTP methods, query strings, request bodies, cookies, module/root assets, and WebSocket upgrades. HTML receives the source-and-origin-pinned picker bridge; non-HTML bodies stream without whole-response buffering. The upstream app sees the validated virtual authority while the TCP connection remains loopback. Sibling Sessions can therefore use the same logical port without sharing a host port, browser origin, host-only cookies, or control-plane access. The proxy forwards an application’s Set-Cookie headers without their Domain attribute, so the browser keeps each one host-only on that Preview origin; the rest of the header is unchanged. Whether a page’s script may set a parent-domain cookie such as Domain=localhost is browser policy: Chromium and WebKit on Linux refuse it, and Safari on macOS accepts it from a top-level page on a *.localhost address and sends it to every Preview and every other localhost address (not to the workbench, at 127.0.0.1). So when the request comes from Safari’s engine (by its User-Agent: Safari on a Mac, and every browser on iPhone and iPad) and is for a page of its own (Sec-Fetch-Dest: document, or any navigation that is not a frame; from a Safari too old to send Fetch Metadata, any request for a page), a Preview Host answers 403 with a page that says why and links to the workbench, and the app is never asked (Security). The proxy forwards request cookies other than Axocoatl’s; on a WebSocket upgrade, only those that are visible ASCII, which is all the handshake to the app can carry. Both proxies remove axocoatl-token-* cookies from forwarded requests and drop upstream Set-Cookie headers that would set one. The legacy /api/sessions/{id}/proxy/{port} path sits behind API authentication and never forwards Axocoatl credential headers. It shares the workbench’s origin, so in every browser it answers only requests the browser marks Sec-Fetch-Dest: empty that are not navigations (fetch(), XMLHttpRequest, EventSource, navigator.sendBeacon): any other request a browser marks with Fetch Metadata, for something it would show, run or embed (a page, frame, embed, object, fenced frame, script, style sheet, image or worker), gets 403 and a line of text, and the app is not asked. Programs that send no Fetch Metadata are served; use a header credential. It forwards none of the app’s Set-Cookie headers, and every response carries Content-Security-Policy: sandbox without allow-same-origin.

MethodPathRequest / behavior
GET/api/sessions/{id}/git/statusBranch and staged/unstaged file state, including Last turn flags. In a folder that is not a Git repository, this and every other Git route is a 409 with "code": "not_a_repository"; none of them initializes one
POST/api/sessions/{id}/git/initRun git init in the Session’s folder at the person’s request; nothing is staged, committed or configured. Returns the status
GET/api/sessions/{id}/git/identity{name, email, signing, problem}: who a commit from Source Control is by, as host Git reads it for the folder, and why a commit would be refused
GET/api/sessions/{id}/git/diff?path=…One path’s working diff
GET/api/sessions/{id}/git/branchesCurrent and available branches
GET/api/sessions/{id}/git/hunks?path=…&staged=falseParsed staged or unstaged hunks
POST/api/sessions/{id}/git/stage{paths}; empty list means all
POST/api/sessions/{id}/git/unstage{paths}; empty list means all
POST/api/sessions/{id}/git/hunk{path, index, stage}; stage defaults true
POST/api/sessions/{id}/git/hunk/discard{path, index}; destructive unstaged hunk discard
POST/api/sessions/{id}/git/discard{path?}; omitted path discards all unstaged changes
POST/api/sessions/{id}/git/checkout{"ref":"branch-or-ref"}
POST/api/sessions/{id}/git/commit{message?, stage_all?}; default commits existing index. The commit is by the person’s host Git identity; with none set, or in a repository that signs its commits, it is a 422 and nothing is committed. Nothing staged is a 422; a Git failure is a 400 with Git’s message
PUT/api/sessions/{id}/check{check_command}; null/empty clears it

Discard and checkout can destroy or obscure working changes. API clients must provide their own confirmation UX.

One Session can own one unresolved set. Except for results, set-scoped calls use attempt_set_id; a stale ID returns 409 rather than touching a newer set.

MethodPathRequest / behavior
POST/api/sessions/{id}/variants{input, task?, n?, lanes?}; starts isolated local-Podman Attempts
GET/api/sessions/{id}/variants/status?attempt_set_id=…Changed-file status per Attempt
GET/api/sessions/{id}/variants/resultsDurable current set, outputs, verdicts, usage, and Judgment
GET/api/sessions/{id}/variants/trajectories?attempt_set_id=…&baseline=0Aligned Route comparison
GET/api/sessions/{id}/variants/diff?attempt_set_id=…&index=0&path=…One file before/after for one Attempt
POST/api/sessions/{id}/variants/verify{attempt_set_id, check}; run Checks after all Ways are terminal
POST/api/sessions/{id}/variants/judge{attempt_set_id, agent_id}; rank passing non-empty survivors with that configured Agent
GET/api/variants/probe?provider=…&models=a,bPreflight comma-separated models for structured tool calls; each result includes control_usage
POST/api/sessions/{id}/variants/plan{task, agent_id}; return plan, rendered instruction, and control_usage
GET/api/sessions/{id}/variants/cost?attempt_set_id=…&baseline=…&baseline_provider=…Actual and counterfactual price report with known flags
POST/api/sessions/{id}/variants/adopt{attempt_set_id, index}; resumable Keep without commit
POST/api/sessions/{id}/variants/discard{attempt_set_id}; cancel/join and remove without keeping

Attempts require an autonomous single-Agent Session, Git, and local Podman. A keepable candidate must be completed, non-empty, and passing. Keep phases are durable and retrying the same index resumes; discard is rejected after apply begins.

Remote missing prices remain unknown. total_usd is complete only when its known flag says so. Plan, model-check, and Judge calls are outside Attempt execution totals and use control_usage. Plan/Judge error responses also include that field so a failed or invalid Agent response does not hide a paid call; token_usage_known: false marks a known subtotal.

MethodPathRequest / behavior
GET/api/automationsList canonical records
POST/api/automationsCreate from a complete Automation JSON body
GET/api/automations/{id}Read one record
PUT/PATCH/api/automations/{id}Full replacement/upsert; path ID must equal body ID; PATCH is not partial
DELETE/api/automations/{id}Delete the record
POST/api/automations/{id}/run{input?, inputs?}; background start, returns {ok,id} where ID is the Automation ID
POST/api/automations/{id}/move{folder}; null moves to root
GET/api/automation-foldersList durable folders
POST/api/automation-folders{path, name?}
PATCH/api/automation-folders{old_path, new_path, new_name?}
DELETE/api/automation-folders?path=…&keep_contents=trueMove contents up by default or recursively delete
GET/api/toolsTool IDs available to Automation editor/runtime

Automation JSON contains id, name, optional description, nodes, edges, tagged trigger, enabled, and optional folder. Node kinds are agent, tool, conditional, map, subgraph, text_input, and interrupt. Triggers are manual, schedule, on_event, and on_skill.

MethodPathRequest / behavior
GET/api/automations/{id}/runsRun history for one Automation
GET/api/automations/{id}/runs/{run_id}One run with node state and diagnostic detail
POST/api/automations/{id}/runs/{run_id}/fork{input?}; fresh whole-graph rerun from start, not continuation
GET/api/interruptsEvery pending operator Interrupt
POST/api/automations/{id}/runs/{run_id}/nodes/{node_id}/resume{value?}; continue from top-level durable pause
POST/api/automations/{id}/runs/{run_id}/nodes/{node_id}/cancelWake with empty value and continue; does not cancel whole run

Observe run creation and lifecycle through run history and WebSocket events. The generic /run response does not return the new run ID.

These routes keep directoryless Chat integrations working. They do not provide a separate browser destination.

MethodPathRequest / behavior
GET/api/chat?q=…List or search compatibility Chats
POST/api/chat{agent_id, name?}
GET/api/chat/{id}Read one Chat
PATCH/api/chat/{id}{name?, starred?, system_override?, model_override?}; null clears overrides
DELETE/api/chat/{id}Delete Chat record
POST/api/chat/{id}/fork{truncate_at, replacement_content?, replacement_role?}
GET/api/chat/{id}/exportExport compatibility transcript
POST/api/chat/{id}/attachMultipart file upload and attach
PUT/api/chat/{id}/attachAttach existing FileStore entry with {file_id}
GET/api/chat/{id}/attach/{file_id}Read referenced bytes
PATCH/api/chat/{id}/attach/{file_id}{pinned}
DELETE/api/chat/{id}/attach/{file_id}Remove relation, not underlying FileStore entry

Streaming Chat turns use the retained WebSocket chat-turn command.

MethodPathRequest / behavior
GET/api/filesList/search shared entries using supported query fields
POST/api/filesMultipart file upload without attaching to a Chat
GET/api/files/{id}Read metadata
PATCH/api/files/{id}{name?, tags?}
DELETE/api/files/{id}Delete unless retained by historical Session context; removes Chat references
GET/api/files/{id}/bytesDownload stored bytes

The FileStore API is not the Session Files editor and does not expose the Workspace tree.

MethodPathRequest / behavior
GET/api/fs/list?path=…&hidden=falseList child directories for the Workspace folder picker: {path, parent, git, dirs: [{name, path, git}], workspace_scope?}; git marks a Git repository and workspace_scope ({code, message}) says why POST /api/workspaces would refuse the listed folder
GET/api/fs/project?path=…Probe devcontainer metadata and ancestor AXOCOATL.md files
GET/.well-known/agent.jsonA2A discovery card
POST/a2a/tasksInbound A2A task dispatch to local receiver_id

The folder picker defaults to the daemon user’s home when path is omitted. It is a read endpoint but can enumerate any daemon-readable directory; protect the API accordingly. A2A is inbound only.

The unified live endpoint is GET /ws. Terminal PTYs use their separate Session route. Both upgrades need the same credential as other API routes: the workbench sends its sign-in cookie, and other clients send a header. See WebSocket reference →