API reference
Works
Works are long-running runs of your workspace's agents and flows: they plan, call tools, may hand parts to sub-Works, ask a person when they need a decision, and end with a result. Start a Work, list and read them, change what it should do, pause, resume or stop it, hand it to another agent or flow, and compact its context. Works are billed and limited exactly as Works started in the app. Your personal assistant's own background Works are not here (see Assistant Works). 12 endpoints. Add your API key in the authentication panel to send test requests from this page.
List Works
/api/external/v1/worksThe workspace's top-level Works (a Work's sub-Works are under /works/{workId}/children and /tree), pinned ones first, then the newest. Your personal assistant's own Works are never listed here.
Filters, all optional: flowId (the flow it runs), lifecycleStatus (DRAFT, QUEUED, SCHEDULED, RUNNING, WAITING, PAUSED, SLEEPING, COMPLETED, FAILED, CANCELLED, TIMED_OUT), attentionState (what it waits for: INPUT_REQUIRED, APPROVAL_REQUIRED, AGENT_TASK_PENDING, ...), search (words in its title or prompt), origin (MANUAL: started by a person by hand in the app; AUTONOMOUS: started by a schedule, an automation, another agent or this API; ALL, the default).
Answers {items, page, size, totalItems, totalPages}; each item is a Work as GET /works/{workId} answers it, with childCount (its direct sub-Works). Page with page (from 0) and size (1 to 100, 25 by default).
Errors: 400 INVALID_ID, 400 INVALID_FILTER, 403 FEATURE_NOT_ENABLED.
Parameters
flowIdstringqueryOnly Works of this flow.
lifecycleStatusstringqueryOnly Works in this status.
attentionStatestringqueryOnly Works waiting for this.
searchstringqueryWords in the title or prompt.
originstringqueryMANUAL, AUTONOMOUS or ALL (default).
pageinteger (int32)queryPage number, from 0.
sizeinteger (int32)queryWorks per page, 1 to 100 (25 by default).
Responses
200OK
Start a Work
/api/external/v1/worksStarts a Work on one of the workspace's flows or agents, as the Work Center's composer does. It is queued at once (or held SCHEDULED while all your Work slots are in use, and admitted as soon as one frees up), or created as DRAFT when scheduledStartAt is in the future.
Body:
flowIdoragentId(one is required;flowIdwins when both are sent): a Work-mode flow of the workspace, or an agent whose Work flow it runs (the Work then works as that agent);prompt(orobjective): what the Work should do; a flow that waits for its first message starts WAITING without one (send it with/steering);successCriteria: what done looks like;requesterLabel: who asked, as shown with the Work (default:API: <your key's name>);deadline: ISO-8601 time by which it must end (default: the flow's own deadline, if it has one);scheduledStartAt: ISO-8601 time to start it later (DRAFT until then;/startstarts it earlier);responsibleAuthorityPolicy(COLLABORATOR_AVAILABLE_LIVE, COLLABORATOR_AVAILABLE_ASYNC, DESIGNATED_APPROVER_AVAILABLE, SUPERVISOR_AGENT_AVAILABLE, NONE_AVAILABLE) andresponsibleAuthorityTimeoutFallback: who weighs in on its decisions and what it does when nobody answers in time (default: the flow's settings);inputs: values of the flow's structured inputs, by input name.
Skills to load and the planning mode are set after creation (PATCH /works/{workId} with softLoadedSkillIds, PATCH /works/{workId}/mode); to have them from the first step, create the Work with a scheduledStartAt, set them, then call /start.
The Work is recorded as started through the API (startedBySource API, in the autonomous list). It counts in your plan's Works a day and Works at once and every step is billed, exactly as a Work started in the app. Whatever it does that reaches other people goes through the flow's own tools, approvals and limits.
Answers 201 with the Work.
Errors: 400 MISSING_FIELD, 400 INVALID_ID, 400 INVALID_FIELD, 400 INVALID_TIME, 400 BLOCKED_CONTENT (the prompt matches a blocked-content pattern of the flow), 400 NO_WORK_FLOW (the agent has no Work-mode flow), 400 INVALID_REQUEST (no AI provider that can run Works is configured), 404 FLOW_NOT_FOUND, 404 AGENT_NOT_FOUND, 409 PLAN_LIMIT_REACHED (your plan's Works a day or Works at once; limit and allowed say which and how many), 403 FEATURE_NOT_ENABLED.
Request body application/json
flowIdstringagentIdstringpromptstringobjectivestringsuccessCriteriastringrequesterLabelstringdeadlinestringscheduledStartAtstringresponsibleAuthorityPolicystringresponsibleAuthorityTimeoutFallbackstringinputsobject
Responses
200OK
Get a Work
/api/external/v1/works/{workId}One Work of the workspace (a top-level Work or a sub-Work): id, title, prompt (what it was asked to do), successCriteria, lifecycleStatus, attentionState (what it waits for, NO_ATTENTION_REQUIRED when nothing), outcome (once it ended: SUCCESSFUL, PARTIALLY_SUCCESSFUL, BLOCKED, NO_ACTION_REQUIRED, UNSUCCESSFUL), origin and startedBySource (USER, API, SCHEDULE, AUTOMATION, TOOL, PARENT_WORK, EXTERNAL_MCP), flowId, agentId (the agent it works as), scheduleId, parentWorkRunId, rootWorkRunId, depth, requesterLabel, deadlineAt, scheduledStartAt (a DRAFT's start time), waitingSince, sleepUntil with sleepMessage, responsibleAuthorityPolicy and responsibleAuthorityTimeoutFallback (who weighs in on decisions, and what happens when nobody does), responsibleAuthorityUserId (a designated approver), plan (its current phases), currentPhaseId, budgetConsumed (tokens, modelCalls, toolCalls, costUsd, elapsedActiveSeconds, waitingSeconds), errorMessage, inputs (the flow's structured inputs it was given), outputs (its structured outputs once completed), planningModeOverride, planApprovalOverride, queuedMessages (waiting for its current loop to finish), softLoadedSkillIds, pinned, startedAt, finishedAt, createdAt, updatedAt (UTC).
Errors: 404 WORK_NOT_FOUND (no Work of this workspace has that id; your personal assistant's Works are not reachable here), 403 FEATURE_NOT_ENABLED.
Parameters
workIdstring (uuid)pathRequired
Responses
200OK
Change a Work
/api/external/v1/works/{workId}Changes what the Work is and what it should do, as the Work Center does. Send only what changes:
title: a name you choose (it then stands for good); empty or null hands naming back to automatic;prompt(orobjective): a new goal; the Work is told its goal changed and works on the new one from its next step;successCriteria: what done looks like now (empty clears it);deadline: ISO-8601 time it must end by (null clears it);scheduledStartAt: a new start time, only while it is DRAFT (ignored once it started);pinned: true keeps it at the top of the list;softLoadedSkillIds: the Skills loaded into it, as references (global::<skill id>for one of your Skills or a system Skill,sys::<name>); Skills of other accounts are dropped; an empty list clears them;constraint: one more rule it must keep from now on (added to its log).
Answers 200 with the Work.
Errors: 400 INVALID_FIELD, 400 INVALID_TIME, 400 BLOCKED_CONTENT (a prompt, success criteria or constraint that matches a blocked-content pattern of the flow), 404 WORK_NOT_FOUND, 409 WORK_BUSY (its own step saved it first: send again), 403 FEATURE_NOT_ENABLED.
Parameters
workIdstring (uuid)pathRequired
Request body application/json
object
Responses
200OK
Stop a Work
/api/external/v1/works/{workId}/cancelStops the Work for good, as the Work Center's Stop does: a step under way drops the tool calls it has left and the Work ends CANCELLED; one that already ended is left as it is. Sending a message to it later (/steering) reopens it. Answers 200 with the Work.
Errors: 404 WORK_NOT_FOUND, 409 WORK_BUSY (the Stop is still honoured by its next step), 403 FEATURE_NOT_ENABLED.
Parameters
workIdstring (uuid)pathRequired
Responses
200OK
Compact a Work's context now
/api/external/v1/works/{workId}/compactFolds the Work's older history into a summary now instead of when its context fills up, as the Work Center's context meter does: it keeps its knowledge and files, and its next steps read the summary and the recent turns. A Work running in its sandbox compacts there at its next turn. Answers 200 with the Work.
Errors: 404 WORK_NOT_FOUND, 404 NOT_FOUND (its flow is gone), 409 WORK_BUSY, 403 FEATURE_NOT_ENABLED.
Parameters
workIdstring (uuid)pathRequired
Responses
200OK
Hand a Work to another agent or flow
/api/external/v1/works/{workId}/handoffHands the Work to another Work-mode flow or agent of the workspace with its whole history, as the Work Center does: its log, files, knowledge and plan stay; the new flow's settings apply from its next step, and the state the old flow kept is reset. A running Work goes on with the new flow at its next step, a waiting one when it is next told something, an ended one stays ended until it is reopened.
Body: flowId or agentId (one is required; flowId wins). Handing it to the flow and agent it already has changes nothing. Answers 200 with the Work.
Errors: 400 MISSING_FIELD, 400 INVALID_ID, 400 NOT_A_WORK_FLOW, 400 NO_WORK_FLOW, 404 WORK_NOT_FOUND, 404 FLOW_NOT_FOUND, 404 AGENT_NOT_FOUND, 409 WORK_BUSY, 403 FEATURE_NOT_ENABLED.
Parameters
workIdstring (uuid)pathRequired
Request body application/json
object
Responses
200OK
Change a Work's planning mode
/api/external/v1/works/{workId}/modeOverrides the flow's planning settings for this one Work from its next step, as the mode switch of the Work Center's chat does. Send either or both; null goes back to the flow's own setting:
planningMode: NONE (no plan needed), AUTO (a plan when the task calls for one) or ALWAYS (a plan before anything else);planApprovalBehavior: ALWAYS_ASK (every plan waits for a person's approval), AUTO (only plans the Work flags as risky) or ALWAYS_APPROVE.
Answers 200 with the Work (planningModeOverride, planApprovalOverride).
Errors: 400 INVALID_FIELD, 404 WORK_NOT_FOUND, 409 WORK_BUSY, 403 FEATURE_NOT_ENABLED.
Parameters
workIdstring (uuid)pathRequired
Request body application/json
object
Responses
200OK
Pause a Work
/api/external/v1/works/{workId}/pausePauses the Work after its current step, as the Work Center's Pause does; it keeps everything and goes on with /resume. Its Work slot is freed for a Work held SCHEDULED. Answers 200 with the Work.
Errors: 404 WORK_NOT_FOUND, 409 WORK_BUSY (its own step kept saving it: send again), 403 FEATURE_NOT_ENABLED.
Parameters
workIdstring (uuid)pathRequired
Responses
200OK
Resume a Work
/api/external/v1/works/{workId}/resumeBrings a paused, waiting or sleeping Work back to work, as the Work Center's Resume does: it is queued again (or held SCHEDULED while all your Work slots are in use). A deadline that passed while it waited is moved out by the flow's deadline offset. Answers 200 with the Work.
Errors: 404 WORK_NOT_FOUND, 409 WORK_BUSY, 403 FEATURE_NOT_ENABLED.
Parameters
workIdstring (uuid)pathRequired
Responses
200OK
Start a DRAFT Work now
/api/external/v1/works/{workId}/startStarts a Work that was created to start later (DRAFT) right away, as the Work Center's Start now does. The plan's Works a day and Works at once are checked now, as for a new Work; with all your Work slots in use it is held SCHEDULED until one frees up. Answers 200 with the Work.
Errors: 404 WORK_NOT_FOUND, 409 NOT_A_DRAFT (it has started already), 409 PLAN_LIMIT_REACHED, 403 FEATURE_NOT_ENABLED.
Parameters
workIdstring (uuid)pathRequired
Responses
200OK
Count what is live in each Work list
/api/external/v1/works/origin-summaryHow much is going on in each of the Work Center's two lists, as its switch shows it: manual (Works a person started by hand in the app) and autonomous (started by a schedule, an automation, another agent or this API), each with running (running or about to) and needsYou (waiting for a person's input or approval). Top-level Works only; your personal assistant's own Works are not counted.
Errors: 403 FEATURE_NOT_ENABLED.
Responses
200OK