API reference

Work tree and runtime

A Work's surroundings: its sub-Works (as a tree, as direct children, or as the live map the Work Center draws), what the whole tree used, why a held Work has not started, the runtime it runs on in its sandbox, what it learned, how its plan changed, its background tasks, and the channels that connect it with the other Works of its tree. 14 endpoints. Add your API key in the authentication panel to send test requests from this page.

Read a background task

GET/api/external/v1/works/{workId}/background-tasks/{taskId}

One background task of the Work's tree (a command it left running in its sandbox), with the end of its output; a running one is read live first, within a few seconds: id, workRunId, rootWorkRunId, kind, source, label, command, status, exitCode, endReason, startedAt, finishedAt, lastCheckedAt, outputTail, outputBytes. The tree's tasks are listed in /map.

Errors: 404 WORK_NOT_FOUND, 404 TASK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired
  • taskIdstring (uuid)pathRequired

Responses

  • 200OK

Stop a background task

POST/api/external/v1/works/{workId}/background-tasks/{taskId}/stop

Stops one background task of the Work's tree, as a person stops it in the Work Center: the Work is told it was stopped (and woken if it was waiting on it). A task that already ended is answered as it is. Answers 200 with the task.

Errors: 404 WORK_NOT_FOUND, 404 TASK_NOT_FOUND, 503 TASK_NOT_STOPPED (the sandbox did not answer), 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired
  • taskIdstring (uuid)pathRequired

Responses

  • 200OK

List a Work's channels

GET/api/external/v1/works/{workId}/channels

The channels the Work joined to hear from and talk to other Works of its tree: each id, channelName, workRunId, role (PUBLISHER, SUBSCRIBER or BOTH), assignedByWorkRunId (a Work that joined it), assignedByUserId, createdAt. Its own log is always there besides (channel work:<its id>); read a channel's rows with /events?channel=.

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK

Add a Work to a channel

POST/api/external/v1/works/{workId}/channels

Joins the Work to a channel, as the Work Center's Channels tab does; it is told so in its log. Body: channelName (required; another Work's own channel, work:<its id>, only for a Work of the same tree) and role: PUBLISHER (it only writes), SUBSCRIBER (it only reads) or BOTH (default). Joining a channel it is in already changes its role. Answers 200 with the membership.

Errors: 400 MISSING_FIELD, 400 INVALID_FIELD, 400 INVALID_CHANNEL, 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Request body application/json

object

Responses

  • 200OK

Remove a Work from a channel

DELETE/api/external/v1/works/{workId}/channels/{channel}/members/{memberWorkRunId}

Takes a Work of this Work's tree (this one, or another of its runs) out of a channel; that Work is told so in its log. Answers 204.

Errors: 404 WORK_NOT_FOUND, 404 MEMBER_NOT_FOUND (that run is not of this tree, or not in that channel), 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired
  • channelstringpathRequired
  • memberWorkRunIdstring (uuid)pathRequired

Responses

  • 200OK

List a Work's direct sub-Works

GET/api/external/v1/works/{workId}/children

The Work's direct sub-Works (not theirs), oldest first, each as GET /works/{workId} answers a Work. A private sub-Work someone else runs is left out.

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK

Read a Work's cost diagnostics

GET/api/external/v1/works/{workId}/cost

The Work's itemized cost lines, one per model call, sandbox or browser charge - the provider's cost as the platform prices it, as the Work Center's Cost tab shows it to administrators: cost with currency, totalCostUsd, breakdown (by category), llmBreakdown, usageSummary and items. Only for an administrator's account, as in the app; everyone reads what a Work used in its budgetConsumed and in /tree-budget.

Errors: 403 ADMIN_ONLY, 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK

Read why a Work has not started

GET/api/external/v1/works/{workId}/hold

Why a SCHEDULED Work waits: reason (WORK_CAPACITY: all your Work slots or your plan's Works at once are in use; TREE_PARALLELISM: its tree runs as many sub-Works at once as its flow allows; SUB_WORK_CAPACITY: your plan's sub-Works at once), capacity (null: unlimited), inUse, positionInLine (1: next to start; null for a tree), holders (the runs holding the slots, oldest first: id, title, prompt, lifecycleStatus, attentionState) and unnamedHolders (counted but not named: private, your personal assistant's, or past the first ten). Answers 204 when the Work is not held.

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK

List what a Work's tree learned

GET/api/external/v1/works/{workId}/knowledge

The knowledge index of the Work's whole tree, newest first: what its runs kept to look up later (each: id, workRunId, name, description, tags, content, createdAt). Read only: the Work itself decides what to load.

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK

Read a Work's map

GET/api/external/v1/works/{workId}/map

The Work Center's map of the Work's whole tree, light enough to poll every few seconds while it moves: rootWorkRunId, truncated (a very large tree is cut), generatedAt, nodes (each run: id, parentWorkRunId, depth, title, prompt, lifecycleStatus, attentionState, outcome, times, errorMessage, tokens, modelCalls, toolCalls, costUsd, elapsedActiveSeconds, contextTokensEstimate, contextWindowTokensEffective, runtimeLane, planTotal, planDone, currentStepLabel, agentId with agentName, flowId with flowName) and backgroundTasks (the tree's, newest first, without their output - read one for it).

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK

Read how a Work's plan changed

GET/api/external/v1/works/{workId}/plan-history

Every version of the Work's plan, newest first (including plans a person approved): id, versionNumber, createdAt, phases (each id, label, status, ...) and explanation (why it changed).

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK

Read a Work's runtime status

GET/api/external/v1/works/{workId}/runtime

The runner that works the Work inside its sandbox, when it has one: engine, status, state and detail (what it is doing), contextTokens, startedAt, lastHeartbeatAt (when it last called home), endedAt, endReason. Answers 204 when the Work has never run in its sandbox. Nothing that reaches the sandbox or the runner is answered.

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK

Read a Work's whole tree

GET/api/external/v1/works/{workId}/tree

Every run of the Work's tree - its top-level Work and every sub-Work at any depth - by depth, then oldest first, each as GET /works/{workId} answers a Work (parentWorkRunId and depth place it). Capped for a very large tree; for a list view read /children per row instead. A private sub-Work someone else runs is left out.

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK

Read what a Work's whole tree used

GET/api/external/v1/works/{workId}/tree-budget

What the Work's whole tree (its top-level Work and every sub-Work) used together: tokens, modelCalls, toolCalls, costUsd. The Work's own figures alone are its budgetConsumed.

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK