Skip to main content
POST
Start a managed session

Authorizations

Authorization
string
header
required

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

Headers

Idempotency-Key
string
required

Replay-protection key in an organization-wide namespace shared by keyed mutations. It must contain 1 to 256 visible ASCII characters and be sent as exactly one header value. Request identity is the exact HTTP method, escaped path, raw query, and raw body bytes. The same request replays the original successful response; any different request returns 409 idempotency_conflict, and an active matching request returns 409 idempotency_in_progress. Completed receipts are retained for approximately 24 hours, pending claims may be reclaimed after approximately 1 hour, and no deduplication is guaranteed after expiry.

Required string length: 1 - 256
Pattern: ^[!-~]+$
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

Body

application/json
agentId
string
required

Agent to run.

budget
object

Tree cost cap.

credentialRefs
object[]

Selected credentials within the granted vaults.

environmentId
string

Environment whose sandbox the session uses.

externalSourceId
string

Identity within the external source; set with externalSourceType.

externalSourceType
string

External source kind; set with externalSourceId.

message
string

Opening user message.

metadata
object

Caller-defined string labels.

outcome
object

Optional definition of done.

projectId
string

Project billed for the session.

referencedSessionIds
string[]

Prior sessions this session may read.

Maximum array length: 10
resources
object[]

Files to mount in the session.

Maximum array length: 500
skipDefaultOutcome
boolean
default:false

Start ungraded when the agent version defines a default outcome.

team
object

Per-session team setting.

vaultIds
string[]

Vault grants for this session.

Response

Accepted

sessionId
string
required

Server-assigned session identifier.

statusUrl
string
required

Path to poll for provisioning and execution status.