GuideOpen

Claude Managed Agents API endpoint reference

The Managed Agents Endpoint Reference is a shared file in Anthropic's claude-api skill listing the raw API behind Claude Managed Agents. It is for developers who need exact endpoints, headers and SDK method names for agents, versions, environments, sessions, vaults and deployments in Python, TypeScript and Go.

What it does

Every call needs x-api-key and anthropic-version, and Managed Agents calls add the managed-agents-2026-04-01 beta header, which the SDK sets for you. Memory store calls use the agent-memory-2026-07-22 header instead, and sending both returns a 400.

How to use it

Most users should keep agents and environments as files synced with ant apply; use this table when you code against the API directly.

Requirements and limits

The Files and Skills APIs are out of beta and need no beta header.

More in Guides and the Claude Code library.

Full text

Managed Agents - Endpoint Reference

All endpoints require x-api-key and anthropic-version: 2023-06-01 headers. Managed Agents endpoints additionally require the anthropic-beta header.

Most users should define agents and environments as version-controlled files synced with ant apply - see shared/anthropic-cli.md. The endpoints below are the underlying API that the CLI and SDKs drive.

Beta Headers

anthropic-beta: managed-agents-2026-04-01

The SDK adds this header automatically for all client.beta.{agents,environments,sessions,vaults,deployments,deployment_runs}. calls. Memory store endpoints (client.beta.memory_stores.) use agent-memory-2026-07-22 instead, which the SDK also sets; sending both headers on a memory store request returns a 400. The Files and Skills APIs are out of beta and need no beta header.


SDK Method Reference

All resources are under the beta namespace. Python and TypeScript share identical method names.

ResourcePython / TypeScript (client.beta.*)Go (client.Beta.*)
Agentsagents.create / retrieve / update / list / archiveAgents.New / Get / Update / List / Archive
Agent Versionsagents.versions.listAgents.Versions.List
Environmentsenvironments.create / retrieve / update / list / delete / archiveEnvironments.New / Get / Update / List / Delete / Archive
Environment Work (self-hosted)environments.work.poller / stats / stopSee shared/managed-agents-self-hosted-sandboxes.md
Sessionssessions.create / retrieve / update / list / delete / archiveSessions.New / Get / Update / List / Delete / Archive
Session Eventssessions.events.list / send / streamSessions.Events.List / Send / StreamEvents
Session Threadssessions.threads.list / retrieve / archive; sessions.threads.events.list / streamSessions.Threads.List / Get / Archive; Sessions.Threads.Events.List / StreamEvents
Session Resourcessessions.resources.add / retrieve / update / list / deleteSessions.Resources.Add / Get / Update / List / Delete
Deploymentsdeployments.create / update / pause / unpause / archive / runNot yet documented - WebFetch the SDK repo (shared/live-sources.md)
Deployment Runsdeployment_runs.list / retrieve (TS: deploymentRuns.*)Not yet documented - WebFetch the SDK repo (shared/live-sources.md)
Vaultsvaults.create / retrieve / update / list / delete / archiveVaults.New / Get / Update / List / Delete / Archive
Credentialsvaults.credentials.create / retrieve / update / list / delete / archive / mcp_oauth_validateVaults.Credentials.New / Get / Update / List / Delete / Archive / McpOauthValidate
Memory Storesmemory_stores.create / retrieve / update / list / delete / archiveMemoryStores.New / Get / Update / List / Delete / Archive
Memoriesmemory_stores.memories.create / retrieve / update / list / deleteMemoryStores.Memories.New / Get / Update / List / Delete
Memory Versionsmemory_stores.memory_versions.list / retrieve / redactMemoryStores.MemoryVersions.List / Get / Redact

Naming quirks to watch for:

  • Agents and Session Threads have no delete - only archive. Archive is permanent: the agent becomes read-only, new sessions cannot reference it, and there is no unarchive. Confirm with the user before archiving a production agent. Environments, Sessions, Vaults, Credentials, and Memory Stores have both delete and archive; Session Resources, Files, Skills, and Memories are delete-only; Memory Versions have neither - only redact.
  • Session resources use add (not create).
  • Go's event stream is StreamEvents (not Stream).
  • The self-hosted worker class is EnvironmentWorker from anthropic.lib.environments / @anthropic-ai/sdk/helpers/beta/environments / anthropic-sdk-go/lib/environments; client.beta.environments.work.worker(...) is a factory that returns the same class, alongside the environments.work.poller/stats/stop client methods.

Agent shorthand: agent on session create accepts three forms - a bare string (agent="agent_abc123", latest version), a pinned reference {type: "agent", id, version}, or {type: "agent_with_overrides", id, version?, model?, system?, tools?, mcp_servers?, skills?} to override those fields for this session only (see shared/managed-agents-core.md -> Override agent configuration for a session).

Model shorthand: model on agent create accepts either a bare string (model="claude-opus-5-5" - uses standard speed) or the full config object, which takes speed, effort, and inference_geo alongside id: {id: "claude-opus-5-5", speed: "fast"}, {id: "claude-opus-5-5", effort: "high"}, {id: "claude-opus-5-5", inference_geo: "us"}. effort accepts a level string (low/medium/high/xhigh/max) or {type: "<level>"}, and in a per-session model override it sets the session's effort level (the agent's own effort isn't carried over, and a model override without effort runs at that model's default effort level). inference_geo ("us" | "global") pins the geography serving the agent's model requests, and is also applied in a per-session model override. See shared/managed-agents-core.md -> Effort on the agent model / Pinning inference geography. Note: speed: "fast" is supported on Claude Opus 5.5, Claude Opus 5, and Opus 4.8 - on the Claude API only, which includes Managed Agents but not Amazon Bedrock, Google Cloud, or Microsoft Foundry. Opus 4.7 fast mode has been removed; speed: "fast" on Opus 4.7 returns an error.


Agents

Step one of every flow. Sessions require a pre-created agent - there is no inline agent config under managed-agents-2026-04-01.

MethodPathOperationDescription
GET/v1/agentsListAgentsList agents
POST/v1/agentsCreateAgentCreate a saved agent configuration
GET/v1/agents/{agent_id}GetAgentGet agent details
POST/v1/agents/{agent_id}UpdateAgentUpdate agent configuration. version is optional: supply it (>= 1) for optimistic concurrency - a mismatch returns 409 - or omit it for an unconditional last-write-wins update.
POST/v1/agents/{agent_id}/archiveArchiveAgentArchive an agent. Makes it read-only; existing sessions continue, new sessions cannot reference it. No unarchive - this is the terminal state.
GET/v1/agents/{agent_id}/versionsListAgentVersionsList agent versions

Sessions

MethodPathOperationDescription
GET/v1/sessionsListSessionsList sessions (paginated)
POST/v1/sessionsCreateSessionCreate a new session
GET/v1/sessions/{session_id}GetSessionGet session details
POST/v1/sessions/{session_id}UpdateSessionUpdate session metadata/title, agent.tools/agent.mcp_servers (session-local override; session must be idle), or budget - change the cap (higher or lower; the new value must exceed the consumed list cost) or remove it with null; removal is one-way, and a budget can never be added post-create. vault_ids is create-only (rejected on update). See shared/managed-agents-core.md -> Updating the agent configuration mid-session / Session budgets.
DELETE/v1/sessions/{session_id}DeleteSessionDelete a session
POST/v1/sessions/{session_id}/archiveArchiveSessionArchive a session

Events

MethodPathOperationDescription
GET/v1/sessions/{session_id}/eventsListEventsList events (polling, paginated)
POST/v1/sessions/{session_id}/eventsSendEventsSend events (user message, tool result)
GET/v1/sessions/{session_id}/events/streamStreamEventsStream events via SSE. Optional event_deltas[]=agent.message / agent.thinking opts in to live-preview event_start/event_delta events - see shared/managed-agents-events.md § Live previews.

Session Threads

Per-subagent event streams in multiagent sessions. See shared/managed-agents-multiagent.md.

MethodPathOperationDescription
GET/v1/sessions/{session_id}/threadsListThreadsList threads (paginated)
GET/v1/sessions/{session_id}/threads/{thread_id}GetThreadRetrieve one thread (carries agent snapshot, status, parent_thread_id, stats, usage)
POST/v1/sessions/{session_id}/threads/{thread_id}/archiveArchiveThreadArchive a thread
GET/v1/sessions/{session_id}/threads/{thread_id}/eventsListThreadEventsList past events for one thread (paginated)
GET/v1/sessions/{session_id}/threads/{thread_id}/streamStreamThreadEventsStream one thread via SSE (SDK: threads.events.stream)

Session Resources

MethodPathOperationDescription
GET/v1/sessions/{session_id}/resourcesListResourcesList resources attached to session
POST/v1/sessions/{session_id}/resourcesAddResourceAttach file or github_repository resource (SDK method: add, not create). memory_store resources attach at session-create time only. Self-hosted environments accept only memory_store (at create); file / github_repository are rejected there.
GET/v1/sessions/{session_id}/resources/{resource_id}GetResourceGet a single resource
POST/v1/sessions/{session_id}/resources/{resource_id}UpdateResourceUpdate resource
DELETE/v1/sessions/{session_id}/resources/{resource_id}DeleteResourceRemove resource from session

Environments

MethodPathOperationDescription
POST/v1/environmentsCreateEnvironmentCreate environment
GET/v1/environmentsListEnvironmentsList environments
GET/v1/environments/{environment_id}GetEnvironmentGet environment details
POST/v1/environments/{environment_id}UpdateEnvironmentUpdate environment
DELETE/v1/environments/{environment_id}DeleteEnvironmentDelete environment. Returns 204.
POST/v1/environments/{environment_id}/archiveArchiveEnvironmentArchive environment. Makes it read-only; existing sessions continue, new sessions cannot reference it. No unarchive - this is the terminal state.
GET/v1/environments/{environment_id}/work/statsWorkQueueStatsSelf-hosted work-queue depth/pending/workers. x-api-key auth. See shared/managed-agents-self-hosted-sandboxes.md.
POST/v1/environments/{environment_id}/work/{work_id}/stopStopWorkSelf-hosted: stop a claimed work item. x-api-key auth.

For type: "self_hosted", config is the bare {"type": "self_hosted"} - networking and packages do not apply. (With limited networking, allowed_hosts also applies to web_search / web_fetch; unrestricted networking and self-hosted environments do not limit them. In both environment types they can be turned off (enabled: false) or restricted per-tool with allowed_domains / blocked_domains in the agent toolset; see shared/managed-agents-tools.md.)

Deployments

Scheduled deployments (depl_ IDs) run an agent on a recurring cron schedule - each firing creates a session. See shared/managed-agents-scheduled-deployments.md for the conceptual guide (cron/DST semantics, failure behavior, lifecycle).

MethodPathOperationDescription
POST/v1/deploymentsCreateDeploymentCreate a scheduled deployment
POST/v1/deployments/{deployment_id}UpdateDeploymentUpdate deployment configuration (see shared/managed-agents-scheduled-deployments.md)
POST/v1/deployments/{deployment_id}/pausePauseDeploymentSuppress scheduled triggers (reversible; manual runs still allowed)
POST/v1/deployments/{deployment_id}/unpauseUnpauseDeploymentResume from the next occurrence (no backfill)
POST/v1/deployments/{deployment_id}/archiveArchiveDeploymentTerminal - schedule stops, deployment becomes immutable
POST/v1/deployments/{deployment_id}/runRunDeploymentTrigger a manual run immediately (trigger_context.type: "manual"); works while paused

Deployment Runs

Each trigger attempt (scheduled or manual) writes a deployment_run record (drun_ IDs) carrying either the created session_id or an error.type (environment_archived, agent_archived, vault_not_found, session_rate_limited, service_unavailable).

MethodPathOperationDescription
GET/v1/deployment_runs?deployment_id=...ListDeploymentRunsList runs for a deployment (paginated; filter failures with has_error=true)
GET/v1/deployment_runs/{deployment_run_id}GetDeploymentRunRetrieve a single run by ID (a deployment_run.* webhook event carries this as data.id)

Vaults

Vaults store credentials that Anthropic manages on your behalf - MCP credentials (OAuth with auto-refresh, or static bearer tokens) and environment_variable credentials substituted into outbound requests at egress. Attach to sessions via vault_ids. See managed-agents-tools.md §Vaults for the conceptual guide and credential shapes.

MethodPathOperationDescription
POST/v1/vaultsCreateVaultCreate a vault
GET/v1/vaultsListVaultsList vaults
GET/v1/vaults/{vault_id}GetVaultGet vault details
POST/v1/vaults/{vault_id}UpdateVaultUpdate vault
DELETE/v1/vaults/{vault_id}DeleteVaultDelete vault
POST/v1/vaults/{vault_id}/archiveArchiveVaultArchive vault

Credentials

Credentials are individual secrets stored inside a vault.

MethodPathOperationDescription
POST/v1/vaults/{vault_id}/credentialsCreateCredentialCreate a credential
GET/v1/vaults/{vault_id}/credentialsListCredentialsList credentials in vault
GET/v1/vaults/{vault_id}/credentials/{credential_id}GetCredentialGet credential metadata
POST/v1/vaults/{vault_id}/credentials/{credential_id}UpdateCredentialUpdate credential
DELETE/v1/vaults/{vault_id}/credentials/{credential_id}DeleteCredentialDelete credential
POST/v1/vaults/{vault_id}/credentials/{credential_id}/archiveArchiveCredentialArchive credential
POST/v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validateMcpOauthValidateValidate an MCP OAuth credential

Memory Stores

Workspace-scoped persistent memory that survives across sessions. Attach to a session via a {"type": "memory_store", "memory_store_id": ...} entry in resources[] (session-create time only). See shared/managed-agents-memory.md for the conceptual guide, the FUSE-mount agent interface, preconditions, and versioning.

MethodPathOperationDescription
POST/v1/memory_storesCreateMemoryStoreCreate a store (name, description, metadata)
GET/v1/memory_storesListMemoryStoresList stores (include_archived, created_at_{gte,lte})
GET/v1/memory_stores/{memory_store_id}GetMemoryStoreGet store details
POST/v1/memory_stores/{memory_store_id}UpdateMemoryStoreUpdate store
DELETE/v1/memory_stores/{memory_store_id}DeleteMemoryStoreDelete store
POST/v1/memory_stores/{memory_store_id}/archiveArchiveMemoryStoreArchive store. Makes it read-only; existing sessions continue, new sessions cannot reference it. No unarchive.

Memories

Individual text documents inside a store (<= 100KB each). create creates at a path and returns 409 (memory_path_conflict_error, with conflicting_memory_id) if the path is occupied; update mutates by mem_... ID (rename and/or content). Only update accepts a precondition ({"type": "content_sha256", "content_sha256": ...}) - on mismatch returns 409 (memory_precondition_failed_error). List endpoints accept view: "basic"|"full" (controls whether content is populated; retrieve defaults to full).

MethodPathOperationDescription
GET/v1/memory_stores/{memory_store_id}/memoriesListMemoriesReturns `Memory \MemoryPrefix; filter by path_prefix, depth`
POST/v1/memory_stores/{memory_store_id}/memoriesCreateMemoryCreate at path (SDK: memories.create); 409 memory_path_conflict_error if occupied
GET/v1/memory_stores/{memory_store_id}/memories/{memory_id}GetMemoryRead one memory (defaults to view="full")
PATCH/v1/memory_stores/{memory_store_id}/memories/{memory_id}UpdateMemoryChange content, path, or both by ID; optional precondition
DELETE/v1/memory_stores/{memory_store_id}/memories/{memory_id}DeleteMemoryDelete (optional expected_content_sha256)

Memory Versions

Immutable per-mutation snapshots (memver_...) - the audit and rollback surface. operation in created / modified / deleted.

MethodPathOperationDescription
GET/v1/memory_stores/{memory_store_id}/memory_versionsListMemoryVersionsNewest-first; filter by memory_id, operation, session_id, api_key_id, created_at_{gte,lte}
GET/v1/memory_stores/{memory_store_id}/memory_versions/{version_id}GetMemoryVersionList fields + full content
POST/v1/memory_stores/{memory_store_id}/memory_versions/{version_id}/redactRedactMemoryVersionClear content/content_sha256/content_size_bytes/path; preserve actor + timestamps

Files

MethodPathOperationDescription
POST/v1/filesUploadFileUpload a file
GET/v1/filesListFilesList files
GET/v1/files/{file_id}GetFileGet file metadata (SDK method: retrieve_metadata)
GET/v1/files/{file_id}/contentDownloadFileDownload file content
DELETE/v1/files/{file_id}DeleteFileDelete a file

Skills

MethodPathOperationDescription
POST/v1/skillsCreateSkillCreate a skill
GET/v1/skillsListSkillsList skills
GET/v1/skills/{skill_id}GetSkillGet skill details
DELETE/v1/skills/{skill_id}DeleteSkillDelete a skill
POST/v1/skills/{skill_id}/versionsCreateVersionCreate skill version
GET/v1/skills/{skill_id}/versionsListVersionsList skill versions
GET/v1/skills/{skill_id}/versions/{version}GetVersionGet skill version
DELETE/v1/skills/{skill_id}/versions/{version}DeleteVersionDelete skill version

Request/Response Schema Quick Reference

CreateAgent Request Body

Always start here. model, system, tools, mcp_servers, skills are top-level fields on this object - they do NOT go on the session.

{
  "name": "string (required, 1-256 chars)",
  "model": "claude-opus-5-5 (required - bare string, or {id, speed?, effort?, inference_geo?} object)",
  "description": "string (optional, up to 2048 chars)",
  "system": "string (optional, up to 100,000 chars)",
  "tools": [
    {
      "type": "agent_toolset_20260401",
      "default_config": { "permission_policy": { "type": "auto" } },
      "configs": [
        { "name": "web_fetch", "enabled": false },
        { "name": "web_search", "enabled": false }
      ]
    }
  ],
  "skills": [
    { "type": "anthropic", "skill_id": "xlsx" },
    { "type": "custom", "skill_id": "skill_abc123", "version": "1" }
  ],
  "mcp_servers": [
    {
      "type": "url",
      "name": "github",
      "url": "https://api.githubcopilot.com/mcp/"
    }
  ],
  "multiagent": {
    "type": "coordinator",
    "agents": [
      "agent_abc123",
      { "type": "agent", "id": "agent_def456", "version": 4 },
      { "type": "self" }
    ]
  },
  "metadata": {
    "key": "value (max 16 pairs, keys <=64 chars, values <=512 chars)"
  }
}
Limits: tools max 128, skills max 20, mcp_servers max 20 (unique names). multiagent.agents 1-20 entries (string ID | {type:"agent",id,version?} | {type:"self"} | {type:"advisor",model}, at most one advisor) - see shared/managed-agents-multiagent.md. multiagent can instead be {type:"multiagent_20261001", workflows?, subagents?, advisor?}, each member {type:"enabled"} or {type:"disabled"}; enabled workflows and subagents each take optional predefined_agents (up to 20, same entry forms minus advisor) and inline_agents ({type:"enabled"} or {type:"disabled"}, default enabled; disabled with an empty list is a 400), enabled advisor requires model; workflows and subagents default to enabled, advisor to disabled (§ Dynamic workflows).

CreateSession Request Body

{
  "agent": "agent_abc123 (required - string shorthand for latest version, or {type: \"agent\", id, version} object)",
  "environment_id": "env_abc123 (required)",
  "title": "string (optional)",
  "resources": [
    {
      "type": "github_repository",
      "url": "https://github.com/owner/repo (required)",
      "authorization_token": "ghp_... (required)",
      "mount_path": "/workspace/repo (optional - defaults to /workspace/<repo-name>)",
      "checkout": { "type": "branch", "name": "main" }
    }
  ],
  "initial_events": [
    { "type": "user.message", "content": [{ "type": "text", "text": "Review the auth module." }] }
  ],
  "vault_ids": ["vlt_abc123 (optional - vault credentials: MCP auth + environment variables)"],
  "budget": {
    "type": "limit",
    "max_list_cost": { "amount": "2500", "currency": "USD" }
  },
  "metadata": {
    "key": "value"
  }
}
The agent field accepts a string ID, {type: "agent", id, version}, or {type: "agent_with_overrides", id, version?, ...} for session-local overrides of model/system/tools/mcp_servers/skills. Outside the overrides form, those fields live on the agent, not here. An effort inside a model override is applied (the agent's own effort isn't carried over, and a model override without effort runs at that model's default effort level). An inference_geo inside a model override is applied (omitting it clears the agent's pin for this session). budget (optional, create-only) is a hard dollar cap on the session's list-priced spend; amount is an integer string in minor units (cents - "2500" = $25.00), USD only. It can be changed or removed later via session update, never added. See shared/managed-agents-core.md -> Session budgets. initial_events (optional, max 50) sends events at creation and starts the agent loop in the same call. Only user.message and user.define_outcome are accepted - no system.message, and none of the tool-result kinds. Validation is all-or-nothing. See shared/managed-agents-core.md -> Seeding a session with initial_events. checkout accepts {type: "branch", name: "..."} or {type: "commit", sha: "..."}. Omit for the repo's default branch.

CreateEnvironment Request Body

{
  "name": "string (required)",
  "description": "string (optional)",
  "config": {
    "type": "cloud | self_hosted",
    "networking": {
      "type": "unrestricted | limited (union - see SDK types)"
    },
    "packages": { }
  },
  "metadata": { "key": "value" }
}

CreateDeployment Request Body

{
  "name": "Weekly compliance scan",
  "agent": "agent_abc123 (required - same shapes as CreateSession)",
  "environment_id": "env_abc123 (required)",
  "initial_events": [
    { "type": "user.message", "content": [{ "type": "text", "text": "Run the weekly compliance scan." }] }
  ],
  "schedule": {
    "type": "cron",
    "expression": "0 20 * * 5",
    "timezone": "America/New_York"
  }
}
Optional session config (resources, vault_ids, etc.) is supported the same way as on CreateSession, including budget - copied onto each fired session; unlike a session's, it can be added where none exists and re-added after clearing (see shared/managed-agents-scheduled-deployments.md § Deployment budgets). Response includes status, paused_reason, and schedule.upcoming_runs_at (next fire times). See shared/managed-agents-scheduled-deployments.md.

SendEvents Request Body

{
  "events": [
    {
      "type": "user.message",
      "content": [
        {
          "type": "text",
          "text": "Hello"
        }
      ]
    }
  ]
}

The text continues at the source. Read the rest.

Source and license

Source: https://github.com/anthropics/skills/blob/main/skills/claude-api/shared/managed-agents-api-reference.md

Author: anthropics, Anthropic skills. License: Apache-2.0.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The Claude Code library holds 13,843 entries. Members can search all of them by meaning and read every one in full.