API
REST reference
This page renders the OpenAPI document that this deployment serves at /. The reference below is built from the same contract as that document when the site is built, so it describes the API of the deployment you are looking at. Nothing in it is written by hand.
Reference#
Delegate APIversion 1.0.0 · OpenAPI 3.1.0
Run Delegate missions, follow them to their deliverable and talk to the assistants they build.
Authentication. Send a workspace API token as Authorization: Bearer dlg_…. Tokens are created under Settings → Connections. Cookies are ignored on this API.
Errors. Every non-2xx response is { "error": { "code", "message", "requestId" } }. Branch on code; message is for people.
Idempotency. POST operations accept an Idempotency-Key header. Repeating a request with the same key within 24 hours returns the first response with Idempotent-Replayed: true instead of acting again.
Rate limits. Every response reports the token's request budget in RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (seconds until the window resets).
Compatibility. Within v1, fields and event types may be added; nothing is removed or renamed.
Base URL: /api/v1
- bearerAuth · Authorization: Bearer <token> · A workspace API token (
dlg_…).
Runs
Start missions and follow them to their deliverable.
GET/runs
List runs
The workspace's runs, newest first. Follow nextCursor until it is null to read them all.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size. |
cursor | query | string | nextCursor of the previous page; omit for the newest runs. |
status | query | "planning" | "awaiting_plan_approval" | "running" | "awaiting_approval" | "completed" | "failed" | Only runs in this status. |
Responses
Success.
application/json · RunList
| Name | Type | Description |
|---|---|---|
datarequired | RunSummary[] | |
nextCursorrequired | string | null | Pass as cursor for the next page; null at the end. |
invalid_request: The path, query or body does not match the contract; issues lists why.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
POST/runs
Start a run
Starts a mission. The run begins planning at once and, unless the workspace approves plans automatically, then waits for its plan to be approved.
company-xray(Company X-ray): needs url; optional focusautomation-audit(AI Automation Audit): needs url; optional focus, departmentbuild-agent(Build-an-Agent): needs url, goal; optional name, opportunityId; takes parentRunIdcustom-goal(Custom goal): needs goal; optional urlrepo-xray(Repo X-ray): needs url; optional refautopilot(Autopilot): needs goal; optional url
Runs count against the workspace's hourly run quota; when it is used up the answer is 429 with Retry-After.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | A unique value for this request, for example a UUID. A retry with the same key and the same request returns the first response. |
Request body (required)
application/json · CreateRunRequest
| Name | Type | Description |
|---|---|---|
missionIdrequired | "company-xray" | "automation-audit" | "build-agent" | "custom-goal" | "repo-xray" | "autopilot" | |
inputrequired | RunInput | |
parentRunId | string (uuid) | build-agent only: the automation-audit run the opportunity comes from. |
Responses
Success.
application/json · Run
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | |
missionrequired | string | |
statusrequired | "planning" | "awaiting_plan_approval" | "running" | "awaiting_approval" | "completed" | "failed" | |
terminalrequired | boolean | True once the run completed, failed or was cancelled. |
createdAtrequired | string (date-time) | |
finishedAtrequired | string (date-time) | null | |
totalsrequired | object | |
pendingPlanrequired | RunStep[] | null | The plan waiting for a decision, when status is awaiting_plan_approval. |
pendingApprovalsrequired | object[] | Side effects waiting for a human; they are decided in the web app. |
stepsrequired | RunStep[] | |
artifactsrequired | ArtifactRef[] | |
deliverablerequired | Artifact | null | The final deliverable once the run completed. |
summaryrequired | string | null | |
errorrequired | object | null | |
children | RunChild[] | Autopilot only: the child runs. |
autopilotParent | object | null | |
targetrequired | string | null | Host, repository or shortened goal the run is about. |
executionrequired | "live" | "simulated" | simulated marks a scripted development run; production runs are always live. |
startedAtrequired | string (date-time) | null | |
webUrlrequired | string | Where the run streams live in the web app. |
invalid_request: The path, query or body does not match the contract; issues lists why.
invalid_json: The request body is not valid JSON.
invalid_url: The target URL is not a public company website or GitHub repository.
invalid_idempotency_key: The Idempotency-Key header is empty, too long or not printable ASCII.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
idempotency_in_progress: A request with this Idempotency-Key is still being processed.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unsupported_media_type: The request body must be application/json.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
idempotency_key_reused: This Idempotency-Key was already used with a different request.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
GET/runs/{runId}
Get a run
Status, steps, artifacts, the plan or approvals it is waiting for and, once it completed, the deliverable. An Autopilot run also lists its child runs.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
runIdrequired | path | string (uuid) |
Responses
Success.
application/json · Run
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | |
missionrequired | string | |
statusrequired | "planning" | "awaiting_plan_approval" | "running" | "awaiting_approval" | "completed" | "failed" | |
terminalrequired | boolean | True once the run completed, failed or was cancelled. |
createdAtrequired | string (date-time) | |
finishedAtrequired | string (date-time) | null | |
totalsrequired | object | |
pendingPlanrequired | RunStep[] | null | The plan waiting for a decision, when status is awaiting_plan_approval. |
pendingApprovalsrequired | object[] | Side effects waiting for a human; they are decided in the web app. |
stepsrequired | RunStep[] | |
artifactsrequired | ArtifactRef[] | |
deliverablerequired | Artifact | null | The final deliverable once the run completed. |
summaryrequired | string | null | |
errorrequired | object | null | |
children | RunChild[] | Autopilot only: the child runs. |
autopilotParent | object | null | |
targetrequired | string | null | Host, repository or shortened goal the run is about. |
executionrequired | "live" | "simulated" | simulated marks a scripted development run; production runs are always live. |
startedAtrequired | string (date-time) | null | |
webUrlrequired | string | Where the run streams live in the web app. |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
not_found: Nothing with that id is visible to this token's workspace.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
POST/runs/{runId}/cancel
Cancel a run
Stops a run that has not finished. The run ends as failed with error code cancelled; an Autopilot run also cancels its open children.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
runIdrequired | path | string (uuid) | |
Idempotency-Key | header | string | A unique value for this request, for example a UUID. A retry with the same key and the same request returns the first response. |
Responses
Success.
application/json · Run
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | |
missionrequired | string | |
statusrequired | "planning" | "awaiting_plan_approval" | "running" | "awaiting_approval" | "completed" | "failed" | |
terminalrequired | boolean | True once the run completed, failed or was cancelled. |
createdAtrequired | string (date-time) | |
finishedAtrequired | string (date-time) | null | |
totalsrequired | object | |
pendingPlanrequired | RunStep[] | null | The plan waiting for a decision, when status is awaiting_plan_approval. |
pendingApprovalsrequired | object[] | Side effects waiting for a human; they are decided in the web app. |
stepsrequired | RunStep[] | |
artifactsrequired | ArtifactRef[] | |
deliverablerequired | Artifact | null | The final deliverable once the run completed. |
summaryrequired | string | null | |
errorrequired | object | null | |
children | RunChild[] | Autopilot only: the child runs. |
autopilotParent | object | null | |
targetrequired | string | null | Host, repository or shortened goal the run is about. |
executionrequired | "live" | "simulated" | simulated marks a scripted development run; production runs are always live. |
startedAtrequired | string (date-time) | null | |
webUrlrequired | string | Where the run streams live in the web app. |
invalid_idempotency_key: The Idempotency-Key header is empty, too long or not printable ASCII.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
not_found: Nothing with that id is visible to this token's workspace.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
run_finished: The run already reached a terminal state.
idempotency_in_progress: A request with this Idempotency-Key is still being processed.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
idempotency_key_reused: This Idempotency-Key was already used with a different request.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
Events
The append-only log every run view is derived from.
GET/runs/{runId}/events
Read a run's events
JSON by default: pages in sequence order, continued with after. Poll until terminal is true and hasMore is false.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
runIdrequired | path | string (uuid) | |
after | query | integer | Return events with a sequence greater than this. |
limit | query | integer | Page size (JSON only). |
Responses
Success.
application/json · RunEventPage
| Name | Type | Description |
|---|---|---|
datarequired | RunEvent[] | |
nextAfterrequired | integer | Pass as after for the next page. |
hasMorerequired | boolean | More events were already stored when this page was read. |
terminalrequired | boolean | The run is finished; when hasMore is false too, no event will follow. |
text/event-stream · string
Event stream only: the run is finished and no event follows the given position.
invalid_request: The path, query or body does not match the contract; issues lists why.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
not_found: Nothing with that id is visible to this token's workspace.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
Plans
Decide the plan a run proposes before it starts working.
POST/runs/{runId}/plan/approve
Approve the proposed plan
Approves the plan as proposed, so the run starts working. Editing a plan before approving it is done in the web app.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
runIdrequired | path | string (uuid) | |
Idempotency-Key | header | string | A unique value for this request, for example a UUID. A retry with the same key and the same request returns the first response. |
Request body
application/json · ApprovePlanRequest
Responses
Success.
application/json · PlanDecisionResult
| Name | Type | Description |
|---|---|---|
runIdrequired | string (uuid) | |
decisionrequired | "approved" | "rejected" |
invalid_request: The path, query or body does not match the contract; issues lists why.
invalid_json: The request body is not valid JSON.
invalid_idempotency_key: The Idempotency-Key header is empty, too long or not printable ASCII.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
forbidden: The token's user is not allowed to do this.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
not_found: Nothing with that id is visible to this token's workspace.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
run_finished: The run already reached a terminal state.
no_pending_plan: The run has no plan waiting for a decision.
idempotency_in_progress: A request with this Idempotency-Key is still being processed.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unsupported_media_type: The request body must be application/json.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
idempotency_key_reused: This Idempotency-Key was already used with a different request.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
POST/runs/{runId}/plan/reject
Reject the proposed plan
Rejects the plan; the run stops as failed with error code plan_rejected.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
runIdrequired | path | string (uuid) | |
Idempotency-Key | header | string | A unique value for this request, for example a UUID. A retry with the same key and the same request returns the first response. |
Request body
application/json · RejectPlanRequest
| Name | Type | Description |
|---|---|---|
reason | string | Shown in the run log. |
Responses
Success.
application/json · PlanDecisionResult
| Name | Type | Description |
|---|---|---|
runIdrequired | string (uuid) | |
decisionrequired | "approved" | "rejected" |
invalid_request: The path, query or body does not match the contract; issues lists why.
invalid_json: The request body is not valid JSON.
invalid_idempotency_key: The Idempotency-Key header is empty, too long or not printable ASCII.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
forbidden: The token's user is not allowed to do this.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
not_found: Nothing with that id is visible to this token's workspace.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
run_finished: The run already reached a terminal state.
no_pending_plan: The run has no plan waiting for a decision.
idempotency_in_progress: A request with this Idempotency-Key is still being processed.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unsupported_media_type: The request body must be application/json.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
idempotency_key_reused: This Idempotency-Key was already used with a different request.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
Artifacts
Deliverables, source snapshots and intermediate results.
GET/runs/{runId}/artifacts
List a run's artifacts
References to everything the run has produced so far, without content.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
runIdrequired | path | string (uuid) |
Responses
Success.
application/json · ArtifactList
| Name | Type | Description |
|---|---|---|
datarequired | ArtifactRef[] |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
not_found: Nothing with that id is visible to this token's workspace.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
GET/runs/{runId}/artifacts/{artifactId}
Get an artifact
One artifact with its content, at its latest version.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
runIdrequired | path | string (uuid) | |
artifactIdrequired | path | string |
Responses
Success.
application/json · Artifact
| Name | Type | Description |
|---|---|---|
artifactIdrequired | string | |
kindrequired | string | |
titlerequired | string | |
versionrequired | integer | |
contentrequired | any | The artifact body; its shape depends on kind. |
invalid_request: The path, query or body does not match the contract; issues lists why.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
not_found: Nothing with that id is visible to this token's workspace.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
Assistants
Assistants built by build-agent runs.
GET/assistants
List assistants
The assistants this workspace has built, newest first.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | How many of the most recent assistants to return. |
Responses
Success.
application/json · AssistantList
| Name | Type | Description |
|---|---|---|
datarequired | AssistantSummary[] |
invalid_request: The path, query or body does not match the contract; issues lists why.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
POST/assistants/{assistantId}/chat
Ask an assistant
Answers one question from the assistant's sources, with citations. Nothing is stored between calls: send earlier turns in history. Questions count against the workspace's hourly question quota.
Authentication: bearerAuth
Parameters
| Name | In | Type | Description |
|---|---|---|---|
assistantIdrequired | path | string (uuid) | |
Idempotency-Key | header | string | A unique value for this request, for example a UUID. A retry with the same key and the same request returns the first response. |
Request body (required)
application/json · ChatRequest
| Name | Type | Description |
|---|---|---|
questionrequired | string | |
history | ChatTurn[] | Earlier turns of this conversation, oldest first. |
Responses
Success.
application/json · ChatAnswer
| Name | Type | Description |
|---|---|---|
answerrequired | string | |
citationsrequired | Citation[] | |
groundedrequired | boolean | Every claim in the answer is backed by a cited passage. |
refusedrequired | boolean | |
refusalrequired | object | null | Why the assistant declined, when refused is true. |
servedByrequired | object | null | |
usagerequired | object | |
durationMsrequired | number |
text/event-stream · string
invalid_request: The path, query or body does not match the contract; issues lists why.
invalid_json: The request body is not valid JSON.
invalid_idempotency_key: The Idempotency-Key header is empty, too long or not printable ASCII.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unauthorized: The bearer token is missing, malformed, unknown or revoked.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
not_found: Nothing with that id is visible to this token's workspace.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
idempotency_in_progress: A request with this Idempotency-Key is still being processed.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
payload_too_large: The request body is larger than this operation accepts.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unsupported_media_type: The request body must be application/json.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
idempotency_key_reused: This Idempotency-Key was already used with a different request.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
rate_limited: A request or run quota is used up; Retry-After says when to try again.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
internal: The server failed; quote the requestId when reporting it.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
unavailable: A dependency (model capacity, the knowledge store) is unavailable right now.
application/json · Error
| Name | Type | Description |
|---|---|---|
errorrequired | object |
Meta
This document.
GET/openapi.json
This OpenAPI document
Generated from the same schemas the server validates with. No token needed.
No authentication.
Responses
The document.
application/json · Record<string, any>
Schemas
Errorobject
The body of every non-2xx response.
| Name | Type | Description |
|---|---|---|
errorrequired | object |
RunInputobject
Mission input. Which fields a mission takes is listed on POST /runs.
| Name | Type | Description |
|---|---|---|
url | string | Company website, or a public GitHub repository for repo-xray. |
goal | string | What the work should achieve (build-agent, custom-goal, autopilot). |
focus | string | What to look at more closely. |
department | string | Limit an automation audit to one department. |
name | string | Name of the assistant to build. |
opportunityId | string | The audit opportunity a build-agent run implements. |
ref | string | Branch, tag or commit for repo-xray. |
CreateRunRequestobject
A mission and its input.
| Name | Type | Description |
|---|---|---|
missionIdrequired | "company-xray" | "automation-audit" | "build-agent" | "custom-goal" | "repo-xray" | "autopilot" | |
inputrequired | RunInput | |
parentRunId | string (uuid) | build-agent only: the automation-audit run the opportunity comes from. |
RunStepobject
| Name | Type | Description |
|---|---|---|
idrequired | string | |
objectiverequired | string | |
statusrequired | "pending" | "running" | "succeeded" | "failed" | |
summary | string |
ArtifactRefobject
| Name | Type | Description |
|---|---|---|
artifactIdrequired | string | |
kindrequired | string | |
titlerequired | string | |
versionrequired | integer |
Artifactobject
One artifact of a run, with its content.
| Name | Type | Description |
|---|---|---|
artifactIdrequired | string | |
kindrequired | string | |
titlerequired | string | |
versionrequired | integer | |
contentrequired | any | The artifact body; its shape depends on kind. |
RunChildobject
| Name | Type | Description |
|---|---|---|
nodeIdrequired | string | |
missionIdrequired | string | |
labelrequired | string | |
runIdrequired | string (uuid) | null | |
statusrequired | string | |
summaryrequired | string | null | |
deliverablerequired | object | null | |
linksrequired | object[] | |
needsHumanrequired | string[] |
Runobject
A run: status, steps, artifacts and, once finished, the deliverable.
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | |
missionrequired | string | |
statusrequired | "planning" | "awaiting_plan_approval" | "running" | "awaiting_approval" | "completed" | "failed" | |
terminalrequired | boolean | True once the run completed, failed or was cancelled. |
createdAtrequired | string (date-time) | |
finishedAtrequired | string (date-time) | null | |
totalsrequired | object | |
pendingPlanrequired | RunStep[] | null | The plan waiting for a decision, when status is awaiting_plan_approval. |
pendingApprovalsrequired | object[] | Side effects waiting for a human; they are decided in the web app. |
stepsrequired | RunStep[] | |
artifactsrequired | ArtifactRef[] | |
deliverablerequired | Artifact | null | The final deliverable once the run completed. |
summaryrequired | string | null | |
errorrequired | object | null | |
children | RunChild[] | Autopilot only: the child runs. |
autopilotParent | object | null | |
targetrequired | string | null | Host, repository or shortened goal the run is about. |
executionrequired | "live" | "simulated" | simulated marks a scripted development run; production runs are always live. |
startedAtrequired | string (date-time) | null | |
webUrlrequired | string | Where the run streams live in the web app. |
RunSummaryobject
A run as it appears in a list.
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | |
missionrequired | string | |
targetrequired | string | null | |
statusrequired | "planning" | "awaiting_plan_approval" | "running" | "awaiting_approval" | "completed" | "failed" | |
executionrequired | "live" | "simulated" | simulated marks a scripted development run; production runs are always live. |
createdAtrequired | string (date-time) | |
startedAtrequired | string (date-time) | null | |
finishedAtrequired | string (date-time) | null | |
webUrlrequired | string |
RunListobject
One page of runs, newest first.
| Name | Type | Description |
|---|---|---|
datarequired | RunSummary[] | |
nextCursorrequired | string | null | Pass as cursor for the next page; null at the end. |
RunEventobject
One entry of a run's append-only event log.
| Name | Type | Description |
|---|---|---|
runIdrequired | string (uuid) | |
seqrequired | integer | Position in the run's log, starting at 1. |
atrequired | string (date-time) | |
typerequired | string | One of: run.created, plan.proposed, plan.approved, plan.revised, step.started, agent.spawned, agent.message, tool.called, tool.result, policy.decided, artifact.created, artifact.updated, critic.flagged, approval.requested, approval.resolved, usage.updated, step.completed, run.completed, run.failed, model.fallback, connector.call, sandbox.command, ship.approval.requested, ship.approval.decided, pr.opened, playbook.applied, child.started, child.completed. New types may be added. |
stepId | string | |
agentId | string | |
payloadrequired | Record<string, any> |
RunEventPageobject
One page of a run's events, in order.
| Name | Type | Description |
|---|---|---|
datarequired | RunEvent[] | |
nextAfterrequired | integer | Pass as after for the next page. |
hasMorerequired | boolean | More events were already stored when this page was read. |
terminalrequired | boolean | The run is finished; when hasMore is false too, no event will follow. |
ApprovePlanRequestobject
No fields.
RejectPlanRequestobject
Why the plan is rejected.
| Name | Type | Description |
|---|---|---|
reason | string | Shown in the run log. |
PlanDecisionResultobject
The recorded plan decision.
| Name | Type | Description |
|---|---|---|
runIdrequired | string (uuid) | |
decisionrequired | "approved" | "rejected" |
ArtifactListobject
The artifacts a run has produced so far.
| Name | Type | Description |
|---|---|---|
datarequired | ArtifactRef[] |
AssistantSummaryobject
An assistant built by a build-agent run.
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | |
namerequired | string | |
urlrequired | string | The website the assistant was trained on. |
statusrequired | "draft" | "ready" | |
passRaterequired | number | null | Share of its own evals it passes. |
pagesrequired | integer | |
runIdrequired | string (uuid) | The build-agent run that produced it. |
createdAtrequired | string (date-time) | |
webUrlrequired | string |
AssistantListobject
The workspace's assistants, newest first.
| Name | Type | Description |
|---|---|---|
datarequired | AssistantSummary[] |
ChatTurnobject
| Name | Type | Description |
|---|---|---|
rolerequired | "user" | "assistant" | |
contentrequired | string |
ChatRequestobject
A question for an assistant.
| Name | Type | Description |
|---|---|---|
questionrequired | string | |
history | ChatTurn[] | Earlier turns of this conversation, oldest first. |
Citationobject
| Name | Type | Description |
|---|---|---|
indexrequired | integer | The [n] marker in the answer. |
chunkIdrequired | string | |
urlrequired | string | |
title | string | |
quote | string |
ChatAnswerobject
An assistant's cited answer.
| Name | Type | Description |
|---|---|---|
answerrequired | string | |
citationsrequired | Citation[] | |
groundedrequired | boolean | Every claim in the answer is backed by a cited passage. |
refusedrequired | boolean | |
refusalrequired | object | null | Why the assistant declined, when refused is true. |
servedByrequired | object | null | |
usagerequired | object | |
durationMsrequired | number |
WebhookRunobject
The run a delivery is about, as it was when the event happened.
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | |
missionrequired | string | |
targetrequired | string | null | |
statusrequired | "planning" | "awaiting_plan_approval" | "running" | "awaiting_approval" | "completed" | "failed" | |
createdAtrequired | string (date-time) | |
startedAtrequired | string (date-time) | null | |
finishedAtrequired | string (date-time) | null | |
summaryrequired | string | null | |
errorrequired | object | null | |
totalsrequired | object | |
urlrequired | string | The run in the web app. |
WebhookApprovalobject
The decision a run is waiting for.
| Name | Type | Description |
|---|---|---|
idrequired | string | |
kindrequired | "plan" | "tool" | "ship" | plan can be decided through the API; tool and ship are decided in the web app. |
summaryrequired | string | |
urlrequired | string | Where a person decides it. |
RunCompletedWebhookobject
A run finished and its deliverable is ready.
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | Unique per endpoint and event; the same on every retry. |
createdrequired | string (date-time) | When the event happened. |
apiVersionrequired | "v1" | |
typerequired | "run.completed" | |
datarequired | object |
RunFailedWebhookobject
A run stopped with an error.
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | Unique per endpoint and event; the same on every retry. |
createdrequired | string (date-time) | When the event happened. |
apiVersionrequired | "v1" | |
typerequired | "run.failed" | |
datarequired | object |
RunCancelledWebhookobject
A run was cancelled by a user or through the API.
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | Unique per endpoint and event; the same on every retry. |
createdrequired | string (date-time) | When the event happened. |
apiVersionrequired | "v1" | |
typerequired | "run.cancelled" | |
datarequired | object |
ApprovalRequestedWebhookobject
A run is waiting for a human decision: a plan, a connector tool call or a pull request.
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | Unique per endpoint and event; the same on every retry. |
createdrequired | string (date-time) | When the event happened. |
apiVersionrequired | "v1" | |
typerequired | "approval.requested" | |
datarequired | object |
TestWebhookobject
Sent from the settings page to check an endpoint.
| Name | Type | Description |
|---|---|---|
idrequired | string (uuid) | Unique per endpoint and event; the same on every retry. |
createdrequired | string (date-time) | When the event happened. |
apiVersionrequired | "v1" | |
typerequired | "webhook.test" | |
datarequired | object |
Authentication#
API requests use the same workspace tokens as the MCP endpoint, sent as a bearer token:
Authorization: Bearer <your-delegate-token>Create and revoke tokens under Settings, Connections, as described in connect Claude Code, Codex, Cursor and VS Code. A request made with a token runs with the same tenant isolation, quotas, policies and approvals as a request from the browser. A token cannot change workspace settings.
If you are driving Delegate from an agent#
The MCP endpoint exposes missions and runs as tools, with a long-poll for progress, and is usually the shorter path for a coding agent.