Skip to main content
POST
Start a workspace run

Authorizations

Authorization
string
header
required

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

Headers

x-ankra-organisation-id
string

PAT organisation override.

Path Parameters

workspace_id
string<uuid>
required

The workspace.

Body

application/json

A command to run in the workspace against the client's snapshot.

agent_id
string
required

The client worktree's id; each gets its own worktree in the pod.

Maximum string length: 128
Pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*$
argv
string[]
required

The command, run without a shell.

Required array length: 1 - 1024 elements
head_sha
string
required

The client's HEAD.

snapshot_sha
string
required

The commit of the client's working tree.

apply
boolean

Run a writer: its changes come back as a patch export.

base_ref
string

The client's origin default branch, refs/remotes/origin/<branch>.

base_sha
string

The commit base_ref points at.

bundle_object_key
string | null

The uploaded delta bundle (object_key of the bundles route); omitted when the workspace lacks nothing.

cwd_prefix
string

The client's directory relative to its worktree root.

env
object

Forwarded environment, held to the server allowlist.

shallow
string[]

The boundary commits of a shallow client clone.

Response

The run, accepted

One command run in a workspace.

apply
boolean
required
argv_preview
string
required

The command line with secret-shaped arguments masked, at most 200 characters.

base_ref
string
required
base_sha
string
required
bundle_object_key
string | null
required
created_at
string<date-time>
required
cwd_prefix
string
required
env_names
string[]
required

The names of the forwarded environment variables, never their values.

exit_code
integer | null
required

The command's exit code, or with started false why it never started (197: resend the full history, 75: the sync failed, 130: cancelled first).

finished_at
string<date-time> | null
required

When the run ended; null while it has not.

head_sha
string
required
run_id
string<uuid>
required
snapshot_sha
string
required
started
boolean | null
required

Whether the command itself started; null when the record alone cannot tell (a cancelled or lost run).

state
enum<string>
required
Available options:
accepted,
running,
finished,
not_started,
cancelled,
lost
user_id
string<uuid>
required
workspace_id
string<uuid>
required