Skip to main content
POST
Create a new immutable agent version

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

agentId
string<uuid>
required

Agent id (UUID) as returned by managedAgentsCreateAgent or managedAgentsListAgents.

Body

application/json

Request body for creating a new immutable standalone Managed Agent version. Every field is full content; omitted fields are cleared. baseAgentVersionId must name the current version or the request is rejected with revision_conflict.

baseAgentVersionId
string<uuid>
required
write-only

The agent's current latestAgentVersionId, as returned by managedAgentsGetAgent. Rejected with 409 revision_conflict if it is not the agent's current version, whether stale or unknown.

model
string
required

Public model id copied from GET /managed-agents/v1/models (for example anthropic/claude-sonnet-5-5). Agent reads return the same public id. An id the catalog does not list is rejected with a list of available public ids.

name
string
required

Human-readable label for the agent. Required, and not blank; surrounding whitespace is trimmed.

system
string
required

System prompt for the agent.

builtInIntegrations
object[]

Built-in integrations this agent may use, each naming an active organization connection an admin added on the Integrations page. A non-empty tools list narrows this agent below the connection's organization allow-list; omission inherits it. Sessions receive short-lived access restricted to the effective tools; nothing is granted through a vault. Omit or send [] for no connections. Carried in full on every version write.

Maximum array length: 25
defaultCredentialRefs
object[]

Individual default items within defaultVaultIds. The list is a whitelist across every default vault, not a filter within one, so it must name every item the agent should receive. Omit to select every item the default vaults hold when the agent is saved. The selection is stored with the agent version, so a credential added to one of those vaults later is not included until the agent is saved again with it selected. [] alongside a non-empty defaultVaultIds is rejected because it would select none.

defaultProjectId
null | string

Billing project copied into sessions started from this agent when their create request omits project_id. A non-empty session project_id overrides it. Accepted only on a model that GET /managed-agents/v1/models marks requiresProject; refused with 400 for an organization whose model list has no such model.

defaultRubric
null | string

Markdown rubric; each list item is one criterion. When set, every session of this agent that starts with a message is graded against it by default, with that message as the objective. Must contain at least one gradeable markdown list item. An explicit session outcome overrides the default.

defaultVaultIds
string[]

Vaults granted by default when a session create request omits vault_ids. defaultCredentialRefs may narrow their items.

description
string

Optional free-text note about what the agent is for. Not sent to the model.

disabledIntegrationMcpProviders
string[]

Native integration providers whose MCP tools sessions of this agent do not receive even though the grant is present; the agent's own mcpServers are never affected. github is accepted but ignored, because a GitHub grant always keeps its MCP tools alongside git and gh in the sandbox. Omitting the field means none, on managedAgentsCreateAgent as on managedAgentsCreateAgentVersion.

fileHistoryEnabled
null | boolean

Whether sessions started from this agent may search and read the session outputs its earlier sessions saved, with search_agent_files and read_agent_file. Omit or send null to leave it off. Checked again on every search and read, so turning it off takes effect at once.

maxConcurrentSessions
null | integer

Maximum number of this agent's ordinary root sessions that may run or wait on compute at once. Omit for unlimited. Sessions beyond the cap are accepted with execution_state=queued and wait until a slot frees; child/subagent sessions and outcome evaluation passes do not take a slot. Carried in full on every version write: omitting it publishes a version with no cap.

Required range: 1 <= x <= 10000
mcpServers
object[]

Remote MCP servers whose tools are added to the agent's tool surface. Each entry is an object with name and url, e.g. {"name": "docs", "url": "https://example.com/mcp"}. Credentials come from the vaults granted to the session, and the discovered tool list is snapshotted at session start, so a later edit here does not change a running session.

metadata
object

Free-form caller-owned JSON stored with the agent and returned on reads. Not interpreted by the service and never sent to the model.

modelConfig
object

Default inference config applied to sessions started from this agent. Omit modelConfig or send {} to use provider defaults; null is invalid. reasoning_effort is normalized and validated for direct providers, and must exactly match the selected catalog model's supportedReasoningEfforts. An unsupported reasoning_effort, including any value for a catalog model that lists no exact options, returns 400. Authored provider_params.thinking objects are validated. When prompt caching is enabled, invalid provider_params.promptCacheTTL or provider_params.promptCacheSharedTTL values, incompatible models, and shared retention shorter than promptCacheTTL return 400. These checks run on agent and version writes and again at session start; a model catalog that cannot be read to verify settings returns 503.

multiagent
object

Multiagent roster: the delegation targets this agent may hand work to, an optional advisor entry, and the interventionist posture. Snapshotted at session start; a child roster may tighten the recursion depth ceiling, never widen it.

nativeIntegrations
object[]

Native connections this agent may use, with provider-enforced permission and resource restrictions. Omit or send [] for none. Stored in full on each agent version; secrets remain on the connection.

Maximum array length: 25
skills
object[]

Skill declarations made available to the agent, passed through as given and snapshotted into the session at start. Capped at the 100 skills a session can carry.

Maximum array length: 100
template
object

Reviewed template id and revision used to prefill this definition.

webSearchEnabled
boolean
default:true

Whether sessions started from this agent may use the native web_search tool. Omit to enable it. The setting is snapshotted when a session starts.

Response

A configured standalone Managed Agent: its versioned execution definition plus current mutable classification tags. Publishing the execution definition mints a new immutable version; applying tags does not.

A configured standalone Managed Agent: its versioned execution definition plus current mutable classification tags. Publishing the execution definition mints a new immutable version; applying tags does not.

agentId
string
required
read-only

Server-assigned id of the agent, used in the agent, agent-version, and session routes.

createdAt
string<date-time>
required
read-only

Server-assigned RFC 3339 timestamp of when the agent was created.

defaultCredentialRefs
object[]
required

Narrows the default vaults to individual credentials. Every credential is selected when a vault is first added, and may then be unchecked.

defaultVaultIds
string[]
required

Vaults whose credentials are copied into a new session when its create request omits vault_ids. Sending an explicit empty list on the session still overrides these.

disabledIntegrationMcpProviders
string[]
required

Native integration providers whose MCP tools new sessions of this agent do not receive, even though the grant is present. Suppresses integration-derived servers only, never the agent's own mcpServers. github is ignored, because a GitHub grant always keeps its MCP tools alongside git and gh in the sandbox.

mcpServers
object[]
required

Remote MCP servers to attach. Each entry is an object with name (the label the server's tools are grouped under) and url (its http/https endpoint); any further keys are passed to the runtime unchanged. Credentials come from the vaults granted to the session, not from this entry. Tools are discovered and snapshotted at session start.

model
string
required

Public model id from GET /managed-agents/v1/models, for example anthropic/claude-sonnet-5-5. Agent reads return the same public id. An id the catalog does not list is rejected here, before the session starts.

modelConfig
object
required

Default inference settings applied to every turn unless a session overrides them.

name
string
required

Human-readable label shown wherever agents are listed. Not required to be unique.

organizationId
string
required
read-only

Organization that owns the agent. Server-assigned from the authenticated principal; never accepted from the caller.

skills
object[]
required

Skill packages loaded into the agent's runtime, each an entry with the skill reference and its metadata.

system
string
required

System prompt prepended to every conversation this agent runs.

tags
object[]
required
read-only

Current organization-scoped classification tags applied to this agent. Always an array. Tags are mutable catalog metadata and are deliberately absent from AgentVersion and session runtime snapshots.

updatedAt
string<date-time>
required
read-only

Server-assigned RFC 3339 timestamp of the most recent update to the agent.

builtInIntegrations
object[]

Built-in integrations this agent may use, each naming an active organization connection an admin added on the Integrations page. A non-empty tools list narrows this agent below the connection's organization allow-list; omission inherits it. Sessions receive short-lived access restricted to the effective tools. Not a vault grant: nothing about these appears under credential access. A version write carries the list in full: omitting it publishes a version with none.

defaultProjectId
string

Billing project copied into new sessions when their create request omits project_id. A non-empty session project_id overrides it. Carried in full on every version write: omitting it publishes a version with no default.

defaultRubric
string

Markdown rubric that sessions of this agent are graded against by default when they start with a message. A session that supplies its own outcome ignores this entirely. Carried in full on every version write: omitting it publishes a version with no rubric.

description
string

Free-text note about what this agent is for.

executionCompatibility
enum<string>
read-only

Whether this exact agent definition is compatible with the standalone execution context. Omitted by deployments that do not compute it; a client must treat any present value other than compatible as incompatible.

Available options:
compatible,
incompatible
fileHistoryEnabled
boolean

Whether new sessions may search and read the session outputs this agent's earlier sessions saved. Omitted means off.

latestAgentVersionId
string
read-only

Server-maintained id of the newest version of this agent; sessions started without an explicit version use it.

maxConcurrentSessions
integer

Maximum number of this agent's ordinary root sessions that may run or wait on compute at once. Omit for unlimited. Sessions beyond the cap are accepted with execution_state=queued and wait until a slot frees; child/subagent sessions and outcome evaluation passes do not take a slot. Carried in full on every version write: omitting it publishes a version with no cap.

Required range: 1 <= x <= 10000
metadata
object

Caller-owned key/value data stored with the agent and returned unchanged.

multiagent
object

Multi-agent orchestration settings, such as subagent definitions and delegation limits.

nativeIntegrations
object[]

Native connections this agent may use, with provider-enforced permission and resource restrictions. Omit or send [] for none. Stored in full on each agent version; secrets remain on the connection.

Maximum array length: 25
supportsNewSessions
boolean
read-only

Whether this agent type supports new sessions here. Other start requirements still apply. Existing sessions and agent editing remain available when false.

template
object

Reviewed template revision this agent's current version started from.

webSearchEnabled
boolean
default:true

Whether new sessions may use the native web_search tool. Omitted on legacy agents and interpreted as enabled.