Start a managed session
Starts a managed agent session and returns 202 with its session_id and status_path; the agent runs asynchronously, so poll managedAgentsGetSession or subscribe with managedAgentsStreamSessionEvents to follow it. Omit environment_id to run without an own sandbox and use the on-demand compute tools; a selected environment keeps its own sandbox. Model calls and running compute are billed. Requires an Idempotency-Key header: the same key with the exact HTTP method, escaped path, raw query, and raw body bytes returns the original session; any difference is rejected. A reasoning_effort incompatible with the selected model or its frozen output capacity returns 400 before provisioning. Enabled provider_params.promptCacheTTL or provider_params.promptCacheSharedTTL settings with invalid values, an unsupported model, or shared retention shorter than history retention also return 400 before provisioning for the selected root agent version, including for previously stored agent versions. Roster agent cache settings are validated at delegation before creating each child session. A temporarily unavailable model reference or catalog dependency returns 503. An environment on managed compute whose setup script has no verified, current run returns 422 environment_not_verified before provisioning; run managedAgentsCreateEnvironmentSetupRun first. When the tenant is out of credit it returns 403 session_start_not_admitted with details.reason out_of_credit; add credits and retry. When the tenant is suspended it returns the same 403 with details.reason tenant_suspended. A budget above the agent’s multiagent.limits.max_tree_cost_usd returns 400. When the tenant already has as many sessions working at once as it may, it returns 429 tenant_concurrency_limit with details.limit; wait for a session to finish its turn or stop one, then retry. A start made by a connected application, or one that references a session held to the approved model providers, whose agent would send content to a model outside them (OpenAI, Anthropic and Google) returns 403 model_provider_not_approved; details.field names the setting (model, multiagent, oversight, memory or slack_reply_review) and details.model the model.
Authorizations
Headers
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. An abandoned session-create claim may be reclaimed after the server request timeout plus 30 seconds (90 seconds by default). No deduplication is guaranteed after expiry.
1 - 256^[!-~]+$Body
Request body for starting a session: which agent to run, the environment to run it in, the vault grants it receives, and the opening message and/or outcome that gives it work.
The spend at which this session tree (the session and its threads) pauses, in US dollars at the billed price; requests already running finish and can pass it. Omit it to take the agent's multiagent.limits.max_tree_cost_usd, if it declares one, or run without a budget. A budget may tighten the agent's cap, never widen it. Reaching it pauses the session with stop_reason budget_reached; raise the session's budget to continue, or, for a session bound to a Slack thread, reply there after raising it. Budgets are rolling out: where they are not available to the caller, a budget returns 400 and an omitted one starts the session without a budget.
Optional per-item allowlist inside vault_ids. The list is a whitelist across every granted vault, not a filter within one, so it must name every item the session should receive. Omit with explicit vault_ids to enable all items; [] alongside a non-empty vault_ids is rejected because it would enable none. Omit both fields to use the agent version's defaults.
Opening user message for the session, and the context the agent works from. When sent alongside an explicit outcome, it supplies facts the agent needs without making them part of what the evaluator measures. When a graded default is inherited, this message becomes the objective quoted to the evaluator. Kept in the session's system prompt for the whole run, so context compaction cannot summarize it away. Omit it or send an empty string for none; a message of only whitespace is refused with 400.
Caller-defined string key/value pairs stored on the session, e.g. ids that map it back to your own system. Write-once: they cannot be changed after start. At most 32 entries; keys use letters, digits, '_', '.', and '-' up to 64 characters; values are 1-512 characters without control characters. Returned as metadata on GET /managed-agents/v1/sessions and filterable with metadata=key:value (repeatable, AND) or metadata_key=key.
Optional definition of done, graded against its criteria by the selected evaluator agent. Its description is the objective and is quoted to the evaluator; send a message alongside it for context the evaluator should not see. With no message the description opens the session. Omit to inherit the agent version's default criteria only when it also has a default evaluator, graded against this request's message; an outcome sent here is used as given and the agent default is ignored entirely.
- Option 1
- Option 2
- Option 3
Prior readable sessions whose trees this session may use as context. Each id must be in the same organization and readable by the caller; otherwise the entire request returns 404. Session-analyst conversations cannot be referenced. Referencing a session held to the approved model providers (one a connected application started, or one that works on such a session, such as an evaluation of it or a session that referenced it from its start) holds this session to them too: an agent that would send its content to another provider is refused with 403 model_provider_not_approved.
10Files to mount read-only into the session's sandbox, under its files directory, before the first turn. Each attaches the file's content as it is now. One unknown or out-of-scope file_id refuses the whole request with 404 and creates nothing. A file that later fails to mount does not stop the session: look for a warning event with the code session_file_degraded. Requires an environment with a sandbox.
500How this session's tree may work as a team. Every tree has a shared task board: under mode auto (the default) the agent becomes a team the moment it posts its first task, recruiting copies of itself one per claimable task, which share its sandbox, claim work from the board, and are woken by its transitions; mode on makes it a team from turn one; mode off withholds the board. Overrides the agent's multiagent.team mode for this session; an agent with no roster runs under default limits. Governance (thread and cost caps) is the agent's and cannot be widened here.
Response
Response body of POST /managed-agents/v1/sessions, returned with HTTP 202 and a Location header. The 202 is load-bearing: the session is accepted, not started, so no status, sandbox, or event exists yet and nothing here reports success of the run. Poll status_path, or stream events, to observe provisioning and execution.
Response body of POST /managed-agents/v1/sessions, returned with HTTP 202 and a Location header. The 202 is load-bearing: the session is accepted, not started, so no status, sandbox, or event exists yet and nothing here reports success of the run. Poll status_path, or stream events, to observe provisioning and execution.