Skip to main content
Client App BuilderVersion: v3

Get the current state of a run (poll-friendly).

GET/ai-builder-api/projects/{projectId}/runs/{runId}

Strictly tenant- and project-scoped. A run that exists under a different projectId (or under a different tenant entirely) returns 404 not_found — never 403, never the run record. This matches OWASP API1:2023 Broken Object Level Authorization guidance: same shape for "doesn't exist" and "not yours".

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your access token.

Scope:clientportal-ai.readonly
Auth methods:OAuthPrivate Integration
Token type:Sub-Account Token

Request​

Headers

Versionstringrequired

The API version.

Available optionsv3
Example:v3

Path Parameters

projectIdstringrequired

The project's id.

Possible values: Value must match regular expression ^prj_[A-Za-z0-9_-]+$

Example:prj_5f0c2a3e
runIdstringrequired

The run's id.

Possible values: Value must match regular expression ^run_[A-Za-z0-9_-]+$

Example:run_8f3c2a91

Response

Run state.

runIdstringrequired

The run.

Example:run_8f3c2a91
projectIdstringrequired

The project the run belongs to.

Example:prj_5f0c2a3e
promptstringrequired

What the run was asked to build or change.

Example:Add a page listing upcoming events
displayTextstring

The creator-facing text of this run's user bubble when it differs from prompt (see SubmitAgentRunRequest.displayText).

Example:Fix these issues
promptAuthorobject

Who sent the prompt.

statusAgentRunStatusrequired

The run's status.

Available optionsqueuedrunningdeployingreadyfailedcancelledneeds_input
phasestring

Internal Spec Kit phase for the active builder run. Stream-v6 maps this to user-facing data-status.data.phase values such as planning, clarifying, coding, and building.

Available optionsinitconstitutionspecifyclarifyplantasksanalyzeimplementindexingbuilddeployready
Example:plan
phaseStatusstring

Phase-local status for the active Spec Kit phase.

Available optionsqueuedrunningawaiting_inputterminal
Example:running
awaitingQuestionobject

The question the run is paused on, while it waits for the creator.

pendingQuestionsobject[]

The questions a first build asks before it starts, while status is needs_input: answer them all with POST .../runs/{runId}/answers/batch, each by its capId.

publicPhaseStateobject

Where the run is, in the words the builder shows the creator.

createdAtstring<date-time>required

When the run was created.

Example:2026-10-15T09:30:00.000Z
updatedAtstring<date-time>required

When the run last changed.

Example:2026-10-15T09:41:12.000Z
checkProblemsstring[]

Problems the check found in a build written by an outside agent (externalAgent: true) that still built and deployed. Fix them with another set of edits and run.

Example:["pages/learn.vue: 'courses' is possibly undefined"]
previewUrlstring<uri>

Convenience field equal to preview.primaryUrl. Kept for single-service callers; multi-service callers should read preview.services[] for per-service URLs. This is the durable customer-facing preview URL produced after a successful build/deploy, not the live sandbox edit URL.

Example:https://preview.example.com/my-portal
previewobject

Where to see what the run built.

livePreviewUrlstring<uri>deprecated

Deprecated 2026-05-17. Will be removed 2026-11-17. Use sandboxUrl instead — same value, accurate name.

Misleadingly named: this is the SANDBOX URL (the agent's HMR/edit workshop), not the customer-facing preview. The customer preview lives at previewUrl. Co-populated with sandboxUrl for the deprecation window; readers should migrate to sandboxUrl.

Example:https://sbx-prj-5f0c2a3e.example.com
livePreviewStatusstringdeprecated

Deprecated 2026-05-17. Will be removed 2026-11-17. Use sandboxStatus instead.

Available optionsstartingreadyfailedstopped
Example:ready
sandboxUrlstring<uri>

URL of the project sandbox runtime. This is the agent's compile + HMR workshop — NOT the customer-facing preview. The customer preview is at previewUrl, which surfaces in the builder UI's right pane after the deploy gate succeeds.

Example:https://sbx-prj-5f0c2a3e.example.com
sandboxStatusstring

Current state of the sandbox dev server.

Available optionsstartingreadyfailedstopped
Example:ready
publishedUrlstring<uri>

URL of the production ("Published") runtime service for this project. Populated when the project has been explicitly published at least once. Distinct from previewUrl/preview.primaryUrl, which always point at the durable customer preview service that auto-updates on every successful agent run. Absent for projects that have never been published — the FE renders "Not published" in that case.

Example:https://my-portal.example.com
publishedAtstring<date-time>

ISO-8601 timestamp of the most recent publish, snapshotted onto the run at the moment it reached ready. Used by the FE to render staleness like "Last published 5 hours ago".

Example:2026-10-14T18:02:00.000Z
runsSinceLastPublishinteger

Number of successful (status=ready) runs completed since the project was last published. Reset to 0 by publish. Snapshotted onto each ready run so the FE can render a staleness indicator without an extra round-trip. Absent for projects that have never been published.

Possible values: >= 0

Example:2
summarystring

AI-generated 1-line checkpoint description, snapshotted onto the run record at setStatus("ready") time. Sourced from the agent's completion narrator event when present, otherwise falls back to a deterministic prompt-derived stub. Read by Timeline + chat UI so users see "what changed in this checkpoint" at a glance. Absent on non-terminal or legacy runs.

Example:Added an events page
imageUristringdeprecated

Deprecated: no longer returned. It named the builder's own image registry.

Example:registry.example.com/apps/web:run_8f3c2a91
imageDigeststringdeprecated

Deprecated: no longer returned. It named the builder's own image.

Example:sha256:3b1f0c9e2d7a
failureMessagestring

Why the run failed, in one line.

Example:The build failed: pages/events.vue has a type error
failureobject

Structured failure taxonomy for a terminated run. Set in tandem with failureMessage (which is the human-readable derivation). Discriminated by category; consumers should branch on category + code to render an actionable hint instead of a generic "Internal error".

metadataobjectdeprecated

Deprecated: no longer returned. It held the builder's own debugging state.