clankie

API

Work, reviews and evidence

HTTP routes for work items, tracker tool calls, Linear and GitHub wake settings, the review gate, and the evidence store.

On this page

This page covers the routes for tracked work: work items in a repo's tracker, direct tracker tool calls, request budgets, Linear and GitHub wake settings, the owner's side of the review gate, and the evidence store. Most routes take the Operator token. Routes that change the owner's wake rules, the follow switch, or review waivers also accept a Device session with Take Control from a device the owner paired. Two evidence routes take no bearer: they work only through a signed link the service handed out.

Work items

POST /v1/work is one endpoint with an action field. Each action reads or writes the tracker a registered repo has saved (Markdown files, GitHub issues, Linear, or Clankie's built-in tracker). A repo is named by its registered id. With the Operator token you may also name an absolute checkout path, which registers the repo on first use.

All /v1/work actions share these errors:

Status error When
401 operator_authentication_required No valid Operator token.
503 operator_authentication_unavailable The operator credential can't be checked.
400 invalid_work_request The body doesn't match any action's schema. detail names the first problem.
404 unknown_repo No registered repo with that id.
404 not_found No work item with that id.
400 invalid The request is well formed but not allowed, for example a comment on a tracker other than GitHub issues.
409 needs_decision The repo has no saved tracker and discovery found more than one candidate. Carries question and signals.
409 backend_unavailable The repo's tracker can't be reached or doesn't support the read.
409 result_too_large Too many registered repos to list at once.
409 posting_refused The project's "Posting to your tracker" setting, or Watch, stopped the write. Nothing was written.
409 posting_held The write waits for a decision. See held posts.
502 work_request_failed The tracker call failed. detail holds up to 500 characters.

Error bodies carry error and detail, plus question and signals when present.

Work item object

Actions that return an item use this shape.

Field Type Description
id string Tracker-native id, such as W-ab12cd, #42 or a Linear key.
parent string Parent item id, when it has one.
title string Single-line title, up to 200 characters.
status string backlog, todo, in_progress, in_review, done or canceled.
priority integer 0 none, 1 urgent, 2 high, 3 medium, 4 low.
milestone object id and name, when set.
owner string Who owns the item.
dependsOn string[] Ids of items this one waits on.
summary string The item's full body text.
criteria object[] Acceptance criteria: text and done.
evidence object[] Attached evidence: kind, url, caption.
location string Issue URL or repo-relative file path.
updatedAt string Last update time, when the tracker gives one.
labels string[] The tracker's own labels.
heldBy string[] Live seats working on the item now.
trackerStatus string The tracker's own status, when it differs from status.

The repo object (repo in responses) has id, name, root (the checkout path), backend (when a tracker is saved) and needsDecision (true when no tracker is saved yet).

List registered repos

POST /v1/work with "action": "repos"

Lists every repo registered for work tracking on this machine.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes repos.

Response 200

Field Type Description
repos object[] Repo objects.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"repos"}'

List work items

POST /v1/work with "action": "list"

Lists items from the repo's saved tracker.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes list.
repo string yes Registered repo id or absolute checkout path.
status string[] no Up to 6 statuses to include.
owner string no Only items with this owner.
label string no Only items with this label (1 to 64 characters).
limit integer no 1 to 250. Default 250.

Response 200

Field Type Description
repo object The repo.
items object[] Work item objects.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"list","repo":"'"$REPO_ID"'","status":["todo","in_progress"],"limit":50}'

Show a work item

POST /v1/work with "action": "show"

Reads one item.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes show.
repo string yes Registered repo id or absolute checkout path.
id string yes Item id.

Response 200

Field Type Description
repo object The repo.
item object The work item.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"show","repo":"'"$REPO_ID"'","id":"'"$ITEM_ID"'"}'

Read item activity

POST /v1/work with "action": "activity"

Reads an item's comments and state changes, oldest first, up to the latest 200 entries. A tracker that keeps no readable comments answers 409 backend_unavailable.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes activity.
repo string yes Registered repo id or absolute checkout path.
id string yes Item id.

Response 200

Field Type Description
repo object The repo.
itemId string The item id.
entries object[] Activity entries.
entries[].id string Entry id.
entries[].kind string comment or state.
entries[].at string When it happened.
entries[].actor string Who did it, when the tracker says.
entries[].body string A comment's Markdown body.
entries[].replyTo string The comment this one answers.
entries[].state string The tracker's name for the state entered.
entries[].status string The unified status for that state.
entries[].attachments object[] url and optional title.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"activity","repo":"'"$REPO_ID"'","id":"'"$ITEM_ID"'"}'

Discover a repo's tracker

POST /v1/work with "action": "discover"

Looks through the repo for signs of where it tracks work and returns them beside the saved choice, if there is one.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes discover.
repo string yes Registered repo id or absolute checkout path.

Response 200

Field Type Description
repo object The repo.
signals object[] What was found: kind (linear, github, markdown, todo_file, adr), detail, and optional suggests.
convention object The saved tracker choice, when one exists.
question string The question to put to the owner, when nothing is saved and the signals disagree.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"discover","repo":"'"$REPO_ID"'"}'

Record a repo's tracker

POST /v1/work with "action": "init"

Saves where the repo tracks its work. Omitted fields are filled from discovery; when discovery can't decide, the call answers 409 needs_decision.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes init.
repo string yes Registered repo id or absolute checkout path.
backend string no default, markdown, github, linear or builtin.
directory string no For markdown: the repo-relative folder of item files.
githubRepo string no For github: owner/name.
linearTeam string no Linear team key.
linearProject string no Linear project.
linearLabel string no Existing Linear label for this repo's board.
previous string no linear keeps the recorded Linear scope readable beside a new tracker; none drops it.
releaseSource string no tags, milestones or both.
releaseLane string no Release lane name.
decisions string no Where the repo records decisions.
note string no Up to 1000 characters.

Response 200

Field Type Description
repo object The repo.
convention object The saved choice: backend, decidedBy, decidedAt and the backend's own fields.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"init","repo":"'"$REPO_ID"'","backend":"markdown"}'

Read project facts

POST /v1/work with "action": "project"

Reads the repo tracker's planned releases, shipped versions and goals. If the saved tracker choice changes during the read, the call answers 400 invalid.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes project.
repo string yes Registered repo id or absolute checkout path.

Response 200

Field Type Description
repo object The repo.
releaseSource string tags, milestones or both.
planned object[] Planned releases: id, name, targetDate, itemIds.
shipped object[] Shipped versions: version, lane, date, dateKind (tag, commit, published), itemIds, location.
goals object[] Goals: id, name, status, targetDate, projects.
unavailable object[] Reads that failed or aren't supported: read (planned, shipped, goals) and message.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"project","repo":"'"$REPO_ID"'"}'

Read project details

POST /v1/work with "action": "project-details"

Reads the tracker project's own description, status, resources and status updates.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes project-details.
repo string yes Registered repo id or absolute checkout path.

Response 200

Field Type Description
repo object The repo.
id string Project id.
name string Project name.
identifier string Project identifier, when the tracker has one.
summary string Short summary.
description string Full description.
status string Project status.
priority integer 0 to 4.
lead string Project lead.
startDate string Start date.
targetDate string Target date.
teams string[] Team names.
resources object[] Links: title, url.
updates object[] Status updates: id, health, author, body, createdAt, attachments, replies, replyCount, repliesTruncated.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"project-details","repo":"'"$REPO_ID"'"}'

Create a work item

POST /v1/work with "action": "create"

Creates an item in the repo's saved tracker. The write is Clankie's: on GitHub issues or Linear it goes through the project's "Posting to your tracker" setting, and while Watch is on it is refused.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes create.
repo string yes Registered repo id or absolute checkout path.
title string yes 1 to 200 characters.
summary string no Body text.
owner string no Owner, up to 128 characters.
criteria string[] no Up to 50 acceptance criteria.
dependsOn string[] no Up to 50 item ids.
status string no Initial status.
priority integer no 0 to 4.

Response 200

Field Type Description
repo object The repo.
item object The new work item.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"create","repo":"'"$REPO_ID"'","title":"Fix login timeout","criteria":["Login succeeds within 5 seconds"]}'

Update a work item

POST /v1/work with "action": "update"

Changes fields of an existing item and optionally adds a comment in the same write. Comments are accepted only for GitHub issues; on other trackers a comment answers 400 invalid before anything is written. The same posting and Watch checks as create apply.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes update.
repo string yes Registered repo id or absolute checkout path.
id string yes Item id.
status string no New status.
priority integer no 0 to 4.
owner string or null no New owner; null clears it.
title string no New title.
dependsOn string[] no Replaces the dependency list.
addDependsOn string[] no Adds dependencies.
addLabels string[] no Adds labels.
removeLabels string[] no Removes labels.
check integer[] no 1-based criteria numbers to mark done.
uncheck integer[] no 1-based criteria numbers to mark not done.
addCriteria string[] no Adds acceptance criteria.
comment string no Comment posted after the change (GitHub issues only).

Response 200

Field Type Description
repo object The repo.
item object The updated work item.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"update","repo":"'"$REPO_ID"'","id":"'"$ITEM_ID"'","status":"in_review","check":[1]}'

Attach evidence to a work item

POST /v1/work with "action": "attach"

Adds one evidence entry to an item. The same posting and Watch checks as create apply.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes attach.
repo string yes Registered repo id or absolute checkout path.
id string yes Item id.
evidence.kind string yes image, video, log or link.
evidence.url string yes An http(s) link or repo-relative path, up to 2048 characters.
evidence.caption string yes What the artifact proves, single line, up to 500 characters.

Response 200

Field Type Description
repo object The repo.
item object The updated work item.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"attach","repo":"'"$REPO_ID"'","id":"'"$ITEM_ID"'","evidence":{"kind":"link","url":"https://example.com/run/1","caption":"CI run with the fix passing"}}'

Make an owner write

POST /v1/work with "action": "write"

Makes one narrow change to an existing item and settles it in a durable receipt under requestId. A request id is never dispatched twice: repeating it returns the stored receipt. The repo must be named by its registered id. With the Operator token the write is Clankie's for the owner, so on GitHub issues it goes through the project's posting setting. Repos that track work in Linear refuse this action.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes write.
request.repoId string yes Registered repo id.
request.itemId string yes Item id.
request.requestId string yes UUID chosen by the caller.
request.command.action string yes assign, add_label, remove_label or add_dependency.
request.command.owner string or null for assign New owner; null unassigns.
request.command.label string for labels Label, up to 64 characters.
request.command.id string for add_dependency Id of the item this one waits on.

Response 200

The response is always a receipt, also when the write was refused.

Field Type Description
requestId string The request id.
outcome string applied, refused or uncertain. uncertain means the write may have happened; read the receipt and the tracker, and never resend.
message string Plain-words result.
item object The updated work item, when applied.
sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"write","request":{"repoId":"'"$REPO_ID"'","itemId":"'"$ITEM_ID"'","requestId":"'"$REQUEST_ID"'","command":{"action":"add_label","label":"bug"}}}'

Read an owner write receipt

POST /v1/work with "action": "write_receipt"

Returns the receipt of an earlier write, for the same owner, item and saved tracker. It never dispatches anything.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
action string yes write_receipt.
request.repoId string yes Registered repo id.
request.itemId string yes Item id.
request.requestId string yes The original write's UUID.

Response 200

Same receipt shape as Make an owner write. When no receipt matches, outcome is refused.

sh
curl -sS http://127.0.0.1:4310/v1/work \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"write_receipt","request":{"repoId":"'"$REPO_ID"'","itemId":"'"$ITEM_ID"'","requestId":"'"$REQUEST_ID"'"}}'

Export a project to issue files

POST /v1/work/export

Copies a project's open items from the built-in tracker or Linear into the repo's private issue files (.clankie/work). Items already exported are refreshed even if closed. Nothing is written back to the source tracker. With dryRun it only plans. A refusal returns the same shape with ready: false and changes nothing.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
project string yes Clankie project id, 1 to 64 characters.
to string yes markdown.
dryRun boolean no Plan only. Default false.

Response 200 (ready, or any dry run) or 409 (refused, not a dry run)

Field Type Description
action string export.
to string markdown.
dryRun boolean Whether this was a plan only.
ready boolean False when refused.
refusals string[] Why it was refused, in plain words.
project object id and name.
source object backend (builtin or linear), plus trackerProjectId or linear.
root string The checkout holding the files.
directory string The issue files folder, relative to root.
gitignore object file and action (create or present).
counts object create, update, unchanged, kept, closedSkipped.
items object[] Per item: id, title, status, action, file, optional reason.
next string[] What to do next.

root, directory, gitignore, counts, items and next are present only when ready is true.

Errors

Status error When
401 operator_authentication_required No valid Operator token.
503 operator_authentication_unavailable The operator credential can't be checked.
400 invalid_work_request The body doesn't match the schema.
422 work_export_failed Writing the files failed. detail says why.
sh
curl -sS http://127.0.0.1:4310/v1/work/export \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"project":"'"$PROJECT_ID"'","to":"markdown","dryRun":true}'

List or decide held posts

POST /v1/work/posts

Lists tracker writes that wait under a project's "Posting to your tracker" setting, or lets one through or sends it back. A post that waits for the lead can be decided with the Operator token. A post that waits for the owner can be decided only from the owner's own paired app. Deciding an already-decided post changes nothing and returns changed: false.

Auth: Operator token, or Device session with Take Control from the owner's own app.

Request body (JSON), one of:

Field Type Required Description
action string yes list, approve or send_back.
state string no list only: waiting (default) or all.
projectId string no list only: one project's posts.
id string for approve, send_back Post UUID.
reason string no send_back only: why, up to 2000 characters.

Response 200 for list

Field Type Description
posts object[] Up to 500 posts, newest first.
posts[].id string Post UUID.
posts[].projectId string Project, when known.
posts[].tracker string linear or github.
posts[].decider string owner or lead.
posts[].state string waiting, posting, posted, sent_back, refused, failed or uncertain.
posts[].summary string What would be posted and where.
posts[].detail string Exactly what would be posted.
posts[].asker string Who asked to post it.
posts[].createdAt string When it was asked.
posts[].decidedAt string When it was decided.
posts[].note string Why it was sent back, refused or failed.
posts[].posted object Where it landed: key, url.
posts[].requestId string The owner's feed check, for an owner decision.

Response 200 for approve and send_back

Field Type Description
post object The post, as above.
changed boolean False when it had already been decided.
message string What happened.

Errors

Status error When
401 owner_required No Operator token or eligible device session.
400 invalid_request The body doesn't match the schema.
403 owner_app_required A device session that isn't the owner's own app.
409 posting_held No waiting post with that id, the post waits for the owner, or Watch is on. detail says which.
sh
curl -sS http://127.0.0.1:4310/v1/work/posts \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"list","state":"waiting"}'

Tracker calls

These routes call one tracker tool by name, the same tools Clankie and his workers use. Without repo, the call goes to Clankie's built-in tracker. With repo, it goes to that repo's saved tracker, and tools the tracker doesn't support are refused.

Call a tracker tool as Clankie

POST /v1/tracker/call

Runs one tool. With the Operator token, writes are made by Clankie on the owner's behalf, so they are subject to Watch and, on GitHub issues or Linear, to the project's posting setting. From a device, writes are the owner's app's own and are never held.

Auth: Operator token, or Device session with Take Control.

Request body (JSON)

Field Type Required Description
name string yes Tool name, 1 to 128 characters.
repo string no Registered repo id. The Operator token may also give an absolute checkout path. Required for inbox tools.
arguments object no The tool's arguments. Default {}.

Tools. The built-in tracker serves:

  • Issues: get_issue, list_issues, search_issues, save_issue, list_comments, save_comment, create_comment, list_issue_statuses, save_issue_status, list_issue_labels, save_issue_label, create_issue_label, list_ready_issues, list_changes, list_drift
  • Item events and runs: post_issue_event, list_issue_events, post_issue_ask, post_run_control, save_run, list_runs, save_lease
  • Projects and planning: get_project, list_projects, save_project, list_project_statuses, get_status_updates, save_status_update, list_initiatives, list_releases, get_release, list_cycles, get_cycle, list_milestones, get_milestone, list_documents, get_document
  • People and teams: get_user, list_users, get_team, list_teams
  • Receipts and audit: get_write_receipt, list_audit_events
  • Evidence bundles already on record: get_evidence_bundle, post_bundle_check
  • Guided reviews already on record: get_guided_review, list_guided_reviews, post_guided_finding, post_retire_guided_review
  • Saved issue views (with repo, on a repo bound to a built-in tracker project): save_issue_view, get_issue_view, list_issue_views, list_issue_view_issues, post_delete_issue_view
  • Work inbox (with repo, on a built-in tracker repo): inbox_pending_questions, get_inbox_item, post_snooze_inbox_item, post_unsnooze_inbox_item

Other trackers serve the subset they support; built-in-only tools and the built-in-only arguments idempotencyKey, ifUpdatedAt, cycleDays, snapshot and ownerCheck are refused there.

Response 200

Field Type Description
result any The tool's own result.

Errors

Status error When
401 owner_required No Operator token or eligible device session, or the authority lapsed before the call ran.
400 invalid_request The body doesn't match the schema.
422 tracker_refused The tool refused or failed. detail says why; reason is set for posting, Watch and tracker-rule refusals; post is set when the write is held. Inbox tools without repo also answer this.
409 tracker_uncertain An inbox snooze may have committed before authority or data changed. Carries mayHaveCommitted: true and idempotencyKey; read the original receipt instead of resending.
sh
curl -sS http://127.0.0.1:4310/v1/tracker/call \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"list_issues","arguments":{"limit":20}}'

Call a tracker tool as the owner

POST /v1/tracker/owner/call

Same request, tools, response and errors as POST /v1/tracker/call, but writes made with the Operator token are recorded as the owner's own. The owner's writes are never held by posting settings or Watch.

Auth: Operator token, or Device session with Take Control.

sh
curl -sS http://127.0.0.1:4310/v1/tracker/owner/call \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"get_issue","repo":"'"$REPO_ID"'","arguments":{"id":"'"$ITEM_ID"'"}}'

Read the tracker request budget

GET /v1/tracker/request-budget

Reports each hired actor's use of Clankie's own tracker tools in the current windows. The owner and Clankie are never limited and don't appear.

Auth: Operator token.

Response 200

Field Type Description
schemaVersion integer 1.
requestWindowMs integer 3600000.
writeWindowMs integer 60000.
observedAt integer Epoch milliseconds.
actors object[] One per actor.
actors[].actorId string Actor id.
actors[].name string Display name.
actors[].role string worker or reviewer.
actors[].interactive object requests, requestLimit, writes, writeLimit, and retryAt while refusing.
actors[].background object Same fields, for background calls.
actors[].refusals object Counts in the window: role_not_allowed, tracker_request_budget.

Errors

Status error When
401 operator_authentication_required No valid Operator token.
503 operator_authentication_unavailable The operator credential can't be checked.
sh
curl -sS http://127.0.0.1:4310/v1/tracker/request-budget \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Read the Linear request budget

GET /v1/linear/request-budget

Reports the hourly request budget of each connected Linear account. It answers only while the owner has the Linear tracker extension on; otherwise it returns 503 linear_request_budget_unavailable.

Auth: Operator token.

Response 200

Field Type Description
schemaVersion integer 1.
windowMs integer 3600000.
observedAt integer Epoch milliseconds.
accounts object[] One per Linear account.
accounts[].accountId string Account id.
accounts[].workspaceId string Linear workspace.
accounts[].userId string Linear user.
accounts[].requests integer Requests in the window.
accounts[].limit integer Hourly limit.
accounts[].used integer Requests counted against the limit.
accounts[].utilization number used / limit.
accounts[].status string normal, warning, throttled or limited.
accounts[].backgroundMinIntervalMs integer Minimum spacing for background reads.
accounts[].backgroundRetryAt integer When background reads may resume.
accounts[].requestsRemaining integer Remaining requests, as Linear reported.
accounts[].resetAt integer When Linear's window resets.

Errors

Status error When
401 operator_authentication_required No valid Operator token.
503 operator_authentication_unavailable The operator credential can't be checked.
503 linear_request_budget_unavailable The Linear tracker extension is off.
sh
curl -sS http://127.0.0.1:4310/v1/linear/request-budget \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Linear settings

These routes hold the owner's settings for waking the lead on Linear activity: which chat each Linear project wakes, the default chat, the wake rules and the follow switch. They are mounted only while the owner has the Linear wake extension on; the mirror status route is mounted only while the Linear tracker extension is on.

A chat used as a wake target must be a global or workspace chat, not a side chat. Writes to wake and follow take an expectedRevision, the revision from the last read; a stale revision answers 409 settings_revision_conflict.

Read or set Linear project chats

GET /v1/linear/routes, PUT /v1/linear/routes

Reads or replaces the list of Linear projects and the lead chat each one wakes.

Auth: Operator token.

Request body (JSON, PUT only)

Field Type Required Description
projectChats object[] yes Up to 100 routes, one per Linear project.
projectChats[].projectId string yes Linear project UUID.
projectChats[].name string yes Project name, 1 to 256 characters.
projectChats[].conversationId string yes Chat id (letters, digits, _, -).

Response 200

Field Type Description
schemaVersion integer 1.
projectChats object[] The saved routes.

Errors

Status error When
401 operator_authentication_required No valid Operator token.
503 operator_authentication_unavailable The operator credential can't be checked.
400 malformed The body doesn't match the schema.
409 linear_wake_target_unavailable A chat isn't an allowed wake target.
sh
curl -sS -X PUT http://127.0.0.1:4310/v1/linear/routes \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectChats":[{"projectId":"'"$LINEAR_PROJECT_ID"'","name":"Website","conversationId":"global-default"}]}'

List Linear wake deliveries

GET /v1/linear/deliveries

Lists the Linear wakes offered to chats, newest first (up to 100), and the chats holding Linear activity for recovery.

Auth: Operator token.

Response 200

Field Type Description
schemaVersion integer 1.
deliveries object[] Offered wakes.
deliveries[].wakeId string Wake id.
deliveries[].conversationId string The chat it went to.
deliveries[].eventIds string[] Linear events it carried.
deliveries[].offeredAt string When it was offered.
deliveries[].events object[] Events the chat still holds: eventId, project, route.
recoveries object[] Chats with held activity.
recoveries[].conversationId string The chat.
recoveries[].unavailable object Why the chat couldn't take its wake, when it couldn't.
recoveries[].pendingEventIds string[] Followed events still waiting.
recoveries[].resolutions object Resolved activity, by event.

Errors

Status error When
401 operator_authentication_required No valid Operator token.
503 operator_authentication_unavailable The operator credential can't be checked.
503 linear_wake_store_unavailable A chat's record can't be read, so no partial list is returned.
sh
curl -sS http://127.0.0.1:4310/v1/linear/deliveries \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Read or set Linear wake rules

GET /v1/linear/wake, POST /v1/linear/wake, PUT /v1/linear/wake

Reads or replaces the rules that decide which Linear activity wakes the lead. POST and PUT behave the same. Responses are sent with cache-control: no-store.

Auth: Operator token, or Device session with Take Control.

Request body (JSON, POST/PUT only)

Field Type Required Description
expectedRevision string yes 64-character hex revision from the last read.
wake.ownerUserIds string[] no Linear user ids that are the owner. Default [].
wake.ownerUserEmails string[] no Owner emails, matched only against verified actor email. Default [].
wake.actors string[] no Who may wake: owner, human, self, users. Default ["owner"].
wake.userIds string[] no Specific user ids for the users rule. Default [].
wake.notificationTypes string[] no Linear notification types that wake. Defaults to Linear's comment, mention, assignment and reaction types.
wake.excludedNotificationTypes string[] no Types that never wake. Default ["issueSubscribed"].

Response 200

Field Type Description
schemaVersion integer 1.
revision string Revision of the saved rules.
wake object The saved rules, with every field above.

Errors

Status error When
401 authentication_required No Operator token or device session.
403 forbidden A device without Take Control, or not owner-paired.
400 malformed The body doesn't match the schema.
409 settings_revision_conflict The revision is stale, the settings changed, or the owner's authority was revoked during the write.
sh
curl -sS http://127.0.0.1:4310/v1/linear/wake \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Read or set the default Linear wake chat

GET /v1/linear/target, PUT /v1/linear/target

Reads or sets the chat that Linear activity outside any routed project wakes. Default global-default.

Auth: Operator token.

Request body (JSON, PUT only)

Field Type Required Description
conversationId string yes Chat id (letters, digits, _, -), up to 256 characters.

Response 200

Field Type Description
schemaVersion integer 1.
wakeConversationId string The default wake chat.

Errors

Status error When
401 operator_authentication_required No valid Operator token.
503 operator_authentication_unavailable The operator credential can't be checked.
400 malformed The body doesn't match the schema.
409 linear_wake_target_unavailable The chat isn't an allowed wake target.
sh
curl -sS -X PUT http://127.0.0.1:4310/v1/linear/target \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"conversationId":"global-default"}'

Read or set Linear following

GET /v1/linear/follow, POST /v1/linear/follow, PUT /v1/linear/follow

Reads or turns on the follow switch for Linear activity. Turning it on needs a configured Linear webhook (its URL and signing secret). POST and PUT behave the same. Responses are sent with cache-control: no-store.

Auth: Operator token, or Device session with Take Control.

Request body (JSON, POST/PUT only)

Field Type Required Description
expectedRevision string yes 64-character hex revision from the last read.
following boolean yes Follow Linear activity or not.

Response 200

Field Type Description
schemaVersion integer 1.
revision string Revision of the saved Linear wake settings.
following boolean The switch as saved.
active boolean Following and the webhook is configured.
webhookConfigured boolean Both the webhook URL and secret are present.
reason string or null linear_webhook_required when the webhook isn't configured.
missingWebhook string[] url and/or secret.
wakeWarning string or null Set when following is on but no owner ids or emails are saved.
detail string or null What to do when the webhook is missing.
wakeConversationId string The default wake chat.

Errors

Status error When
401 authentication_required No Operator token or device session.
403 forbidden A device without Take Control, or not owner-paired.
400 malformed The body doesn't match the schema.
409 linear_webhook_required following: true without a configured webhook.
409 settings_revision_conflict The revision is stale or the settings changed during the write.
409 owner_revoked The owner's authority was revoked during the write.
sh
curl -sS http://127.0.0.1:4310/v1/linear/follow \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Read Linear mirror status

POST /v1/tracker/mirror/linear

Reports whether a built-in tracker store mirrors a Linear project, and how many Linear events it has applied. Only action: "status" is served.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
projectId string yes Linear project UUID.
scratch string yes Store name: letters, digits, _, -, 1 to 80 characters.
action string yes status.

Response 200

When no mirror binds that store to that project: scratch, projectId and enabled: false. Otherwise:

Field Type Description
scratch string Store name.
projectId string Linear project.
workspaceId string Linear workspace.
enabled boolean Whether the mirror is on.
updatedAt string Last change to the binding.
counters object applied, duplicate, ignored, drift, failed.
lastEventAt string Last event time.
lastError string Last error.
drift object[] Drift reports: at, eventId, type, action, references, outcome (repaired, unresolved, failed), outside, requests, error.
appliedEvents integer Events the store has applied.

Errors

Status error When
401 operator_required No valid Operator token.
400 invalid_request The body doesn't match the schema.
409 linear_mirror_refused The mirror registry can't be read. detail says why.
sh
curl -sS http://127.0.0.1:4310/v1/tracker/mirror/linear \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"'"$LINEAR_PROJECT_ID"'","scratch":"main","action":"status"}'

GitHub issue activity

Clankie polls GitHub issue activity (opened, assigned, labeled, closed, reopened and new comments) for registered repos whose saved tracker is GitHub issues, using his connected GitHub account, and wakes the project's lead chat. These routes hold the owner's settings and list what the poller kept. They are mounted only while the owner has the GitHub wake extension on. Wake rules use GitHub's numeric user ids, as strings; ownerUserEmails never matches on GitHub.

Writes to wake and follow take an expectedRevision from the last read; a stale revision answers 409 settings_revision_conflict. A wake target chat must be a global or workspace chat, not a side chat.

Read or set GitHub project chats

GET /v1/github/routes, PUT /v1/github/routes

Reads or replaces which lead chat each Clankie project's GitHub activity wakes.

Auth: Operator token.

Request body (JSON, PUT only)

Field Type Required Description
projectChats object[] yes Up to 100 routes, one per project.
projectChats[].projectId string yes Clankie project id.
projectChats[].name string yes Project name, 1 to 256 characters.
projectChats[].conversationId string yes Chat id (letters, digits, _, -), up to 256 characters.

Response 200

Field Type Description
schemaVersion integer 1.
projectChats object[] The saved routes.

Errors

Status error When
401 operator_authentication_required No valid Operator token.
503 operator_authentication_unavailable The operator credential can't be checked.
400 malformed The body doesn't match the schema.
409 github_wake_target_unavailable A chat isn't an allowed wake target.
sh
curl -sS -X PUT http://127.0.0.1:4310/v1/github/routes \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectChats":[{"projectId":"'"$PROJECT_ID"'","name":"Website","conversationId":"global-default"}]}'

Read or set the default GitHub wake chat

GET /v1/github/target, PUT /v1/github/target

Reads or sets the chat that GitHub activity outside any routed project wakes. Default global-default.

Auth: Operator token.

Request body (JSON, PUT only)

Field Type Required Description
conversationId string yes Chat id (letters, digits, _, -), 1 to 256 characters.

Response 200

Field Type Description
schemaVersion integer 1.
wakeConversationId string The default wake chat.

Errors

Status error When
401 operator_authentication_required No valid Operator token.
503 operator_authentication_unavailable The operator credential can't be checked.
400 malformed The body doesn't match the schema.
409 github_wake_target_unavailable The chat isn't an allowed wake target.
sh
curl -sS -X PUT http://127.0.0.1:4310/v1/github/target \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"conversationId":"global-default"}'

List GitHub activity

GET /v1/github/activity

Lists the GitHub issue events the poller kept, newest first, up to 100. It takes no query parameters.

Auth: Operator token.

Response 200

Field Type Description
schemaVersion integer 1.
activity object[] Kept events.
activity[].at string When it was recorded.
activity[].repo string owner/name.
activity[].target string The chat it is for.
activity[].decision string Why it woke or didn't.
activity[].state string held (waiting for its chat's turn), receipt (kept, never woken), offered or woken.
activity[].repoOwnerId string The repo's GitHub owner id.
activity[].accountId string The connected account it was read with.
activity[].sender object id, type, association.
activity[].wake object The wake that carried it: id, at, runId.
activity[].activity object eventId, prompt, project (id, name), route (project_lead, project_fallback, default), notificationTypes.

Errors

Status error When
401 operator_authentication_required No valid Operator token.
503 operator_authentication_unavailable The operator credential can't be checked.
503 github_activity_unavailable The kept activity can't be read.
sh
curl -sS http://127.0.0.1:4310/v1/github/activity \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Read or set GitHub wake rules

GET /v1/github/wake, POST /v1/github/wake, PUT /v1/github/wake

Reads or replaces the rules that decide which GitHub activity wakes the lead. The body and fields are the same as Linear wake rules, with GitHub user ids. POST and PUT behave the same. Responses are sent with cache-control: no-store.

Auth: Operator token, or Device session with Take Control.

Request body (JSON, POST/PUT only)

Field Type Required Description
expectedRevision string yes 64-character hex revision from the last read.
wake object yes ownerUserIds, ownerUserEmails, actors, userIds, notificationTypes, excludedNotificationTypes.

Response 200

Field Type Description
schemaVersion integer 1.
revision string Revision of the saved rules.
wake object The saved rules.

Errors

Status error When
401 authentication_required No Operator token or device session.
403 forbidden A device without Take Control, or not owner-paired.
400 malformed The body doesn't match the schema.
409 settings_revision_conflict The revision is stale, the settings changed, or the owner's authority was revoked during the write.
sh
curl -sS http://127.0.0.1:4310/v1/github/wake \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Read or set GitHub following

GET /v1/github/follow, POST /v1/github/follow, PUT /v1/github/follow

Reads or turns on the follow switch. The poller sends no requests until following is on. Turning it on needs Clankie's connected GitHub account. POST and PUT behave the same. Responses are sent with cache-control: no-store.

Auth: Operator token, or Device session with Take Control.

Request body (JSON, POST/PUT only)

Field Type Required Description
expectedRevision string yes 64-character hex revision of the whole GitHub wake settings, from the last read.
following boolean yes Follow GitHub activity or not.

Response 200

Field Type Description
schemaVersion integer 1.
revision string Revision of the saved GitHub wake settings.
following boolean The switch as saved.
active boolean Following and the GitHub account is connected.
reason string or null github_account_required when no account is connected.
detail string or null What to do when no account is connected.
wakeConversationId string The default wake chat.

Errors

Status error When
401 authentication_required No Operator token or device session.
403 forbidden A device without Take Control, or not owner-paired.
400 malformed The body doesn't match the schema.
409 github_account_required following: true without a connected GitHub account.
409 settings_revision_conflict The revision is stale, the settings changed, or the owner's authority was revoked during the write.
sh
curl -sS -X PUT http://127.0.0.1:4310/v1/github/follow \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":"'"$REVISION"'","following":true}'

Reviews

A project may name a reviewer. A worker's landing candidate is its exact patch, and landing waits for an approval of that patch, or an owner or lead waiver. These routes are the owner's view: list and read candidates, ask the landing question, and waive review of one patch. Responses are sent with cache-control: no-store.

All review routes share these errors:

Status error When
401 authentication_required No Operator token or device session.
403 forbidden A device without Take Control, or not owner-paired.

Review candidate object

Field Type Description
schemaVersion integer 1.
id string Candidate UUID.
projectId string The project.
status string awaiting_review, changes, approved, waived or superseded.
patchId string git patch-id --verbatim of the stored patch.
patchSha256 string sha256 of the stored patch bytes.
bytes integer Patch size.
files string[] Files the patch touches.
base string Base commit.
head string Head commit.
issue string Tracker issue, when given.
summary string Author's summary.
evidence string[] Links for the reviewer.
author object Submitting seat: seatId, occupantId, harness, title. Absent for a waiver with no candidate.
supersedes string The candidate this one replaces.
supersededBy string The candidate that replaced this one.
submittedAt string Submission time.
reviewer object The reviewer seat it was sent to, plus deliveryStage, detail, at.
verdict object verdict (approve, changes), findings, summary, reviewer, sameHarness, at.
waiver object actor (owner, lead), conversationId, reason, at.

List review candidates

GET /v1/operator/reviews

Lists candidates, newest first, up to 500.

Auth: Operator token, or Device session with Take Control.

Query parameters

Name Type Required Description
project string no Only this project's candidates (1 to 64 characters).

Response 200

Field Type Description
schemaVersion integer 1.
candidates object[] Review candidate objects.

Errors

Status error When
400 invalid_query project is empty or too long.
sh
curl -sS "http://127.0.0.1:4310/v1/operator/reviews?project=$PROJECT_ID" \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Show a review candidate

GET /v1/operator/reviews/:id

Reads one candidate, and its patch when asked.

Auth: Operator token, or Device session with Take Control.

Path parameters

Name Type Description
id string Candidate UUID.

Query parameters

Name Type Required Description
patch string no true to include the stored patch.

Response 200

Field Type Description
schemaVersion integer 1.
candidate object The review candidate.
patch string The patch bytes as base64, when patch=true and the patch is stored.

Errors

Status error When
404 unknown_candidate No candidate with that id, or the id isn't a UUID.
sh
curl -sS "http://127.0.0.1:4310/v1/operator/reviews/$CANDIDATE_ID?patch=true" \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Ask whether a patch may land

GET /v1/operator/reviews/landing

Answers the landing gate's question for one exact patch from one checkout: does it need review, and is it approved or waived.

Auth: Operator token, or Device session with Take Control.

Query parameters

Name Type Required Description
directory string yes The checkout path.
patchId string yes The patch's git patch-id, or empty for an empty change.

Response 200

Field Type Description
schemaVersion integer 1.
required boolean False when the checkout's project names no reviewer or the change is empty.
projectId string The checkout's project.
patchId string The patch asked about.
status string A candidate status, not_submitted or not_required.
landable boolean True when not required, approved or waived.
candidate object The matching candidate, when one exists.

Errors

Status error When
400 invalid_query Missing or extra parameters, or a malformed patchId.
sh
curl -sS -G http://127.0.0.1:4310/v1/operator/reviews/landing \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  --data-urlencode "directory=$CHECKOUT" \
  --data-urlencode "patchId=$PATCH_ID"

Waive review of a patch

POST /v1/operator/reviews/waivers

Records the owner's waiver for one exact patch, so it may land without review. The service hashes the patch itself and refuses a mismatch. An existing candidate for the same patch is marked waived; otherwise a new waived candidate is stored.

Auth: Operator token, or Device session with Take Control.

Request body (JSON)

Field Type Required Description
schemaVersion integer yes 1.
directory string yes The checkout path.
base string yes Full base commit id.
head string yes Full head commit id.
patchId string yes git patch-id --verbatim of the patch.
patch string yes git diff --binary BASE HEAD bytes as base64, up to 4 MiB decoded.
reason string yes Why, 1 to 2000 characters.

Response 200

Field Type Description
schemaVersion integer 1.
candidate object The waived candidate.

Errors

Status error When
400 invalid_waiver The body doesn't match the schema.
400 invalid_patch The patch can't be hashed. detail says why.
409 patch_id_mismatch The patch doesn't hash to patchId.
409 no_project The checkout belongs to no project.
409 no_reviewer The project names no reviewer, so nothing needs waiving.
403 authority_changed The owner's authority changed before the waiver was saved.
503 store_unavailable The review store can't be read.

Refusal bodies carry error and detail.

sh
curl -sS http://127.0.0.1:4310/v1/operator/reviews/waivers \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"schemaVersion":1,"directory":"'"$CHECKOUT"'","base":"'"$BASE"'","head":"'"$HEAD"'","patchId":"'"$PATCH_ID"'","patch":"'"$PATCH_BASE64"'","reason":"Docs-only change"}'

Evidence

The evidence store keeps proof files (screenshots, logs, recordings) named by their sha256, with a record of who produced which bytes for which issue and commit. A record's link has the form clankie://evidence/sha256/<sha256>. Uploading is two steps: declare the file with POST /v1/evidence/uploads, then send the bytes to the signed uploadUrl it returns. Signed links expire within 15 minutes and stop working when the service restarts. Every /v1/evidence/* response is sent with cache-control: no-store.

Routes that take the Operator token share these errors:

Status error When
401 authentication_required No valid Operator token.
503 authentication_unavailable The operator credential can't be checked.
400 invalid_request The body or query doesn't match the schema, or the JSON is malformed.

Evidence record object

Field Type Description
id string Record UUID.
fileName string File name.
sha256 string 64 lowercase hex characters.
size integer Bytes.
contentType string Media type.
issueKey string Tracker issue.
commit string Commit id.
actor object Who uploaded: kind (operator, worker, seat), id, name, onBehalfOf.
project string Project.
repo string Repo.
model string Model that produced it.
outcome string passed, failed or partial.
caption string What it shows.
createdAt string When it was recorded.
url string clankie://evidence/sha256/<sha256>.

Read store status

GET /v1/evidence/status

Reports where blobs and records are kept.

Auth: Operator token.

Response 200

Field Type Description
blobs.backend string Blob store, such as local-disk or S3.
blobs.location string Where blobs live.
metadata.backend string sqlite.
metadata.location string Where records live.
sh
curl -sS http://127.0.0.1:4310/v1/evidence/status \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Start an upload

POST /v1/evidence/uploads

Declares a file and returns a receipt. If the store already has those bytes, the receipt is applied at once; otherwise it is pending with a signed uploadUrl. The same idempotencyKey always returns the same receipt. Body limit 64 KiB.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
idempotencyKey string yes 16 to 128 characters of letters, digits, _, -. Becomes the receipt id.
sha256 string yes sha256 of the bytes, lowercase hex.
size integer yes Size in bytes.
contentType string yes Media type, such as image/png.
fileName string yes Single line, up to 1024 characters.
issueKey string no Tracker issue, up to 64 characters.
commit string no 40- or 64-character commit id.
project string no Project.
repo string no Repo.
model string no Model that produced it.
outcome string no passed, failed or partial.
caption string no Up to 4000 characters.

Response 200

Field Type Description
receiptId string The idempotency key.
state string applied, pending or refused.
sha256 string The declared hash.
size integer The declared size.
url string clankie://evidence/sha256/<sha256>.
recordId string The record UUID, once applied.
uploadUrl string Pending only: signed path to PUT the bytes to.
uploadExpiresAt string Pending only: when uploadUrl expires.
refusal string Refused only: sha256_mismatch or size_mismatch.

Errors

Status error When
409 idempotency_conflict The key was used before with a different request.
sh
curl -sS http://127.0.0.1:4310/v1/evidence/uploads \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"idempotencyKey":"'"$UPLOAD_KEY"'","sha256":"'"$SHA256"'","size":20480,"contentType":"image/png","fileName":"login.png","issueKey":"'"$ISSUE_KEY"'"}'

Send upload bytes

PUT /v1/evidence/uploads/:actor/:receiptId/blob

Sends the bytes for a pending receipt. Use the uploadUrl from the receipt exactly as given, including its expires and signature query parameters. The service checks the size and sha256 before the blob is kept, then settles the receipt.

Auth: None. The signed uploadUrl is the authority.

Path parameters

Name Type Description
actor string Part of the signed path; copy it from uploadUrl.
receiptId string The receipt id.

Query parameters

Name Type Required Description
expires string yes From uploadUrl.
signature string yes From uploadUrl.

Request body: the raw file bytes.

Response 200 (or 422 when the receipt is refused)

The receipt, with the fields of Start an upload.

Errors

Status error When
403 invalid_signature The link is expired, altered or from before a restart.
400 invalid_request No body.
404 unknown_receipt No receipt for that path.
422 (receipt) The bytes didn't match: the body is the receipt with state: "refused" and a refusal.
sh
curl -sS -X PUT "http://127.0.0.1:4310$UPLOAD_URL" \
  --data-binary @login.png

Read an upload receipt

GET /v1/evidence/receipts/:receiptId

Reads the current state of one of the caller's upload receipts. A pending receipt comes back with a fresh uploadUrl.

Auth: Operator token.

Path parameters

Name Type Description
receiptId string The idempotency key used to start the upload.

Response 200

The receipt, with the fields of Start an upload.

Errors

Status error When
404 unknown_receipt No receipt with that id for this caller.
sh
curl -sS http://127.0.0.1:4310/v1/evidence/receipts/$UPLOAD_KEY \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

POST /v1/evidence/fetch

Returns a signed, short-lived download link for recorded bytes. Body limit 64 KiB.

Auth: Operator token.

Request body (JSON)

Field Type Required Description
sha256 string yes sha256 of a recorded blob.

Response 200

Field Type Description
sha256 string The hash.
size integer Bytes.
url string Signed download link: a path on this service, or the blob store's own link.
expiresAt string When the link expires.

Errors

Status error When
404 unknown_object No record for those bytes, or the stored blob is missing or the wrong size.
sh
curl -sS http://127.0.0.1:4310/v1/evidence/fetch \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sha256":"'"$SHA256"'"}'

Download a blob

GET /v1/evidence/blobs/:sha256

Streams recorded bytes through a signed link from POST /v1/evidence/fetch. The response is application/octet-stream with content-disposition: attachment and x-content-type-options: nosniff, whatever the file's type.

Auth: None. The signed link is the authority.

Path parameters

Name Type Description
sha256 string 64 lowercase hex characters.

Query parameters

Name Type Required Description
expires string yes From the signed link.
signature string yes From the signed link.

Response 200: the raw bytes.

Errors

Status error When
403 invalid_signature The link is expired, altered or from before a restart.
404 unknown_object Malformed hash, no record, or the stored blob is missing or the wrong size.
sh
curl -sS -o evidence.bin "http://127.0.0.1:4310$FETCH_URL"

List recent evidence

GET /v1/evidence/recent

Lists records newest first, with optional filters and cursor paging. Keep the same filters when following nextCursor.

Auth: Operator token.

Query parameters

Name Type Required Description
project string no Exact project.
repo string no Exact repo.
issue string no Issue key.
actorKind string no operator, worker or seat.
actorName string no Actor name, or id when it has no name.
mediaType string no Full type (image/png) or top-level type (image).
since string no ISO 8601 time; records at or after it.
until string no ISO 8601 time; records at or before it. Must not precede since.
cursor string no nextCursor from the previous page.
limit integer no 1 to 100. Default 40.

Unknown query parameters are refused.

Response 200

Field Type Description
records object[] Evidence record objects.
nextCursor string Present when more records follow.

Errors

Status error When
400 invalid_cursor The cursor can't be read.
sh
curl -sS "http://127.0.0.1:4310/v1/evidence/recent?mediaType=image&limit=20" \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Preview an image

GET /v1/evidence/preview/:sha256

Returns small recorded images inline as base64. Only PNG, JPEG and GIF up to 64 KiB are returned; anything else answers available: false with a reason.

Auth: Operator token.

Path parameters

Name Type Description
sha256 string 64 lowercase hex characters.

Response 200

Field Type Description
sha256 string The hash.
available boolean Whether the image is included.
contentType string image/png, image/jpeg or image/gif, when available.
data string The image as base64, when available.
reason string too_large or not_image, when not available.

Errors

Status error When
404 unknown_object No record for those bytes, or the stored blob is missing.
sh
curl -sS http://127.0.0.1:4310/v1/evidence/preview/$SHA256 \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

List records for an issue or commit

GET /v1/evidence/records

Lists every record for one issue or one commit, oldest first. There is no paging.

Auth: Operator token.

Query parameters

Give exactly one of issue or commit.

Name Type Required Description
issue string one of Issue key.
commit string one of Commit id.

Response 200

Field Type Description
records object[] Evidence record objects.

Errors

Status error When
400 issue_or_commit_required Neither or both given, or the value is empty.
sh
curl -sS "http://127.0.0.1:4310/v1/evidence/records?issue=$ISSUE_KEY" \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"