clankie

API

Worker and lead routes

Reference for the routes Clankie's own worker plugin, the lead's seat and MCP clients call.

On this page

This page lists the routes that Clankie's own agents call. The worker plugin, running inside a hired worker's seat, calls the worker seat routes. These accept no bearer token: only the worker plugin can call them, from its own seat. The lead's seat calls the lead seat routes with the lead token or the operator token. Both sides also reach Clankie's tools over MCP. To build on Clankie, use the tools these plugins expose (such as message_clankie, message_peer, submit_for_review, evidence_push, clankie_tools and clankie_call) instead of calling these routes directly. This page has no curl examples for worker seat routes.

Every error body has the form {"error": "<code>"}. Some also carry a detail string.

Worker seat routes

Every path starts with /v1/fleet/seats/:paneId/, where :paneId is the Herdr pane the worker sits in. A route acts only for the seat in that pane.

Events

Inbound messages for the worker, and its harness's hooks.

Auth: Worker seat. The operator token or the lead token is also accepted.

Method Path What it does
GET /v1/fleet/seats/:paneId/events Long-polls the seat's inbox. Query wait sets the wait in milliseconds (at most 30000). Returns {schemaVersion, events} with up to 64 events.
POST /v1/fleet/seats/:paneId/events/:id/ack Acknowledges one event. Returns {schemaVersion, acknowledged, eventId, deliveryStage: "delivered"}, or 404 unknown_event.
POST /v1/fleet/seats/:paneId/hook Records a Claude Code seat's SessionStart, UserPromptSubmit, Stop, StopFailure and SessionEnd hooks. For PermissionRequest, and PreToolUse on AskUserQuestion, it holds the request open until the owner answers, then returns the hook output.
POST /v1/fleet/seats/:paneId/permission Passes on a permission prompt from Claude Code's channel and holds it until the owner answers. Returns {schemaVersion, requestId, sessionId, hookOutput}.

Each event has schemaVersion, id, kind (wake, watch, escalation, message or turn), conversationId, source, content and createdAt, plus ownerOrigin on an owner's turn.

Status error When
404 unknown_seat The pane has no seat yet, or the hook's session is not the one in the pane.
400 invalid_request The hook body does not match the hook schema.
400 invalid_native_permission_request The permission body or its bridge header is malformed.
404 native_permission_unavailable The pane holds no Claude Code session.
503 service_shutting_down The service is stopping.

Reports to the lead

What the worker plugin's message_clankie, message_clankie_status and list_report_leads tools call.

Auth: Worker seat.

Method Path What it does
GET /v1/fleet/seats/:paneId/messages Returns {schemaVersion, binding}: the seat's current binding, which every report names.
GET /v1/fleet/seats/:paneId/messages/leads Returns {schemaVersion, leads}: the leads this seat may report to, each {id, conversationId}.
POST /v1/fleet/seats/:paneId/messages Sends one report to the seat's lead.
GET /v1/fleet/seats/:paneId/messages/:id Reads back the receipt of an earlier report. Takes query binding and fingerprint from that report's receipt. Never resends it.
GET /v1/fleet/seats/:paneId/messages/:id/status Returns how far a report got. Add definitive=1 to also get definitive.

Send a report

POST /v1/fleet/seats/:paneId/messages

Request body (JSON)

Field Type Required Description
schemaVersion 1 yes Always 1.
text string yes The report, 1 to 16384 characters after trimming.
delivery.id string (UUID) yes A new ID per report. Reuse it only to retry the same report.
delivery.binding string yes The binding from GET messages, 64 hex characters.
target string no A lead id from GET messages/leads. Without it the report goes to the lead that hired the seat.
kind string no done, blocked or update. A blocked report reaches the lead at once.
urgent boolean no true makes the lead hear the report at once rather than with its next round of reports.

Response 200 (also returned by GET messages/:id)

Field Type Description
schemaVersion 1 Always 1.
received boolean Whether Clankie accepted the report.
deliveryStage string stored, uncertain, rejected or unavailable.
deliveryId string The delivery.id sent.
binding string The delivery.binding sent.
fingerprint string A 64-hex fingerprint of the report, used to read the receipt back.
detail string Why a report was refused, when it was.
definitive "not_sent" Present when Clankie has recorded that this report will never be sent.

Response of GET messages/:id/status 200

Field Type Description
schemaVersion 1 Always 1.
deliveryId string The report's ID.
deliveryStage string stored, delivered, consumed, responded, unavailable, uncertain, expired or rejected.
definitive "not_sent" Only with definitive=1, when the report will never be sent.

Errors

Status error When
403 native_seat_required The request did not come from the worker in that pane, or the pane is on another machine.
400 invalid_request The body, the ID or the query is malformed.
400 delivery_id_required The report has no delivery.
404 unknown_native_session GET messages: the pane has no agent session.
404 unknown_message_receipt GET messages/:id/status: no report with that ID from this seat.
403 native_session_required GET messages/:id/status: the seat changed during the read.
503 fleet_admission_unavailable The seat could not be checked yet. The body has retryable: true. Retry shortly.

Peers

What the worker plugin's list_fleet_seats and message_peer tools call. Peer messages stay on this machine and carry no owner authority. They work only while the owner's peer messages setting is on.

Auth: Worker seat.

Method Path What it does
GET /v1/fleet/seats/:paneId/peers Lists the other seats on this machine this seat can message.
POST /v1/fleet/seats/:paneId/peer-messages Sends one message to another seat.
GET /v1/fleet/seats/:paneId/peer-messages/:id Reads back the receipt of an earlier peer message. Takes query binding and fingerprint from its receipt. Never resends it.

List peers

Response 200

Field Type Description
schemaVersion 1 Always 1.
fleet string The fleet the seats belong to.
sender object This seat, in the same shape as each entry in seats.
seats object[] The other seats.
seats[].seatId string The seat's ID, used as seatId when sending.
seats[].paneId string The seat's Herdr pane.
seats[].binding string The seat's current binding, used as recipientBinding when sending.
seats[].harness string The agent harness, such as claude or codex.
seats[].title string The pane title, as the seat set it.

Send a peer message

POST /v1/fleet/seats/:paneId/peer-messages

Request body (JSON)

Field Type Required Description
schemaVersion 1 yes Always 1.
seatId string yes The recipient's seatId from GET peers.
recipientBinding string yes The recipient's binding from GET peers.
text string yes The message, 1 to 32768 characters after trimming.
delivery.id string (UUID) yes A new ID per message.
delivery.binding string yes The sender's own binding (sender.binding from GET peers).

Response 200 (also returned by GET peer-messages/:id)

Field Type Description
schemaVersion 1 Always 1.
deliveryId string The delivery.id sent.
binding string The sender's binding.
seatId string The recipient seat.
recipientBinding string The recipient's binding.
fingerprint string A 64-hex fingerprint of the message, used to read the receipt back.
deliveryStage string stored, delivered, consumed, uncertain, recipient_gone, superseded, rejected or unavailable.
outcome string delivered, unconfirmed, undelivered or offline.
detail string What happened, when there is more to say.
messageId string The delivered message's ID, when known.
state string queued, started or steered, when known.

A refused send still answers 200, with deliveryStage rejected and the reason in detail. While an earlier message to the same seat is uncertain, a new one to that seat is refused.

Errors

Status error When
403 native_peer_sender_required The request did not come from the worker in that pane.
403 peer_messages_disabled GET peers: the owner turned peer messages off.
403 peer_messaging_unavailable GET peers: the seat list could not be read for this sender.
400 invalid_peer_message The body does not match the schema.
400 invalid_peer_receipt GET peer-messages/:id: the ID, binding or fingerprint is malformed.
404 unknown_peer_receipt GET peer-messages/:id: no such message from this seat. The body also has deliveryStage: "uncertain".

Reviews

What the worker plugin's submit_for_review, review_candidate and review_verdict tools call. A project that names a reviewer holds its landings until the reviewer approves the exact patch.

Auth: Worker seat. The author submits from its own seat, and the reviewer records a verdict from its own seat.

Method Path What it does
POST /v1/fleet/seats/:paneId/review-candidates Submits a patch for review. Returns {schemaVersion, candidate}. Submitting the same patch again returns the same candidate.
GET /v1/fleet/seats/:paneId/review-candidates/:id Reads a candidate and its patch. Only the author and the project's reviewer can read it. Returns {schemaVersion, candidate, patch}, where patch is base64.
POST /v1/fleet/seats/:paneId/review-verdicts Records the reviewer's verdict on a candidate. Returns {schemaVersion, candidate}.

Submit a candidate

POST /v1/fleet/seats/:paneId/review-candidates

Request body (JSON)

Field Type Required Description
schemaVersion 1 yes Always 1.
base string yes Full commit ID of the base (40 to 64 hex).
head string yes Full commit ID of the head (40 to 64 hex).
patchId string yes git patch-id --verbatim of the patch (40 to 64 hex). Must match what Clankie computes.
patch string yes The git diff --binary BASE HEAD bytes, in canonical base64. At most 4 MiB before encoding.
summary string yes What the change does, 1 to 4000 characters.
issue string no The tracker issue, one line, up to 64 characters.
evidence string[] no Up to 20 links for the reviewer to check, one line each, up to 2048 characters.
supersedes string (UUID) no The earlier candidate this one replaces.
checkout string no The work-tree root the patch came from. It decides the project. Without it, the seat's own directory decides.

Record a verdict

POST /v1/fleet/seats/:paneId/review-verdicts

Request body (JSON)

Field Type Required Description
schemaVersion 1 yes Always 1.
candidateId string (UUID) yes The candidate's id.
patchId string yes Must equal the candidate's patchId.
verdict string yes approve or changes.
findings string[] for changes Up to 50 required changes, each up to 4000 characters. changes needs at least one.
summary string no Up to 4000 characters.

Candidate object

Field Type Description
schemaVersion 1 Always 1.
id string (UUID) The candidate's ID.
projectId string The project the checkout belongs to.
status string awaiting_review, changes, approved, waived or superseded.
patchId string The patch ID Clankie computed.
patchSha256 string SHA-256 of the stored patch bytes.
bytes integer Size of the patch in bytes.
files string[] The files the patch touches.
base, head string The commits submitted.
issue string The issue, when given.
summary string The author's summary.
evidence string[] The evidence links.
author object The submitting seat: seatId, occupantId, harness, title.
supersedes, supersededBy string Links to the candidates this one replaced or was replaced by.
submittedAt string ISO 8601 time.
reviewer object The reviewer seat chosen for this candidate, with deliveryStage, detail and at.
verdict object Once decided: verdict, findings, summary, reviewer, sameHarness (author and reviewer ran the same harness) and at.
waiver object When the owner or the lead waived review: actor, conversationId, reason, at.

Errors

Review refusals carry a detail that says why.

Status error When
403 native_seat_required The request did not come from the worker in that pane.
400 invalid_review_submission The submission does not match the schema.
400 invalid_review_verdict The verdict does not match the schema, for example changes with no findings.
400 invalid_patch The patch is not canonical base64 diff bytes.
409 patch_id_mismatch The patchId does not match the patch, or the candidate.
409 no_project The checkout belongs to no project. Nothing was stored.
409 no_reviewer The project names no reviewer, so it needs no review. Nothing was stored.
404 unknown_candidate No candidate has that ID.
403 not_reviewer The seat is not the author or the project's reviewer, or the author tried to record a verdict.
409 superseded The candidate was replaced by a newer one.
409 already_decided The candidate already has a verdict.
503 store_unavailable The review store could not be read.

Evidence

What the worker plugin's evidence_push tool calls. The seat registers a file's metadata first and then uploads the bytes to the returned uploadUrl. Records name the seat as their actor.

Auth: Worker seat.

Method Path What it does
POST /v1/fleet/seats/:paneId/evidence-uploads Registers one evidence file and returns its receipt. The same idempotencyKey always returns the same receipt.
GET /v1/fleet/seats/:paneId/evidence-uploads/:receiptId Reads a receipt this seat created.

Register an upload

POST /v1/fleet/seats/:paneId/evidence-uploads

Request body (JSON)

Field Type Required Description
idempotencyKey string yes 16 to 128 characters from A-Z a-z 0-9 _ -. It becomes the receiptId.
sha256 string yes SHA-256 of the file, 64 lowercase hex.
size integer yes File size in bytes.
contentType string yes Media type, such as image/png.
fileName string yes One line, up to 1024 characters.
issueKey string no The tracker issue, up to 64 characters.
commit string no A 40- or 64-hex commit ID.
project string no Project, up to 256 characters.
repo string no Repository, up to 1024 characters.
model string no The model that produced it, up to 256 characters.
outcome string no passed, failed or partial.
caption string no Up to 4000 characters.

Response 200 (also returned by the GET)

Field Type Description
receiptId string The receipt's ID (the idempotencyKey).
state string applied, pending or refused.
sha256 string The file's hash.
size integer The file's size.
url string The evidence link, clankie://evidence/sha256/<sha256>.
recordId string (UUID) The evidence record, once applied.
uploadUrl string Only while pending: where to PUT the bytes. It needs no token and expires.
uploadExpiresAt string When uploadUrl expires.
refusal string sha256_mismatch or size_mismatch when the bytes did not match.

Errors

Status error When
403 native_seat_required The request did not come from the worker in that pane, or the pane is on another machine.
400 invalid_request The body does not match the schema.
409 idempotency_conflict The idempotencyKey was used before with a different body.
404 unknown_receipt GET: this seat has no receipt with that ID.
503 fleet_admission_unavailable The seat could not be checked yet. Retry shortly.

Owner asks

What the worker plugin's raise_owner_install and await_owner_install tools call. A worker asks the owner to approve installing one exact build on one of the owner's devices. The owner answers with one tap in the paired app, and the worker reads the signed approval back. Asks stay open for 30 minutes. A service restart drops open asks, and the worker raises again with a new askId.

Auth: Worker seat.

Method Path What it does
POST /v1/fleet/seats/:paneId/owner-asks Raises an install ask. Returns {card, owner}.
GET /v1/fleet/seats/:paneId/owner-asks/:askId Reads the state of an ask this seat raised. Query waitMs waits up to 25000 ms for it to settle. Returns {askId, state, approval, owner}.

Raise an install ask

POST /v1/fleet/seats/:paneId/owner-asks

Request body (JSON, at most 4 KiB)

Field Type Required Description
schemaVersion 1 yes Always 1.
kind "install" yes Always install.
askId string (UUID) yes A new lowercase UUID.
app string yes App name as the owner sees it, 1 to 80 characters.
build string yes The full 40-hex commit the build was made from.
target.id string yes The device as platform:id, such as ios:<UDID>.
target.name string yes The device's name, 1 to 80 characters.
target.kind string yes iphone, ipad, watch, mac, pc or other.
launch boolean yes Whether the worker may also open the app to check it.
project string yes Project, 1 to 128 characters.
issue string no Tracker issue, up to 64 characters.

Response 200

Field Type Description
card.askId string The ask's ID.
card.kind "install" The ask's kind.
card.state string open, approved, declined or expired.
card.raisedAt, card.expiresAt string ISO 8601 times. The ask closes unanswered at expiresAt.
card.worker object The raising seat, filled in by Clankie: seatId, occupantId, displayName.
card.install object app, build, target and launch, as raised.
card.project, card.issue string As raised.
card.binding object Exactly what the owner's device signs when it approves.
card.decidedAt string When the owner answered.
owner object or null The paired owner's ownerId and device keys (deviceKeyId, ownerId, publicKey, revokedAt), used to check an approval. null while no single owner has a key.

The GET returns askId, state, approval (the signed approval, once approved) and owner in the same shape.

Errors

Status error When
401 seat_authentication_required The request did not come from the worker in that pane.
503 seat_authentication_unavailable Seat checks are unavailable on this service.
400 invalid The body does not match the schema.
409 duplicate An ask with that askId already exists.
429 full 200 asks are already held.
404 not_found GET: no ask with that ID was raised by this seat.

Lead seat routes

The lead's own seat bridge and its launcher call these routes. They take the lead token or the operator token. The service also checks that the call comes from the lead's own seat.

Method Path What it does Credential
GET /v1/seat/events Long-polls one conversation's lead inbox (query conversationId, wait up to 30000 ms). Returns {schemaVersion, events}. Lead token or operator token, from the lead's seat
POST /v1/seat/events/:id/ack Acknowledges one event. Lead token or operator token, from the lead's seat
POST /v1/seat/events/:id/reply Answers one event with {schemaVersion: 1, text}. The text lands in the conversation as the lead's reply. Lead token or operator token, from the lead's seat
GET /v1/captain/seat-bindings Reports which conversations have a registered lead seat and the state of each seat, for clankie doctor. Lead token or operator token
PUT /v1/captain/seat-bindings Registers the lead harness a launcher just started for a conversation. Lead token or operator token, from that launcher
DELETE /v1/captain/seat-bindings Removes a launcher's registration for the conversation in query conversationId. Lead token or operator token, from that launcher

MCP endpoints

Both endpoints speak the Model Context Protocol over streamable HTTP. A POST with an initialize request opens a session, and the response's mcp-session-id header names it. Later requests send that header. Responses are plain JSON. DELETE with the header ends the session.

Lead tools

POST /v1/mcp

The lead's tools for one conversation. The lead's seat connects with ?conversationId=<id>.

Auth: Lead token or operator token, from the lead's own seat.

The tools that run:

Tool What it does
request_user_input Asks the owner a question from this conversation, optionally with a default action and deadline.
cancel_question Cancels this conversation's own pending owner question.
get_wake Reads whether Auto is on and this conversation's pending self-wake.
schedule_wake Schedules a self-wake for this conversation at a set time, for a stated reason.
cancel_wake Cancels this conversation's pending self-wake.
report_continuation Records whether the lead's work is active, paused, complete or blocked on an owner decision.
hire_agent Hires one worker for this conversation. Needs harness (claude or codex), brief, effort and effortReason.
message_seat Sends one message to a seat this conversation hired.
reconcile_seat_call Reads the receipt of an earlier message_seat or hire_agent call. Never resends.

Errors

Status error When
401 authentication_required No valid token.
400 invalid_conversation conversationId is empty or longer than 256 characters.
403 seat_binding_required The call did not come from a registered lead seat for that conversation.
404 unknown_captain_conversation Clankie has no such conversation.
403 lane_forbidden The token's lane cannot name a conversation, or a session is reused with a different token or conversation.
404 unknown_session The mcp-session-id is unknown or expired. Sessions expire after an hour idle.
400 session_required A GET or DELETE without a session.

Worker tools

POST /v1/fleet/mcp

The worker plugin's connection to Clankie's tools.

Auth: Worker seat.

Tool What it does
clankie_tools Searches the tools this seat can call, by query or by names, and returns their schemas.
clankie_call Calls one of those tools by name with its arguments. A write gets a receipt ID. If a call's result is uncertain, reconcile with {receiptId} and never repeat the call.

The tools behind clankie_call are the tracker tools for the seat's project, named linear_<verb>. They act on the tracker of the project the seat's checkout belongs to, or on a registered repo the call names. Calls for a project tracked in Linear are refused before they run. Neither tool is listed while the owner has fleet tools turned off.