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.

Path Parameters

agent_id
string<uuid>
required

Agent id (UUID) as returned by createAgent or listAgents.

Body

application/json

Request body for creating a new immutable agent version. Every field means what it means on createAgent -- full content is always required, there is no partial update -- except disabled_integration_mcp_providers, whose omission means none here rather than the new-agent default. base_agent_version_id must be the agent's current version or the request is rejected with revision_conflict so the caller can re-read and retry.

base_agent_version_id
string<uuid>
required

The agent's current latest_agent_version_id, as returned by getAgent. Rejected with 409 revision_conflict if the agent has moved past this version.

model
string
required

Model id, copied verbatim from the models catalog, GET /v1/models (e.g. anthropic/claude-sonnet-4-5). Reads return the stored form, which adds a provider prefix before that id. An id the catalog does not list is rejected with the list of ids that it does.

name
string
required

Human-readable label for the agent. Required.

system
string
required

System prompt for the agent.

built_in_integrations
object[]

Built-in integrations this agent may use, each naming an active organization connection an admin added on the Integrations page. Sessions receive short-lived access restricted to exactly those apps and each connection's tool allow-list; nothing is granted through a vault. Omit or send [] for none. Carried in full on every version write.

Maximum array length: 25
default_credential_refs
object[]

Individual default items within default_vault_ids. 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 current item; [] alongside a non-empty default_vault_ids is rejected because it would select none.

default_rubric
null | string

Markdown rubric that sessions started from this agent are graded against when their create request omits an outcome. Must contain at least one gradeable criterion, written as markdown list items. A session that supplies its own outcome ignores this entirely.

default_vault_ids
string[]

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

description
string

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

disabled_integration_mcp_providers
string[]

Native integration providers whose MCP tools sessions of this agent do not receive even though the grant is present. The grant still authenticates the provider's sandbox tools where it has any (git and gh for GitHub); the agent's own mcp_servers are never affected. Omission differs by operation: on createAgent it defaults to ["github"] (new agents use gh and git in the sandbox); on createAgentVersion it means none, as for every other field there; send [] to receive every provider's MCP tools.

max_concurrent_sessions
null | integer

Maximum number of this agent's 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.

Required range: 1 <= x <= 10000
mcp_servers
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.

model_config
object

Default inference config applied to sessions started from this agent. Omit model_config 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 value, including any value for a catalog model that lists no exact options, returns 400; a model catalog that cannot be read to verify it returns 503.

Example:
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
tools
object[]
deprecated

Deprecated alias for toolsets; accepts only the bare evaluation marker.

Maximum array length: 1
toolsets
object[]

Only the bare {type: evaluation} marker is supported, for evaluator agents. Omit or send [] for ordinary agents; built-in sandbox tools, MCP servers, and skills do not require a toolset. The tools field is a deprecated alias.

Maximum array length: 1
web_search_enabled
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 agent: its versioned execution definition plus current mutable classification tags. Publishing the execution definition mints a new immutable AgentVersion; applying tags does not. A session records the version it ran and never snapshots tags.

A configured agent: its versioned execution definition plus current mutable classification tags. Publishing the execution definition mints a new immutable AgentVersion; applying tags does not. A session records the version it ran and never snapshots tags.

agent_id
string
required

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

created_at
string<date-time>
required

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

default_credential_refs
object[] | null
required

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

default_vault_ids
string[] | null
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.

disabled_integration_mcp_providers
string[] | null
required

Native integration providers whose MCP tools new sessions of this agent do not receive, even though the grant is present. The grant still authenticates the provider's sandbox tools where it has any (git and gh for GitHub). Suppresses integration-derived servers only, never the agent's own mcp_servers. New agents decline github by default when the field is omitted on create (JSON null counts as omitted); send an explicit [] on create to receive every provider's MCP tools. A version write carries the list in full: omitting it publishes a version with none.

mcp_servers
object[] | null
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

Model the agent runs on. Pass a model id exactly as the models catalog (GET /v1/models) lists it, e.g. anthropic/claude-sonnet-4-5; reads return the stored form, which adds a provider prefix before that id. An explicitly provider-qualified string such as anthropic:claude-sonnet-4-5 selects that provider directly and is left as written. An id the catalog does not list is rejected here, not at the session's first turn.

model_config
object
required

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

Example:
name
string
required

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

organization_id
string
required

Organization that owns the agent. Server-assigned from the caller's credentials; a value sent in a request body is ignored.

skills
object[] | null
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

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.

toolsets
object[] | null
required

The bare evaluation marker, when this is an evaluator agent. Historical stored agents may contain ignored declarations, omitted from current API responses. Built-in sandbox tools need no marker.

Maximum array length: 1
updated_at
string<date-time>
required

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

built_in_integrations
object[]

Built-in integrations this agent may use, each naming an active organization connection an admin added on the Integrations page. Sessions receive short-lived access restricted to exactly those apps and each connection's tool allow-list. 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.

default_rubric
string

Markdown rubric that sessions started from this agent are graded against when their create request omits an outcome. 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.

latest_agent_version_id
string

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

max_concurrent_sessions
integer

Maximum number of this agent's 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 do not count. 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
web_search_enabled
boolean
default:true

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