Skip to main content
You reach Managed Agents from code over REST or MCP, and both use the same API key:
  1. Create an API key in the Recursion console under Settings › API keys. See API keys.
  2. Call the REST API at https://api.recursion.labelbox.com/managed-agents with the key as a bearer token. This page covers its rules.
  3. Or connect an MCP client to the authenticated MCP endpoint at https://api.recursion.labelbox.com/mcp with the same key. See Connect to the Recursion MCP.
Every operation follows the same rules for authentication, retries, paging, and errors. Read this page once, then use the generated Endpoints reference as the authority for each operation’s exact schema, error alternatives, headers, and retry strategy.

Base URL

Operations use one of these versioned base paths:
V2 operations use their published camelCase fields and, for paginated lists, items responses. Each operation is published under one version; follow its path and schema in Endpoints.

Catalog migration

The v1 agent template, agent CRUD and version, agent tag writes, agent memory list, vault list and read, vault credential list and read, file upload and reads, MCP server probe, integration connection, install, probe, selection, disconnection, and catalog operations, evaluations, evaluation runs, session outcomes and pending inputs, and memory reads and deletion are deprecated where v2 counterparts exist. Their v1 paths continue to work for existing clients. Use the corresponding /managed-agents/v2/... path for new integrations. V2 agent creation, file upload, and outcome creation return 201 Created with Location; v2 agent deletion and integration disconnection return 204 No Content. Paged v2 lists use cursor/nextCursor with the same limit; some return 409 snapshot_stale, in which case restart without a cursor. The versions also have different field names and list envelopes, so update request and response models when migrating. The Endpoints reference shows each version’s exact schema. There is no announced removal date for these v1 operations. Operations without a v2 counterpart continue to use v1.

Authentication

Send an API key as a bearer token on every request:
Create the key in the console under Settings › API keys. See API keys for scopes, expiry, and safe storage. A key acts as you, with the role you hold in that organization at the moment of the request. If an admin changes your role, your keys follow on the next request. Once the organization is resolved, the response carries recursion-organization-id and recursion-tenant-id headers that name the scope the request ran in.

REST client setup

Export your key, then choose cURL, the CLI, or the TypeScript SDK. Endpoints has each operation’s exact schema. See Python and other languages to translate the same requests to an HTTP client.
The default CLI install selects the current Recursion release on latest; install the SDK with @preview. Pin exact client versions for reproducible integrations. Both clients stay below 1.0.0 and may include breaking changes. Upgrade the SDK or CLI when you need a newer API operation. The CLI reads RECURSION_API_KEY from the environment. The TypeScript SDK returns API errors in result.error; network and decoding failures throw. A successful call returns the models you can use in agents: The values below illustrate the response shape; use a returned modelId when creating an agent.

Tenant-scoped keys

A tenant-scoped key must name the organization on every request. Use an organization id, or default for your tenant’s default organization.

Call shape

Call https://api.recursion.labelbox.com/managed-agents/<version>/<path>, using the version published for each operation in Endpoints. Send JSON bodies with Content-Type: application/json. Send ordinary request bodies as JSON. A body in a media type the API doesn’t accept returns 415 unsupported_media_type. Two kinds of upload use multipart/form-data instead: skill bundle uploads and file uploads with uploadFileV2. See Skills and Files.

Python and other languages

Send the same REST requests the cURL samples show from any HTTP client, with the bearer header on each one. For example, with httpx:
Translate any cURL sample the same way: include the operation’s published /v1 or /v2 path, -d becomes a JSON body, and each -H becomes a header, such as Idempotency-Key on startSession. Use a client such as httpx or requests. Requests sent with the defaults of Python’s built-in urllib may be refused.

Asynchronous session starts

startSession returns 202 Accepted as soon as the session is recorded. It doesn’t wait for the sandbox or the agent.
Follow the session with getSession or by streaming its events. The session record is authoritative. The event stream is written separately and can lag it, so an empty event list doesn’t mean the session is still starting. What success means depends on the work:

Idempotent mutations

Mutations with declared retry semantics publish their strategy in the API contract. This inventory is generated from that same contract and includes only operations published by the standalone API: The operations currently in each strategy are:
  • key-required: addDatasetRowsFromSessions, createAutomation, createDataset, createDatasetVersion, createEnvironmentSetupRun, createEnvironmentSetupRunV2, createEventSource, createFineTuningJob, removeDatasetRows, runAutomation, startAgentSessionUpgrade, startSession, startSessionV2, startSimulationRun
  • key-supported: cancelFineTuningJob, createAgent, createAgentV2, createEnvironment, createEnvironmentV2, createSkillGroupV2, createSkillV2, createSkillVersionV2, createTag, createVault, createVaultCredential, createVaultCredentialV2, createVaultV2, deleteSessionBudget, deleteSessionBudgetV2, importAgentV2, replaceSessionBudget, replaceSessionBudgetV2, resumeFineTuningJob, resumeSession, resumeSessionV2, sendSessionEvents, sendSessionEventsV2, updateAgentMemorySettings, updateEnvironment, updateEnvironmentV2
  • naturally-idempotent: applyAgentTagV2, cancelSessionsV2, cancelSessionV2, cancelSimulationRun, deleteAgentTagV2, deleteTag, previewAgentImportV2, registerPendingIntegrationConnectionV2, replaceAgentTagsV2, replaceSessionAgentVersion, replaceSessionAgentVersionV2, updateDataset, updateFineTuningJob
  • retry-unsafe: cancelAgentSessionUpgrade, cancelEnvironmentSetupRunV2, completeImapOauthAuthorization, completeIntegrationInstall, completeIntegrationInstallV2, createAgentVersion, createAgentVersionV2, createSkill, createSkillVersion, defineSessionOutcomeV2, deleteAgentV2, deleteAutomation, deleteDataset, deleteEnvironmentV2, deleteEventSource, deleteIntegrationConnectionV2, deleteMemoryV2, deleteSessionV2, deleteSkillGroupV2, deleteSkillV2, deleteVaultCredentialV2, deleteVaultV2, interruptSessionV2, openAgentAnalyst, openAssistant, openFineTuningAnalyst, openSessionAnalystV2, pauseAutomation, pauseEventSource, probeIntegrationConnectionV2, probeMcpServerV2, publishSkillBundle, publishSkillBundleV2, publishSkillVersionBundle, publishSkillVersionBundleV2, replaceAutomation, replaceEventSource, resumeAutomation, resumeEventSource, runAutomationClassifierTest, startEvaluations, startImapOauthAuthorization, startIntegrationInstall, startIntegrationInstallV2, submitAssistantInteractionDecision, submitAssistantInteractionDecisionV2, updateIntegrationConnectionSelection, updateIntegrationConnectionSelectionV2, updateSkillGroupV2, updateSkillV2, updateTag, updateVault, updateVaultCredentialV2, updateVaultV2, uploadFile, uploadFileV2
A key-required operation rejects a missing Idempotency-Key. A key-supported operation accepts the header optionally. Use a stable key for each logical mutation so an ambiguous network retry cannot repeat its effect. Keys hold 1 to 256 visible ASCII characters, sent as exactly one header value. A malformed or repeated header returns 400 invalid_request. Unless an operation’s Idempotency-Key description narrows the scope (to the caller, the operation and the resource), keys share one namespace per organization and across keyed operations, so use a different key for each logical mutation. A completed key is remembered for about 24 hours, and an abandoned in-progress session-create request can be retried after the server request timeout plus 30 seconds (about 90 seconds by default). Other abandoned in-progress keys can be reused after about 1 hour. Keep the same key and exact request when retrying. Send Idempotency-Key as a request header. Retry with the same request target and body bytes: JSON whitespace and key order, query ordering and escaping, and path escaping are significant. For createVault, pass the optional Idempotency-Key header. The retired body field idempotency_key is rejected. The key also determines the vault id, so an unchanged vault remains recoverable after the response receipt expires. If that vault was changed or deleted, reuse conflicts and a replacement requires a new key. A naturally-idempotent operation is safe to repeat by its own resource semantics, as far as its natural key (x-recursion-idempotency.naturalKey) reaches. cancelSessionsV2 is the partial case: a call that names sessionIds is safe to repeat, but a selection (agentId, status or all) is read again on every call, so repeating it also stops sessions that started matching since the first. Do not automatically retry a retry-unsafe operation after an ambiguous transport failure: inspect the affected resource or operation state first. An undeclared operation has no replay guarantee. Sending Idempotency-Key to any of these operations does not add one.

Pagination

Paged list operations return a continuation token. Each operation documents its own default and maximum page size. A page can hold fewer items than limit, or none, and still have a next token: event pages have a size budget, and a session list returns what it found when a filter matches few sessions in a long history. Keep reading while the token is present. A session-list token is valid for one hour and only with the filters and limit it was issued for. A token that’s no longer valid returns 400 invalid_request with details.field set to page_token (v1) or cursor (v2), so restart the list without it. Some v2 lists return 409 snapshot_stale when a cursor can no longer continue. Restart those lists without cursor. Repository listings for selected-repository installations may be up to a minute old, and provider-backed listings can move items between pages even without a 409; deduplicate when collecting them.

Errors

Every 4xx and 5xx response is a flat object with required code and message fields and optional details:
Check the HTTP status and code on every non-2xx response. Use the generated Endpoints reference for an operation’s exact status and code alternatives. See Errors for common recovery guidance.

Rate limits

Ordinary API calls, including automation result polls, share a default allowance of 1,000 requests per rolling 60 seconds. Session creates have their own allowance of the same size. Listing sessions and fetching a session by ID share a third allowance of the same size. REST and MCP share the allowances for session creates, lists and individual lookups. Each list page and each poll of an individual session spend one request from the shared inventory allowance. To follow a running session without repeated lookups, use its event stream. All API keys for a person share these allowances across tenants and organizations. A service account shares its allowances across its keys. Console traffic has its own allowances. The X-RateLimit-Bucket header names the allowance charged. Ordinary requests use default, session creates use session-create, and session lists and lookups use session-inventory. REST reads of session images and event content use a separate content allowance. MCP event-content reads use default. Read X-RateLimit-Limit for the size of the named allowance and X-RateLimit-Remaining for its available requests. On success, X-RateLimit-Reset gives the seconds until the oldest counted request expires. When an allowance refuses a request, the API returns 429 with zero remaining. Both X-RateLimit-Reset and Retry-After give the seconds until that allowance reopens. A service at capacity can also return 429 after a request has spent one unit of its allowance, even with requests remaining. Event streams also have a concurrent connection limit. Retry-After supplies timing, not replay permission. Honor it only when the operation’s generated retry strategy permits replay and details.retryable is not false. When a permitted retry has no Retry-After, back off exponentially with jitter, starting around one second. See Limits for every other limit.

Request ids

Every response carries an x-request-id header, and error bodies repeat it as details.requestId. You can send your own x-request-id of up to 128 letters, digits, _, ., :, or -, and it’s echoed back so you can match it to your own logs.

Next steps

Quickstart

Create an environment and an agent, start a session, and read the reply.

Errors

Look up every error code with its cause, fix, and retry guidance.

Limits

Find every size, count, and time limit in one place.

Troubleshooting

Match a symptom to its cause and fix.