HTTP API

The work item object

The three shapes a work item answers in, its stored columns, and the fields that need an explanation, from its status and stop to its budget cap and plan progress.

A work item reaches a client in three shapes, and the route entries name the one each answers with. This page lists the fields of each shape, then explains the ones that need it. The detail object carries more keys than are listed here: the ones left out are for the board's own screens, and /openapi.json describes only the stable fields of the list and detail answers, so this page is the full reference.

The three shapes

ShapeAnswered byWhat it holds
The stored rowAn approve, a reject and a retry that stops at once.Every column of the item's row, as saved.
The list rowOne per item in GET /api/work-items.A short subset of the columns, and a few computed fields.
The detail objectGET /api/work-items/{id}.The stored row, and the computed fields below.

The stored row

The stored row has one key per column of the item's row. A column that holds JSON comes as text, except the three override columns, which are decoded. It has none of the computed fields, such as display_status, stop or budget_cap.

ColumnTypeMeaning
idstringThe item's ID.
titlestringOne line of plain text.
descriptionstring or nullThe brief the agents are given.
repostringThe absolute path of the connected repo.
statusstringactive, needs_human, waiting, rate_limited, paused, queued, blocked, completed or abandoned. Work item statuses says what each means.
chain_templatestring or nullThe chain named when the item was filed, or @one-off for an item filed with a one-off chain of its own.
materialized_chainstring or nullThe chain the item runs, frozen when it was filed, as JSON text. Its target.in_place is true for an in-place item.
current_node_idstring or nullThe node the item stands on. null before it first runs.
stop_kindstring or nullWhy the item is stopped, while it is needs_human, waiting or rate_limited. See stop.kind.
retry_atstring or nullWhile rate_limited, when the limit resets and the item may relaunch.
pending_steer_contextstring or nullThe note left while the item was paused, which the next agent launch takes.
base_refstring or nullThe commit the item's diff is measured against. null until the item first runs.
branchstring or nullThe git branch the item's worktree, merge request and merge all name.
bead_id, implements_beadsstring or nullThe item's own bead, and the bead IDs it implements as a JSON list.
attachmentsstring or nullThe spec and plan attached at intake, as a JSON list of {kind, path, ...}.
auto_gateinteger1 when agent review of the item's auto_escalate gates is armed.
budget_set, budget_usdinteger, number or nullWith budget_set 1, budget_usd is the item's own dollar cap, and null means no cap. With 0, the policy default applies.
agent_overrides, node_overrides, policy_overrideobject or nullThe item's overrides, decoded. node_overrides is {} when there are none.
archived_at, archived_bystring or nullWhen the item was archived, and whether by you or auto.
created_at, updated_atstringWhen the row was made and last changed, as UTC timestamps.

The list row

The list row is built for the board, from one grouped query, so it leaves out the fields that need a lookup per item. It has these keys:

  • From the stored row: id, title, description, repo, status, chain_template, current_node_id, bead_id, created_at, updated_at, retry_at, archived_at and archived_by.
  • chain_definition, as the chain's nodes, and attachments, as a decoded list.
  • pending_gate, the gate waiting on a person, or null.
  • one_off, display_status, stop, step, mr_ref, progress, actions and worktree_exists, explained below.

It has no agent_overrides, node_overrides or policy_override.

The detail object

The detail object is the stored row, with chain_definition replaced by the chain's nodes and attachments by a decoded list, plus these keys:

KeyMeaning
effective_chainThe chain with the item's node overrides folded over it.
usageThe item's usage per node and in total: tokens, cost and wall time.
worktree_pathWhere the worktree is, or is due to be, on the server's disk. For an in-place item, the repo's own folder.
head_shaThe worktree's HEAD commit, or null when there is no worktree.
pending_gateThe gate waiting on a person, or null.
review_headWhile the pending gate is the final review, the head a decision on it must name. null otherwise. Send it back as head. Added in 2.3
reject_defaultThe node a rejection would re-enter at. null with no gate pending.
stop_reasonThe stop's reason text, or null when the item isn't stopped.
started_at, ended_atWhen the chain first started a node, and when the item completed, was cancelled or was abandoned. null until then. Added in 2.4
dependencies[{id, title, status, met}] for each item this one comes after; met is true only for a completed one.
suggested_action{action, reason}: what the chain or a repair concluded a person should do, where action is skip, retry or abandon. null when none.
ended_reasonWhy a person ended the item, from the reason on its cancel or abandon event. null otherwise.
needs_context_questionThe worker's question, while the item is stopped on one. null otherwise.
steerableWhether a note sent now to POST /api/work-items/{id}/steer or /resume would be accepted.
worker_sessionsOne entry per session. skipped is true when a skip cut the session short.

Fields that need an explanation

FieldMeaning
display_statusList and detail. The board's status badge, one of archived, done, cancelled, paused, queued, blocked, running, waiting, needs_you, escalated, failed. Computed on read, not stored: see Displayed status.
stopList and detail. null unless the item is needs_human, waiting or rate_limited. See The stop field.
actionsList and detail. The doors a request would be admitted through now. See The actions field.
test_resultDetail only. The latest changed-test-scope verification run. See The test_result field.
budget_capDetail only. The item's effective dollar cap and spend. See The budget_cap field.
running_timeDetail only. {running_s, cap_minutes}: seconds any session ran since the last retry a person made, against the item-wide time_cap_minutes.
summaryDetail only. A run's progress: summary.
stepList and detail. {index, count, name, task} or null: the step the item is in.
mr_refList and detail. The item's merge request, {number, url}, or null.
progressList and detail. The item's place in its plan. See The progress field.
worktree_existsList and detail. See The worktree_exists field.

The one_off field

Added in 2.5

null for an item on a library chain. For an item filed with a one-off chain, an object:

KeyMeaning
extendsThe library chain it was written on, or null.
customHow many parts a person must review: its own prompts, commands, tools or gates. 0 when it is library-only.
needs_reviewtrue until a person has approved it. An item with needs_review set doesn't start.
approvalby, door, at, digest and review_digest of the approval, or null.

The list row and the detail object carry it; the stored row doesn't.

Why the item stopped

The stop field

stop is {kind, node, resume_at, reason} on the list. The detail adds task, attempt and facts. On a cap or budget stop it adds limit, and on a budget stop scope.

facts.cause names why an infra stop happened, when Kraft knows. The facts field lists the values. A rate_limit stop's facts also carries fallback and fallback_allowed: the stopped task's declared fallback harnesses, and which of those its resolved policy still allows.

stop.kind

stop.kind is one of fourteen values: gate, question, cap, budget, failed, conflict, mr_closed, config, infra, stuck, wait, rate_limit, checkout and slices. Stop kinds says what each means, and The troubleshooting pages give each stop's reason with its fix.

Slices: children, slices, group, parent_id and slice_key

Added in 2.6

A parent whose plan was sliced carries its children. A child names its parent. An ordinary item carries none of these.

FieldOnMeaning
slicesA parentThe counts of its children of the current generation: {done, needs_you, paused, running, queued, dropped, total}.
childrenA parentIts children of the current generation, in slice order, each {id, title, slice_key, status, display_status, current_node_id, cost_usd}.
groupAn item whose chain has a slice group, on the detail{id, phase, groundwork, slices, joined}: the phase, the plan's shared-groundwork tasks, its slices and how many the join replayed.
parent_id, slice_keyA childThe parent's ID and the slice's number.

A child isn't a row of GET /api/work-items: its parent's row carries it. A parent's display_status is needs_you while a child needs a person, whatever the parent's own status.

stop.limit

A cap or budget stop on the detail also carries limit: {path, key, value, maximum} when a PATCH of the item's policy can raise what stopped it, and omits it when none can.

keyWhat it capspath
max_attempts, timeout_minutesA fix loop's attempts or its clock.The node ID.
time_cap_minutes, total_time_cap_minutesThe work item's own cap.""
budget_usdOn a budget stop, the item-wide policy dollar cap.""

value is the limit that stopped it, in attempts, minutes or dollars. maximum is the maxima ceiling or null. Raise it with PATCH /api/work-items/{id} and {policy: {<key>: N}}, or {policy: {paths: {<path>: {<key>: N}}}} for one node, then POST /api/work-items/{id}/retry.

There is no limit for a budget stop on the item's own cap, which POST /api/work-items/{id}/budget/raise raises, nor for a node, step or task cap, a token_budget, the daily cap, a gate's timeout, a loops: cap in policy.yaml or exhausted rate-limit retries.

stop.scope

A budget stop on the detail also carries scope, the cap that stopped it:

scopeThe cap
work_itemThe item's own dollar cap.
usdA budget_usd, item-wide or on a node, step or task, or spend a harness never reported.
tokensA token_budget.
dailybudget.daily_usd.

What can be done now

The actions field

Added in 2.1

actions lists the doors a request would be admitted through now, in this order: approve, reject, resume, steer, retry, raise_budget, reopen_mr, unblock, skip, pause, escalate, complete, cancel, restore, archive, abandon.

Each is read from the item's status and the same facts its door checks, such as a pending gate, an open must-fix thread or a spend-cap stop. Who asks isn't one of them, so a worker's own item still lists doors that refuse the worker. An archived item lists restore, not archive.

Tests and spend

The test_result field

test_result is {scopes: [{command, scope, passed, exit_code, session_id}], passed}, or null when no scope has finished.

  • One entry per scope, passed or failed. passed is true when every scope passed.
  • An area's setup appears only when it failed.
  • A scope still running is left out.
  • session_id is the scope's session. Read its log with GET /api/work-items/{id}/sessions/{session_id}/log. See Session IDs in a path.

The budget_cap field

budget_cap is {cap_usd, source, key, spent_usd, daily}.

  • cap_usd is whichever cap stops the item first: the lower of its own cap and the item-wide budget_usd of its policy. It is null when neither is set.
  • key says which cap it is, and the PATCH field that changes it: budget_usd for the item's own cap, policy.budget_usd for the policy one.
  • source is item when the item itself set the reported cap, and policy when it comes from policy.yaml or the chain.
  • spent_usd is the item's own, all-time spend.
  • daily is {spent_usd, cap_usd}: the instance's spend since local midnight against policy.budget.daily_usd.

POST /api/work-items/{id}/budget/raise (kraft item raise-budget) raises whichever of the two caps stopped the item.

Progress and the worktree

The summary field

summary is a run's progress at a glance:

{"nodes_done": 3, "nodes_total": 8, "gates_passed": 1, "step": {"index": 2, "count": 2}}

nodes_done and nodes_total count against the frozen chain. gates_passed is how many of the completed nodes carry a gate after them. step is the current node's step out of its own steps when the node declares more than one, and null otherwise.

The progress field

progress is {current, total, title, tasks}, or null when the item has no plan to follow. Each task is {n, title, state, sha}. state is done, current or pending, and sha is the short hash of the newest commit on the item's branch that names the task, or null. Rows on the list carry only current, total and title.

The worktree_exists field

worktree_exists is whether worktree_path is a directory on disk. It is false before the item first runs and after its worktree was reclaimed or deleted.

open-worktree, mr-labels and the viewed routes answer 404 when the directory is missing. A retry or resume recreates it.

Copyright © 2026