Skip to main content
GET
Get a setup run, optionally waiting for it to finish

Authorizations

Authorization
string
header
required

A Recursion API key, created in the console under API keys.

Headers

x-tenant-id
string

Optional tenant consistency check. When present, it must name the tenant bound to the API key, including when x-organization-id is default.

Minimum string length: 1
x-organization-id
string

Organization in which to act. Required for a tenant-scoped API key. Optional for an organization-scoped key, where it must name that same organization. The value may be an organization id or default.

Minimum string length: 1

Path Parameters

environmentId
string<uuid>
required

Environment id (UUID).

setupRunId
string<uuid>
required

Setup run id as returned by managedAgentsCreateEnvironmentSetupRun or the environment's setup_verification.active_setup_run_id.

Query Parameters

wait_seconds
integer

Block up to this many seconds for the run to reach succeeded, failed, or cancelled before responding. The server caps the wait at 5 seconds; larger values are accepted and clamped. 0 (the default) returns immediately and is recommended through the public API: sleep two seconds client-side and repeat to avoid timeouts on long-held requests.

Required range: 0 <= x <= 60

Response

One execution of an environment's setup script on fresh compute: provision, GPU check, script, profile, image capture, cleanup. Read status until terminal, then hint, failed_line, and stderr_tail; the full log is a separate call.

One execution of an environment's setup script on fresh compute: provision, GPU check, script, profile, image capture, cleanup. Read status until terminal, then hint, failed_line, and stderr_tail; the full log is a separate call.

created_at
string<date-time>
required

When the run was requested.

environment_id
string
required

Environment whose setup ran.

kind
string
required

manual (requested through the API), runner_refresh (automatically captures an image for the current runner), or session (legacy in-session setup).

organization_id
string
required

Organization that owns the environment.

setup_run_id
string
required

Server-assigned id of the run.

status
string
required

queued, provisioning, running, succeeded, failed, or cancelled. Poll until one of the last three; managedAgentsGetEnvironmentSetupRun accepts wait_seconds to do that server-side.

compute_id
string

Provider id of the compute the run used. Released when the run ends.

compute_profile
object

What the compute turned out to be: vCPUs, memory, GPUs, Docker state, image tools. Recorded after setup passed.

duration_ms
integer<int64>

Wall-clock duration in milliseconds, provisioning included.

Required range: -9007199254740991 <= x <= 9007199254740991
exit_code
integer

Exit code of the setup script when it ran. 124 means the timeout elapsed.

Required range: -9007199254740991 <= x <= 9007199254740991
failed_command
string

The failing line's command as written, unexpanded.

failed_line
integer<int64>

1-based line in the setup script whose command exited non-zero. 0 when unknown.

Required range: -9007199254740991 <= x <= 9007199254740991
failure_code
string

Machine-readable failure class when the run did not succeed: environment_setup_failed, sandbox_capacity_unavailable, sandbox_gpu_not_ready, sandbox_provision_timeout, and so on. Same vocabulary as session failures.

fingerprint
string

Hash of the environment configuration the run executed.

finished_at
string<date-time>

When the run reached a terminal status.

gpu_readiness
object

GPU readiness report for accelerator environments.

hint
string

Likely fix when the failure cause is recognised.

hint_code
string

Stable identifier of the recognised failure cause.

image
string

Runner image the compute booted.

imageCapture
object

Capture failure recorded without changing the setup script verdict.

imageId
string

Agent Service image id being captured.

log_bytes
integer<int64>

Bytes of log persisted for the run.

Required range: -9007199254740991 <= x <= 9007199254740991
log_lines
integer<int64>

Lines of log persisted for the run. The last line's seq equals this; pass it as after to tail.

Required range: -9007199254740991 <= x <= 9007199254740991
log_truncated
boolean

True when the script produced more output than the run keeps (4 MiB); the head and the stderr tail are retained.

message
string

One-sentence description of the outcome.

next_action
object

The call that acts on this result: re-run setup after fixing the script, or fetch the log.

phase
string

Current or final phase: provision, gpu_check, setup, profile, commit, cleanup.

providerRunId
string

Durable Agent Service run id executing the setup script.

requested_by_user_id
string

User who requested a manual run.

session_id
string

Session the run provisioned, for kind session.

setupImage
object

Immutable image published by this run when capture succeeded.

started_at
string<date-time>

When provisioning began.

stderr_tail
string

Last lines of stderr, redacted and bounded to 2 KiB.