REST API
Coordination's HTTP surface, on 5525. It is the twin of the MCP tools — same commands and the same rules. One naming difference: where an MCP tool takes agent (who is asserting), a route takes by, in the body or as ?by=, because the person behind a button and an agent both write through it.
For the run console's routes on the same port (Bobcat's: ingestion, runs, exports, runners, the Event Model wire) and what critterstack adds beside them (the Event Model's halves and the tools' warnings), see Ports and wire contracts.
Who is served
No route has authentication. By default every route answers this machine only: a request that is not local (an address that is not loopback, or one a proxy forwarded) gets 403 with { "errors": ["…"] } naming the setting that serves other machines. See Who can reach the server.
Version
| Route | |
|---|---|
GET /api/about | { version, docs, releaseNotes }: the server's version, and where the docs and the release notes are. The web UI's About critterstack dialog reads it, and critterstack setup asks it to see whether a server answers. |
The work loop
The REST twin of next_ready_nodes / claim_node / report_node / release_node, for an agent that can reach HTTP but has no MCP client. Without these, such an agent can author and observe plans yet works unclaimed, and the board's claims column lies by omission.
GET /api/plans/ready
Ready work across every plan, or one with ?plan=, sorted by leverage. Each entry carries claimedBy when someone holds it, and launch when nobody does: next when an agent can claim it, or what holds it (go-ahead, machine-resource, exclusive). A node kept for a person is left out. A ?plan= naming no valid plan answers 404.
POST /api/plans/{slug}/nodes/{id}/claim
{ "agent": "my-agent", "leaseMinutes": 30, "session": "$CLAUDE_CODE_SESSION_ID" }| 200 | { claimed: true, expiresAt, node, readyWarning } — readyWarning is set when the node is not ready, rather than refusing: its dependencies may not be done, and that is worth saying but not worth blocking. |
| 409 | { claimed: false, heldBy, heldUntil } — another agent holds a live lease. Or { claimed: false, held: true, reason }: a machine resource the node uses is full, the machine is reserved for an exclusive node, or this exclusive node is waiting for the machine to drain; reason is the sentence. |
| 400 | The node is already done — there is nothing to claim. Or agent is missing. |
| 404 | No such plan or node. |
leaseMinutes defaults to 30 (at most 240). A cloud agent adds "where": "cloud" and its session's page as "link"; the card then says the holder runs in the cloud and links it. where is cloud or nothing, and link an http(s) URL, else 400.
POST /api/plans/{slug}/nodes/{id}/report
{ "agent": "my-agent", "note": "reproduced; the fix is in the parser" }Attaches or replaces the claim's note and renews the lease. Only the holder can — anyone else gets 409 telling them to claim first. link (a cloud agent's session page) may ride a report too.
On an issue node it also takes pr (the number of the PR you opened, in the node's repository: linked however its body is worded, and never closing the node) and the scope report: leftOut (what the issue asks for that you did not do; [] clears it), scopeDone and scopeTotal. Anything left out makes the node partial until a person accepts it.
POST /api/plans/{slug}/nodes/{id}/release
{ "agent": "my-agent" }Status stays whatever observation says. Finishing is proven by the issue closing or the suite passing, never by this call. The answer carries gateRunning when a critterstack gate exec of the node is still going: its result is not in until it prints its exit code.
POST /api/plans/{slug}/nodes/{id}/steps
{ "agent": "my-agent", "steps": [
{ "id": "repro", "title": "Reproduce it" },
{ "id": "gate", "title": "Run CommitGate", "gate": "CommitGate" },
{ "id": "specs", "title": "Specs green", "runTag": "my-plan/my-node" } ] }Declares, or replaces, the holder's checklist on the node. A step whose id survives keeps the state it reached. runTag names the run that observably proves the step.
POST /api/plans/{slug}/nodes/{id}/steps/{stepId}
{ "agent": "my-agent", "state": "failed", "note": "two suites red", "exitCode": 1 }state is pending / running / done / failed / skipped. Both step endpoints are holder only, and anyone else gets 409, as for a report. Steps appear on the claim in GET /api/agents, each with the agent's state and, separately, any observed run evidence. They never change the node's status.
POST /api/plans/{slug}/nodes/{id}/questions
{ "agent": "my-agent", "text": "Keep the old wire name?", "options": ["keep", "rename"],
"recommended": "keep", "needs": "person", "session": "$CLAUDE_CODE_SESSION_ID" }The holder asks a person something, the twin of ask_person. It does not park: it answers 200 with the question, and the agent reads the answer off the node later (GET /api/plans/{slug}/nodes/{id} or /conversation). needs is agent (the plan's live lead may answer) or person; left out, the lead while one is alive, else a person. One open question at a time; 409 when the asker does not hold the node. A question never changes the node's status, and dies with the claim.
POST /api/plans/{slug}/nodes/{id}/questions/{questionId}/answer
{ "answer": "keep", "by": "jeremy" }A person's answer, whichever way the question is routed. This is the card's ? answer; the conversation endpoint below is the chat's. No MCP tool answers a question marked for a person: the lead's answer_question takes only one marked agent.
Facts recorded on a node
Two routes record a fact about a node that critterstack then observes or shows. Each takes by, and none has an MCP twin of its own (report_node's pr sends the first):
| Route | |
|---|---|
POST /api/plans/{slug}/nodes/{id}/linked-pr | { number, repo?, url?, by }: a pull request for an issue node that names no closing keyword. Observed and shown like a closing PR; it never closes the node. |
POST /api/plans/{slug}/nodes/{id}/bump-pr | { repo, number, url, by }: the pin-bump PR a consume node rides. Observed like any PR and shown on the node under its merge:; recording the same PR again records nothing. |
A node's conversation
| Route | |
|---|---|
GET /api/plans/{slug}/nodes/{id}/conversation | What is waiting on an answer (the question parked on the claim, with options, recommended and timedOutAt), the agent's context (holder, last report, session, link), and every question and answer so far as entries. |
POST /api/plans/{slug}/nodes/{id}/conversation | A person's reply, { text, by }, to the agent parked on the claim (200). 409 when nothing waits. |
Test-run gate evidence
A gate whose suite reports to no Bobcat monitor is proven by critterstack gate exec, which posts these:
| Route | |
|---|---|
POST /api/plans/{slug}/nodes/{id}/gate-runs | A command started: { runId, step?, command, commit?, dirty, host?, pid?, processStartedAt?, wait? }. The caller mints runId, so a retried POST is the same run. The pid and start time are the wrapper's own: when that process is gone from this machine, an unfinished run reads as abandoned at once. With wait: true, a node whose machine resource is full records nothing and answers { recorded: false, wait } naming who holds it, for the caller to ask again; the answer carries reserved while the machine is reserved for an exclusive node. |
POST /api/plans/{slug}/nodes/{id}/gate-runs/{runId}/finish | It exited: { exitCode, durationSeconds?, outputTail? }. The tail is the last 1 KB of both output streams, shown on the card and the Activity as description, never as evidence. 400 for a run the gate never saw. |
POST /api/plans/{slug}/nodes/{id}/gate-result | An agent's asserted result, { passed, by, note? }, the twin of report_gate_result. The answer says whether it counts. |
POST / DELETE /api/plans/{slug}/nodes/{id}/allow-asserted?by= | A person allows, or stops allowing, asserted results to decide this gate. Relayed over MCP only by the plan's live lead (allow_asserted_results). |
POST /api/plans/{slug}/nodes/{id}/accept-stale?by= | A person accepts a gate's stale pass (one on a dirty tree) as it stands, so what depends on it goes on; refused for a gate with no stale pass. A newer run replaces it. Relayed over MCP only by the plan's live lead (accept_stale_gate_pass). |
DELETE /api/plans/{slug}/nodes/{id}/accept-stale?by= | Take that acceptance back: the gate reads stale again. |
POST /api/plans/{slug}/nodes/{id}/reverify?by= | A person asks for a done gate to be verified again: every pass from before now stops counting, so the gate is ready again. Relayed over MCP only by the plan's live lead (reverify_gate). |
Each is 400 for a node that is not a test-run gate and 404 for no such plan or node. Every start, finish and assertion is an append to the gate's one evidence stream, so steps run side by side (critterstack gate run --parallel) race on it; an append that loses the race is retried a few times after a short random pause, and only a conflict still standing after every attempt is answered 409. A gate's status says what decided it in evidence: run (a Bobcat run under its tag) outranks exec (critterstack gate exec), which outranks asserted. A weaker level is heard only when no stronger one has spoken, so a green exec run never outvotes a red Bobcat run. That order is a gate with no steps. A gate with declared steps is decided by its steps alone: a run under the bare {plan}/{node} tag is named in detail as unassigned and never counts, and each step reads the newer of its Bobcat run and its gate exec --step run.
A person's controls
Each of these records a person's decision on the plan's own stream, with who and when. No worker can use one: an agent able to approve its own work, or take its own PR out of review, is no checkpoint. Each has an MCP twin that only the plan's live lead may call, relaying a person's word with relayFor, recorded as that person's with the lead as relayedBy (see Relaying a person's decision). Each takes { "by": "..." } (or ?by= on a DELETE), and none is ever part of an export, apart from the merge policy, which is a field of the node. See A person's controls for what each one does.
| Route | |
|---|---|
POST / DELETE /api/plans/{slug}/nodes/{id}/approve | The go-ahead for an agent to claim this issue node. 400 for any other kind. Shown as approvedForAgents: { by, at }; changing or rebinding the node clears it. |
POST /api/plans/{slug}/approve | Approve all: { "nodes": [...], "by": "..." }, one go-ahead per node with the same who and when. A node that went done, lost its binding or was approved since is skipped and named. 400 for an empty list, an unknown node, or one that takes no go-ahead. |
DELETE /api/plans/{slug}/approve?node=a&node=b&by= | Withdraw all: those nodes' go-aheads back. |
POST /api/plans/{slug}/nodes/{id}/merge | { "merge": "manual-review" | "merge-on-green", "by": "..." }: the card's merge pill. merge-on-green says the PR may be merged with no review once its checks are green; the server merges nothing. Unlike a node change, it keeps the go-ahead. The only way to turn merge-on-green on besides a person's YAML import. |
POST /api/plans/{slug}/notes · POST /api/plans/{slug}/nodes/{id}/notes | A person's note on the plan or a node: { text, links?, by }. Asserted, shown on the card's ✍ and in the Activity, never exported, and never changes status. An agent's notes ride its claim instead. |
POST / DELETE /api/plans/{slug}/nodes/{id}/accept-partial | Accept a partial node's work as enough: it counts as done, with what was left out still said. DELETE sends it back. |
POST / DELETE /api/plans/{slug}/nodes/{id}/done | Mark a person's node done, or undo it. 400 for any other node: every other node is done by evidence. |
POST /api/plans/{slug}/nodes/{id}/base-fix | { by }: add the fix node for the default branch this node's merge turned red, or answer the one that exists. |
DELETE /api/plans/{slug}/lead?by=&reason= | Clear the plan's lead agent, alive or not. The lead takes it with lead_plan. People only. |
Approving a gate's asserted results and re-verifying a gate are a person's too; they are with the gate evidence above.
A review node
| Route | |
|---|---|
POST /api/plans/{slug}/nodes/{id}/review | The reviewer (the claim holder): { agent, findings: [{ title, brief, severity?, steps?, cause?, repository?, fixKind?, evidence? }], summary?, session? } (a test-run gate's holder too), the twin of submit_review. Submitting again replaces only the undecided findings. |
POST /api/plans/{slug}/nodes/{id}/findings/{findingId}/accept | A person accepts a finding: { node?, by }. Its fix node (a test-run gate by default, titled and briefed by the finding; node edits it first) is added, and the review is linked to depend on it. |
POST /api/plans/{slug}/nodes/{id}/findings/{findingId}/reject | A person rejects it: { reason?, by }. |
POST /api/plans/{slug}/nodes/{id}/review/sign-off?by= | A person signs off a review that found nothing. An empty review is never done until then. |
Only submitting has an MCP twin. A review that could decide its own findings would decide its own completion.
Plans
Reads:
| Route | |
|---|---|
GET /api/plans | Active plans. |
GET /api/plans/{slug} | One plan's full DAG. |
GET /api/plans/{slug}/status | Per-node derived status plus the ready set, the plan's grouped needs, its lead, the machine's reservation and machineResources. Each ready node nobody holds carries launch (reason: next, go-ahead, machine-resource, exclusive; detail). |
GET /api/plans/{slug}/history | Every event on the plan's stream, with who and when. 404 for a stream with no events — the plan never existed here. |
GET /api/plans/{slug}/timeline?limit= | The plan page's Activity, newest first (default 100, at most 2000): the plan's own stream joined with each node's claim, gate-run and GitHub streams and the Bobcat runs tagged for its nodes (source: run, with the run id), one line per change naming its node, who (with the session for a claim), and whether it was asserted or observed. Only news: a renewal is a line when its note changed, a GitHub sweep only for what moved. |
GET /api/plans/{slug}/export | The plan as a schema-1 YAML document, as text. Importing it back (PUT) appends nothing. |
GET /api/plans/archived | Archived plans, newest archive first: slug, title, colour, node count, when and by whom. |
GET /api/plans/{slug}/nodes/{id} | One node, zoomed in (below). |
GET /api/plans/{slug}/nodes/{id}/github | The GitHub text the node is about, on demand (below). |
GET /api/plans/skills | Every skill the active plans' nodes use: what critterstack setup checks this machine for. |
GET /api/plans/feeds | The local folder feeds this server watches, by name: what critterstack setup registers with NuGet. |
Authoring — the same commands the MCP tools send, with by (in the body, or ?by=) naming who:
| Route | |
|---|---|
POST /api/plans | Create: { slug, title?, anchor?, repos?, repoBranches?, color?, branch?, by }. repoBranches is the branch each repository's consume pins are read from, alias or org/name → branch. |
PATCH /api/plans/{slug} | The header: { title?, anchor?, repos?, repoBranches?, color?, branch?, by }; omitted fields keep their value, repoBranches: {} clears them. |
PUT /api/plans/{slug}?by=&checkout= | Import a YAML document (raw body): creates the plan or diffs it in. |
DELETE /api/plans/{slug}?by= | Archive. |
POST /api/plans/{slug}/nodes · PUT /api/plans/{slug}/nodes/{id} | Add, or replace wholesale: { node: { … }, by, checkout? }. |
DELETE /api/plans/{slug}/nodes/{id}?by= | Remove; refused while anything depends on it. |
POST / DELETE /api/plans/{slug}/nodes/{id}/depends-on | Link or unlink: { dependsOn, by }. |
POST /api/plans/{slug}/nodes/{id}/bind | { repo?, issue?, pr?, by }. |
PUT /api/plans/{slug}/resources | The plan's shared resources, replaced whole: { resources: { "postgres": 1 }, machine?: [...], by }; the names in machine are the whole machine's, which the server holds. |
POST /api/plans/rescan | Re-import the plans directory (below). |
A merge-on-green in a person's import is honoured; the MCP tools refuse it. With checkout (or ?checkout= on the import) naming a local clone, each dotnet test gate step is checked against it (the project exists, is a test project, targets the -f framework), and what is wrong comes back as warnings beside the result. Without one nothing is checked. A warning never refuses the save.
TIP
The depends-on endpoints take the dependency in the body or query, not the path — a cross-plan reference is plan/node, and a slash in a path segment does not survive routing.
POST /api/plans/rescan re-imports the CritterStack:PlansPath directory, which startup also does. The store is the master copy: a file creates a plan the store has never had, and is otherwise ignored — whatever it says, and whether the stored plan is active or archived. So a stale file cannot undo an edit made over the API or MCP, and an archived plan stays archived. The itemized report names each file's outcome: imported, stored, archived, purged or failed. To change a stored plan from a document, PUT /api/plans/{slug} (or import_plan) — importing it there is the deliberate act, and diffs it in, removals included.
One node
GET /api/plans/{slug}/nodes/{id} is everything critterstack knows about one node in one read: what the plan page's node modal shows, and what the get_node MCP tool returns.
| Field | |
|---|---|
node | The card's own view, exactly the node's entry in /status: status, PRs with CI and review, claim health. The zoom never disagrees with the card. |
readiness | Why it is or is not ready, in words: ready, waiting on `fix` , ready, awaiting a go-ahead, ready, held back until heavy has room, running now. Presentation over the derived status; nothing reads it back. |
url, brief, repository | Where its binding lives, the author's brief (Markdown), and the repository it is attributed to. |
dependsOn, unblocks | Its neighbours across plans, each with plan, id, title, kind, status and ready: what it waits on, and what depends on it directly. |
claim | The node's latest claim, live or not: agent, claimedAt, expiresAt, lastActivityAt, live, released, session, the holder's note and its steps. |
questions | Every question asked on that claim, answered and open. |
notes | Every note a person left on the node, oldest first. |
gateRuns | A test-run gate's critterstack gate exec runs, newest first, with exit code and output tail. |
timeline | This node's lines of the plan's Activity, newest first (at most 100). A run line carries the run it is about. |
runs | Every Bobcat run the console holds that is tagged for the node, one of its gate steps or a step its holder declared, newest first (at most 25): runId, tag, step, unit, suite, state (running, passed, failed, orphaned), exitCode, startedAt, the counts, progress (live, for a run in flight) and href (the run on the console). |
recall | The repository's notes, and the memories filed under the plan and the repository, newest first: what recall would give an agent starting it. |
404 for no such plan or node, or a plan with document errors.
GET /api/plans/{slug}/nodes/{id}/github fetches the GitHub text the node is about, through the GitHub sweep's own token: an issue node's issue (title, body, labels, milestone, its ten most recent comments and the total) and its closing PRs, a pr node's PR. Each PR carries its description, state, review decision, mergeability, diff stat (additions, deletions, changedFiles), recent comments and every check on its head, failing ones first. A failing check carries its summary and first annotations, and a failing GitHub Actions job the last 40 lines of its log. Answers are cached for a minute (?refresh=true asks again) and never stored in the plan. When there is nothing to read, unavailable says why: no GitHub token, a node not bound yet, a kind with no GitHub thing behind it, or GitHub's own refusal. Bodies are GitHub's Markdown as written; the page renders them without ever injecting HTML.
POST /api/plans/{slug}/purge
Hard archive: delete an archived plan for good, with its claims (and their steps) and its publish baselines. Body { "confirm": "<the slug again>", "by": "..." }. The plan's YAML is written to CritterStack:PurgedPath (default ~/.critterstack/purged/{slug}-{timestamp}.yaml) before anything is deleted, and importing that file is the only way back. A plans-directory file for a purged plan is not brought back (purged in the rescan report); an explicit PUT or create_plan of the slug still works.
People only: there is no MCP tool. 400 when confirm is not the slug, 404 for no such plan, 409 when the plan is active (archive it first) or an active plan depends on one of its nodes. Run evidence and memories filed under the plan are not touched.
Repositories
GET /api/repositories and GET /api/repositories/{owner}/{name} — read. Registering, declaring and note-taking are MCP-only.
GET /api/repositories/icons — every repository with an icon of its own, slug → the URL to load it from. A repository with none is left out, so the page asks for nothing it cannot show.
GET /api/repositories/{owner}/{name}/icon — the icon itself, cached a day by the browser, 404 when the repository has none. An SVG is served sandboxed, with no scripts allowed, so an icon opened on its own never runs in critterstack's origin.
GET /api/repositories/lanes — one lane per repository: its agents, every plan's items attributed to it (being worked, ready, waiting; done counted), and its five most recent runs.
Two repository facts are a person's, each with by (and reason) as a query string or a JSON body, relayed over MCP only by a plan's live lead:
| Route | |
|---|---|
POST / DELETE /api/repositories/{owner}/{name}/ci-off | Turn the repository's CI off on purpose, with a reason, or back on. See CI off. |
POST / DELETE /api/repositories/{owner}/{name}/gates/{gate}/stand-in | Let a declared commit or push gate stand in for CI for a merge-on-green PR, or take that back. See A repository's own gates. |
Memories
What agents have learned, the REST twins of the memory MCP tools.
| Route | |
|---|---|
GET /api/memories | Browse, newest change first. ?scope=repository/JasperFx/critterstack (a scope path), kind=, repeated tag= (AND-ed), archived=true, page=, pageSize=. |
GET /api/memories/search?q= | The same recall recall runs, best first, each hit naming the legs that found it. Takes the same filters, and limit=. |
GET /api/memories/facets | The scopes, kinds and tags in use, with counts. |
GET /api/memories/{id} | One memory in full: body, links both ways, and its whole history. 404 for none. |
POST /api/memories/{id}/revise | { by, title?, body?, tags?, kind?, confidence?, reason? } — only what is given changes. 400 for an immutable memory. |
POST /api/memories/{id}/refile | { by, scope, scopeKey? } |
POST /api/memories/{id}/links | { by, targetId, relationship } |
POST /api/memories/{id}/archive | { by, reason? } — out of recall and listings; the history stays. |
POST /api/memories/{id}/restore | { by } |
There is no delete: a memory is an event stream, and archive is the verb that can be undone.
The run monitor's ingest receipt
POST /api/ingest reads its batch one record at a time. A record whose type this console has no contract for (a newer Bobcat's additive kind) is skipped and counted, never fatal: the records beside it are still recorded, and the 202 carries a receipt, { accepted, skipped, unknownKinds, malformed }. A body with no events array is still the sender's error (400). GET /api/ingest/skipped is the count since the console started, by kind, for the question "why are this publisher's events not showing up".
GET /api/runs/{id} also carries progress.passed / failed / retried / workersBusy (the verdict split of a supervised run's live count; null from a Bobcat that does not send it) and the summary's droppedEvents (events the publisher dropped under load; null when none).
See also
- MCP tool reference — the same surface for agents that speak MCP
- Working a plan with a supervising agent — the loop these routes serve
- Ports and wire contracts — the one port, the run console's routes, and
bobcat ui
