Skip to main content
POST
Typescript (SDK)

Authorizations

Authorization
string
header
required

API key in the format: Bearer {api_token}

Headers

Idempotency-Key
string

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Maximum string length: 255

Path Parameters

id
string
required

Script run id (srun_...)

Response

The cancelled run

object
string
required
id
string
required
status
enum<string>
required
Available options:
queued,
in_progress,
completed,
failed,
cancelled,
timed_out
result
any
required

The script's last expression, as JSON.

output
string | null
required

What the script printed: its start and end when long, with the cut marked.

error
string | null
required
args
string[]
required
calls
object[]
required

Every tool call the script made, in order: {role, status, read_only, error_code, approval_id}. A 202 call did not run and names its approval.

approvals
object[]
required

What the script's gated calls froze, as each stands now. Approving one runs that call, never the script again.

pending_approval_ids
string[]
required

Approvals still waiting for a decision: POST /approvals/{id}/approve or /deny.

artifacts
object[]
required

Files the script wrote to outputDir.

timeout_seconds
integer
required
started_at
string | null
required
completed_at
string | null
required
created_at
string<date-time>
required