SPB Git

Repository Public

archive.md 34.8 KB 1,207 lines markdown

1---2title: Archive Session3url: https://platform.claude.com/docs/en/api/beta/sessions/archive4---56# Archive Session78**POST** `/v1/sessions/{session_id}/archive`910Archive Session1112## Path parameters1314- `session_id: string`1516## Headers1718- `"anthropic-beta": optional array of AnthropicBeta`1920  Optional header to specify the beta version(s) you want to use.2122  - `string`2324  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`2526    - `"message-batches-2024-09-24"`2728    - `"prompt-caching-2024-07-31"`2930    - `"computer-use-2024-10-22"`3132    - `"computer-use-2025-01-24"`3334    - `"pdfs-2024-09-25"`3536    - `"token-counting-2024-11-01"`3738    - `"token-efficient-tools-2025-02-19"`3940    - `"output-128k-2025-02-19"`4142    - `"files-api-2025-04-14"`4344    - `"mcp-client-2025-04-04"`4546    - `"mcp-client-2025-11-20"`4748    - `"dev-full-thinking-2025-05-14"`4950    - `"interleaved-thinking-2025-05-14"`5152    - `"code-execution-2025-05-22"`5354    - `"extended-cache-ttl-2025-04-11"`5556    - `"context-1m-2025-08-07"`5758    - `"context-management-2025-06-27"`5960    - `"model-context-window-exceeded-2025-08-26"`6162    - `"skills-2025-10-02"`6364    - `"fast-mode-2026-02-01"`6566    - `"output-300k-2026-03-24"`6768    - `"user-profiles-2026-03-24"`6970    - `"user-profiles-2026-08-18"`7172    - `"user-profiles-2026-09-04"`7374    - `"advisor-tool-2026-03-01"`7576    - `"managed-agents-2026-04-01"`7778    - `"cache-diagnosis-2026-04-07"`7980    - `"dreaming-2026-04-21"`8182    - `"thinking-token-count-2026-05-13"`8384    - `"server-side-fallback-2026-06-01"`8586    - `"server-side-fallback-2026-07-01"`8788    - `"fallback-credit-2026-06-01"`8990    - `"fallback-credit-2026-07-01"`9192    - `"agent-memory-2026-07-22"`9394    - `"mid-conversation-tool-changes-2026-07-01"`9596    - `"compact-2026-01-12"`9798    - `"computer-use-2025-11-24"`99100    - `"mcp-tunnels-2026-06-22"`101102    - `"structured-outputs-2025-11-13"`103104    - `"task-budgets-2026-03-13"`105106    - `"thinking-display-updates-2026-08-18"`107108    - `"ce-user-management-2026-07-13"`109110    - `"mid-conversation-output-config-2026-07-01"`111112    - `"thinking-binding-controls-2026-08-01"`113114    - `"mid-conversation-system-clear-at-2026-08-21"`115116    - `"compact-2026-09-04"`117118- `"anthropic-workspace-id": optional string`119120## Returns121122- `BetaManagedAgentsSession object`123124  A Managed Agents `session`.125126  - `type: "session"`127128  - `id: string`129130  - `agent: BetaManagedAgentsSessionAgent`131132    Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.133134    - `type: "agent"`135136    - `id: string`137138    - `description: string or null`139140    - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`141142      - `type: "url"`143144      - `name: string`145146      - `url: string`147148    - `model: BetaManagedAgentsModelConfig`149150      Model identifier and configuration.151152      - `id: BetaManagedAgentsModel`153154        The model that will power your agent.155156        See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.157158        - `"claude-fable-5-1" or "claude-sonnet-5" or "claude-fable-5" or 11 more`159160          The model that will power your agent.161162          See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.163164          - `"claude-fable-5-1"`165166            Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows167168          - `"claude-sonnet-5"`169170            High-performance model for coding and agents171172          - `"claude-fable-5"`173174            Next generation of intelligence for the hardest knowledge work and coding problems175176          - `"claude-opus-5"`177178            Powerful intelligence for long-running agents and coding179180          - `"claude-opus-4-8"`181182            Powerful intelligence for long-running agents and coding183184          - `"claude-opus-4-7"`185186            Powerful intelligence for long-running agents and coding187188          - `"claude-opus-4-6"`189190            Powerful intelligence for long-running agents and coding191192          - `"claude-sonnet-4-6"`193194            Best combination of speed and intelligence195196          - `"claude-haiku-4-5"`197198            Fastest model with near-frontier intelligence199200          - `"claude-haiku-4-5-20251001"`201202            Fastest model with near-frontier intelligence203204          - `"claude-opus-4-5"`205206            Powerful intelligence for long-running agents and coding207208          - `"claude-opus-4-5-20251101"`209210            Powerful intelligence for long-running agents and coding211212          - `"claude-sonnet-4-5"`213214            High-performance model for agents and coding215216          - `"claude-sonnet-4-5-20250929"`217218            High-performance model for agents and coding219220        - `string`221222      - `effort: optional BetaManagedAgentsEffortLow or BetaManagedAgentsEffortMedium or BetaManagedAgentsEffortHigh or 2 more`223224        How hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes.225226        - `BetaManagedAgentsEffortLow object`227228          Low effort. Favors latency over reasoning depth.229230          - `type: "low"`231232        - `BetaManagedAgentsEffortMedium object`233234          Medium effort. Balances latency and reasoning depth.235236          - `type: "medium"`237238        - `BetaManagedAgentsEffortHigh object`239240          High effort. Favors reasoning depth.241242          - `type: "high"`243244        - `BetaManagedAgentsEffortXhigh object`245246          Extra-high effort. Not all models accept this level.247248          - `type: "xhigh"`249250        - `BetaManagedAgentsEffortMax object`251252          Maximum effort. Favors reasoning depth over latency.253254          - `type: "max"`255256      - `inference_geo: optional string`257258        Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.259260      - `speed: optional "standard" or "fast"`261262        Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.263264        - `"standard"`265266        - `"fast"`267268    - `multiagent: BetaManagedAgentsSessionMultiagentCoordinator or null`269270      Resolved coordinator topology with full agent definitions for each roster member.271272      - `type: "coordinator"`273274      - `agents: array of BetaManagedAgentsSessionThreadAgent or BetaManagedAgentsAdvisor`275276        Full `agent` definitions the coordinator may spawn as session threads.277278        - `BetaManagedAgentsSessionThreadAgent object`279280          Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.281282          - `type: "agent"`283284          - `id: string`285286          - `description: string or null`287288          - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`289290            - `type: "url"`291292            - `name: string`293294            - `url: string`295296          - `model: BetaManagedAgentsModelConfig`297298            Model identifier and configuration.299300          - `name: string`301302          - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`303304            - `BetaManagedAgentsAnthropicSkill object`305306              A resolved Anthropic-managed skill.307308              - `type: "anthropic"`309310              - `skill_id: string`311312              - `version: string`313314            - `BetaManagedAgentsCustomSkill object`315316              A resolved user-created custom skill.317318              - `type: "custom"`319320              - `skill_id: string`321322              - `version: string`323324          - `system: string or null`325326          - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`327328            - `BetaManagedAgentsAgentToolset20260401 object`329330              - `type: "agent_toolset_20260401"`331332              - `configs: array of BetaManagedAgentsAgentToolConfig`333334                - `BetaManagedAgentsBashToolConfig object`335336                  Configuration for the bash tool.337338                  - `type: "bash"`339340                  - `enabled: boolean`341342                  - `name: "bash"`343344                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`345346                    Permission policy for tool execution.347348                    - `BetaManagedAgentsAlwaysAllowPolicy object`349350                      Tool calls are automatically approved without user confirmation.351352                      - `type: "always_allow"`353354                    - `BetaManagedAgentsAlwaysAskPolicy object`355356                      Tool calls require user confirmation before execution.357358                      - `type: "always_ask"`359360                    - `BetaManagedAgentsAutoPolicy object`361362                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.363364                      - `type: "auto"`365366                - `BetaManagedAgentsEditToolConfig object`367368                  Configuration for the edit tool.369370                  - `type: "edit"`371372                  - `enabled: boolean`373374                  - `name: "edit"`375376                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`377378                    Permission policy for tool execution.379380                    - `BetaManagedAgentsAlwaysAllowPolicy object`381382                      Tool calls are automatically approved without user confirmation.383384                    - `BetaManagedAgentsAlwaysAskPolicy object`385386                      Tool calls require user confirmation before execution.387388                    - `BetaManagedAgentsAutoPolicy object`389390                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.391392                - `BetaManagedAgentsReadToolConfig object`393394                  Configuration for the read tool.395396                  - `type: "read"`397398                  - `enabled: boolean`399400                  - `name: "read"`401402                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`403404                    Permission policy for tool execution.405406                    - `BetaManagedAgentsAlwaysAllowPolicy object`407408                      Tool calls are automatically approved without user confirmation.409410                    - `BetaManagedAgentsAlwaysAskPolicy object`411412                      Tool calls require user confirmation before execution.413414                    - `BetaManagedAgentsAutoPolicy object`415416                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.417418                - `BetaManagedAgentsWriteToolConfig object`419420                  Configuration for the write tool.421422                  - `type: "write"`423424                  - `enabled: boolean`425426                  - `name: "write"`427428                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`429430                    Permission policy for tool execution.431432                    - `BetaManagedAgentsAlwaysAllowPolicy object`433434                      Tool calls are automatically approved without user confirmation.435436                    - `BetaManagedAgentsAlwaysAskPolicy object`437438                      Tool calls require user confirmation before execution.439440                    - `BetaManagedAgentsAutoPolicy object`441442                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.443444                - `BetaManagedAgentsGlobToolConfig object`445446                  Configuration for the glob tool.447448                  - `type: "glob"`449450                  - `enabled: boolean`451452                  - `name: "glob"`453454                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`455456                    Permission policy for tool execution.457458                    - `BetaManagedAgentsAlwaysAllowPolicy object`459460                      Tool calls are automatically approved without user confirmation.461462                    - `BetaManagedAgentsAlwaysAskPolicy object`463464                      Tool calls require user confirmation before execution.465466                    - `BetaManagedAgentsAutoPolicy object`467468                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.469470                - `BetaManagedAgentsGrepToolConfig object`471472                  Configuration for the grep tool.473474                  - `type: "grep"`475476                  - `enabled: boolean`477478                  - `name: "grep"`479480                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`481482                    Permission policy for tool execution.483484                    - `BetaManagedAgentsAlwaysAllowPolicy object`485486                      Tool calls are automatically approved without user confirmation.487488                    - `BetaManagedAgentsAlwaysAskPolicy object`489490                      Tool calls require user confirmation before execution.491492                    - `BetaManagedAgentsAutoPolicy object`493494                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.495496                - `BetaManagedAgentsWebFetchToolConfig object`497498                  Configuration for the web_fetch tool.499500                  - `type: "web_fetch"`501502                  - `enabled: boolean`503504                  - `name: "web_fetch"`505506                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`507508                    Permission policy for tool execution.509510                    - `BetaManagedAgentsAlwaysAllowPolicy object`511512                      Tool calls are automatically approved without user confirmation.513514                    - `BetaManagedAgentsAlwaysAskPolicy object`515516                      Tool calls require user confirmation before execution.517518                    - `BetaManagedAgentsAutoPolicy object`519520                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.521522                  - `allowed_domains: optional array of string`523524                  - `blocked_domains: optional array of string`525526                  - `max_content_tokens: optional number or null`527528                    format: int32529530                - `BetaManagedAgentsWebSearchToolConfig object`531532                  Configuration for the web_search tool.533534                  - `type: "web_search"`535536                  - `enabled: boolean`537538                  - `name: "web_search"`539540                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`541542                    Permission policy for tool execution.543544                    - `BetaManagedAgentsAlwaysAllowPolicy object`545546                      Tool calls are automatically approved without user confirmation.547548                    - `BetaManagedAgentsAlwaysAskPolicy object`549550                      Tool calls require user confirmation before execution.551552                    - `BetaManagedAgentsAutoPolicy object`553554                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.555556                  - `allowed_domains: optional array of string`557558                  - `blocked_domains: optional array of string`559560                  - `user_location: optional BetaManagedAgentsUserLocation or null`561562                    Approximate user location for search result localization.563564                    - `type: "approximate"`565566                      Location precision. Only "approximate" is supported.567568                    - `city: optional string or null`569570                      City name.571572                      minLength: 1, maxLength: 255573574                    - `country: optional string or null`575576                      Two-letter ISO 3166-1 country code, uppercase.577578                    - `region: optional string or null`579580                      Region or state name.581582                      minLength: 1, maxLength: 255583584                    - `timezone: optional string or null`585586                      IANA timezone identifier, e.g. "America/Los_Angeles".587588                      minLength: 1, maxLength: 255589590              - `default_config: BetaManagedAgentsAgentToolsetDefaultConfig`591592                Resolved default configuration for agent tools.593594                - `enabled: boolean`595596                - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`597598                  Permission policy for tool execution.599600                  - `BetaManagedAgentsAlwaysAllowPolicy object`601602                    Tool calls are automatically approved without user confirmation.603604                  - `BetaManagedAgentsAlwaysAskPolicy object`605606                    Tool calls require user confirmation before execution.607608                  - `BetaManagedAgentsAutoPolicy object`609610                    The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.611612            - `BetaManagedAgentsMCPToolset object`613614              - `type: "mcp_toolset"`615616              - `configs: array of BetaManagedAgentsMCPToolConfig`617618                - `enabled: boolean`619620                - `name: string`621622                - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`623624                  Permission policy for tool execution.625626                  - `BetaManagedAgentsAlwaysAllowPolicy object`627628                    Tool calls are automatically approved without user confirmation.629630                  - `BetaManagedAgentsAlwaysAskPolicy object`631632                    Tool calls require user confirmation before execution.633634                  - `BetaManagedAgentsAutoPolicy object`635636                    The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.637638              - `default_config: BetaManagedAgentsMCPToolsetDefaultConfig`639640                Resolved default configuration for all tools from an MCP server.641642                - `enabled: boolean`643644                - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`645646                  Permission policy for tool execution.647648                  - `BetaManagedAgentsAlwaysAllowPolicy object`649650                    Tool calls are automatically approved without user confirmation.651652                  - `BetaManagedAgentsAlwaysAskPolicy object`653654                    Tool calls require user confirmation before execution.655656                  - `BetaManagedAgentsAutoPolicy object`657658                    The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.659660              - `mcp_server_name: string`661662            - `BetaManagedAgentsCustomTool object`663664              A custom tool as returned in API responses.665666              - `type: "custom"`667668              - `description: string`669670              - `input_schema: BetaManagedAgentsCustomToolInputSchema`671672                JSON Schema for custom tool input parameters.673674                - `type: "object"`675676                - `properties: optional map[unknown] or null`677678                - `required: optional array of string or null`679680              - `name: string`681682          - `version: number`683684            format: int32685686        - `BetaManagedAgentsAdvisor object`687688          Platform advisor roster entry: a model the session's primary thread may consult mid-turn.689690          - `type: "advisor"`691692          - `model: string`693694            The advisor model id.695696    - `name: string`697698    - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`699700      - `BetaManagedAgentsAnthropicSkill object`701702        A resolved Anthropic-managed skill.703704      - `BetaManagedAgentsCustomSkill object`705706        A resolved user-created custom skill.707708    - `system: string or null`709710    - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`711712      - `BetaManagedAgentsAgentToolset20260401 object`713714      - `BetaManagedAgentsMCPToolset object`715716      - `BetaManagedAgentsCustomTool object`717718        A custom tool as returned in API responses.719720    - `version: number`721722      format: int32723724  - `archived_at: string or null`725726    A timestamp in RFC 3339 format727728    format: date-time729730  - `budget: BetaManagedAgentsBudgetLimit or null`731732    A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.733734    - `type: "limit"`735736    - `max_list_cost: BetaMonetaryAmount`737738      A monetary amount in a specific currency.739740      - `amount: string`741742        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.743744      - `currency: BetaCurrency`745746        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.747748  - `created_at: string`749750    A timestamp in RFC 3339 format751752    format: date-time753754  - `environment_id: string`755756  - `metadata: map[string]`757758  - `outcome_evaluations: array of BetaManagedAgentsOutcomeEvaluationResource`759760    Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.761762    - `type: "outcome_evaluation"`763764    - `completed_at: string or null`765766      A timestamp in RFC 3339 format767768      format: date-time769770    - `description: string`771772      What the agent should produce.773774    - `explanation: string or null`775776      Grader's verdict text from the most recent evaluation. For `satisfied`, explains why criteria are met; for `needs_revision` (intermediate), what's missing; for `failed`, why unrecoverable.777778    - `iteration: number`779780      0-indexed revision cycle the outcome is currently on.781782      format: int32783784    - `outcome_id: string`785786      Server-generated outc_ ID for this outcome.787788    - `result: string`789790      Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal.791792  - `resources: array of BetaManagedAgentsSessionResource`793794    - `BetaManagedAgentsGitHubRepositoryResource object`795796      - `type: "github_repository"`797798      - `id: string`799800      - `created_at: string`801802        A timestamp in RFC 3339 format803804        format: date-time805806      - `mount_path: string`807808      - `updated_at: string`809810        A timestamp in RFC 3339 format811812        format: date-time813814      - `url: string`815816      - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout or null`817818        - `BetaManagedAgentsBranchCheckout object`819820          - `type: "branch"`821822          - `name: string`823824            Branch name to check out.825826            minLength: 1, maxLength: 255827828        - `BetaManagedAgentsCommitCheckout object`829830          - `type: "commit"`831832          - `sha: string`833834            Full commit SHA to check out.835836            minLength: 7, maxLength: 64837838    - `BetaManagedAgentsFileResource object`839840      - `type: "file"`841842      - `id: string`843844      - `created_at: string`845846        A timestamp in RFC 3339 format847848        format: date-time849850      - `file_id: string`851852      - `mount_path: string`853854      - `updated_at: string`855856        A timestamp in RFC 3339 format857858        format: date-time859860    - `BetaManagedAgentsMemoryStoreResource object`861862      A memory store attached to an agent session.863864      - `type: "memory_store"`865866      - `memory_store_id: string`867868        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.869870      - `access: optional "read_write" or "read_only" or null`871872        Access mode for an attached memory store.873874        - `"read_write"`875876        - `"read_only"`877878      - `description: optional string`879880        Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.881882      - `instructions: optional string or null`883884        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.885886        maxLength: 4096887888      - `mount_path: optional string or null`889890        Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.891892      - `name: optional string or null`893894        Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.895896  - `stats: BetaManagedAgentsSessionStats`897898    Timing statistics for a session.899900    - `active_seconds: optional number`901902      Cumulative time in seconds the session spent in `running` status. Excludes idle time.903904      format: double905906    - `duration_seconds: optional number`907908      Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.909910      format: double911912  - `status: "rescheduling" or "running" or "idle" or "terminated"`913914    SessionStatus enum915916    - `"rescheduling"`917918    - `"running"`919920    - `"idle"`921922    - `"terminated"`923924  - `title: string or null`925926  - `updated_at: string`927928    A timestamp in RFC 3339 format929930    format: date-time931932  - `usage: BetaManagedAgentsSessionUsage`933934    Cumulative token usage for a session across all turns.935936    - `active_seconds: optional number`937938      Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike `stats.active_seconds`, which sums each thread's own active time. This is the duration the session's runtime cost is priced on.939940      format: double941942    - `cache_creation: optional BetaManagedAgentsCacheCreationUsage`943944      Prompt-cache creation token usage broken down by cache lifetime.945946      - `ephemeral_1h_input_tokens: optional number`947948        Tokens used to create 1-hour ephemeral cache entries.949950        format: int32951952      - `ephemeral_5m_input_tokens: optional number`953954        Tokens used to create 5-minute ephemeral cache entries.955956        format: int32957958    - `cache_read_input_tokens: optional number`959960      Total tokens read from prompt cache.961962      format: int32963964    - `input_tokens: optional number`965966      Total input tokens consumed across all turns.967968      format: int32969970    - `list_cost: optional BetaMonetaryAmount or null`971972      A monetary amount in a specific currency.973974    - `output_tokens: optional number`975976      Total output tokens generated across all turns.977978      format: int32979980    - `server_tool_use: optional BetaManagedAgentsServerToolUsage or null`981982      Cumulative count of server-executed tool invocations, broken down by tool.983984      - `web_fetch_requests: optional number`985986        Number of server-executed web fetch requests.987988        format: int32989990      - `web_search_requests: optional number`991992        Number of server-executed web search requests.993994        format: int32995996  - `vault_ids: array of string`997998    Vault IDs attached to the session at creation. Empty when no vaults were supplied.9991000  - `deployment_id: optional string or null`10011002    Deployment ID when the session was created from a deployment reference. Null otherwise.10031004## Example10051006```bash1007curl https://api.anthropic.com/v1/sessions/$SESSION_ID/archive \1008    -X POST \1009    -H 'anthropic-version: 2023-06-01' \1010    -H 'anthropic-beta: managed-agents-2026-04-01' \1011    -H "X-Api-Key: $ANTHROPIC_API_KEY"1012```10131014### Response (200)10151016```json1017{1018  "id": "sesn_011CZkZAtmR3yMPDzynEDxu7",1019  "agent": {1020    "id": "agent_011CZkYpogX7uDKUyvBTophP",1021    "description": "A general-purpose starter agent.",1022    "mcp_servers": [1023      {1024        "name": "example-mcp",1025        "type": "url",1026        "url": "https://example-server.modelcontextprotocol.io/sse"1027      }1028    ],1029    "model": {1030      "id": "claude-opus-5",1031      "effort": {1032        "type": "low"1033      },1034      "inference_geo": "inference_geo",1035      "speed": "standard"1036    },1037    "multiagent": {1038      "agents": [1039        {1040          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",1041          "description": "A focused research subagent.",1042          "mcp_servers": [1043            {1044              "name": "example-mcp",1045              "type": "url",1046              "url": "https://example-server.modelcontextprotocol.io/sse"1047            }1048          ],1049          "model": {1050            "id": "claude-opus-5",1051            "effort": {1052              "type": "low"1053            },1054            "inference_geo": "inference_geo",1055            "speed": "standard"1056          },1057          "name": "Researcher",1058          "skills": [1059            {1060              "skill_id": "xlsx",1061              "type": "anthropic",1062              "version": "1"1063            }1064          ],1065          "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",1066          "tools": [1067            {1068              "configs": [1069                {1070                  "enabled": true,1071                  "name": "bash",1072                  "permission_policy": {1073                    "type": "always_allow"1074                  },1075                  "type": "bash"1076                }1077              ],1078              "default_config": {1079                "enabled": true,1080                "permission_policy": {1081                  "type": "always_ask"1082                }1083              },1084              "type": "agent_toolset_20260401"1085            }1086          ],1087          "type": "agent",1088          "version": 11089        }1090      ],1091      "type": "coordinator"1092    },1093    "name": "My First Agent",1094    "skills": [1095      {1096        "skill_id": "xlsx",1097        "type": "anthropic",1098        "version": "1"1099      },1100      {1101        "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx",1102        "type": "custom",1103        "version": "2"1104      }1105    ],1106    "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",1107    "tools": [1108      {1109        "configs": [1110          {1111            "enabled": true,1112            "name": "bash",1113            "permission_policy": {1114              "type": "always_allow"1115            },1116            "type": "bash"1117          }1118        ],1119        "default_config": {1120          "enabled": true,1121          "permission_policy": {1122            "type": "always_ask"1123          }1124        },1125        "type": "agent_toolset_20260401"1126      }1127    ],1128    "type": "agent",1129    "version": 11130  },1131  "archived_at": null,1132  "budget": {1133    "max_list_cost": {1134      "amount": "2500",1135      "currency": "USD"1136    },1137    "type": "limit"1138  },1139  "created_at": "2026-03-15T10:00:00Z",1140  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",1141  "metadata": {},1142  "outcome_evaluations": [1143    {1144      "completed_at": "2026-03-15T10:02:31Z",1145      "description": "Produce a 2-page summary as summary.md",1146      "explanation": "All five sections present with inline citations.",1147      "iteration": 0,1148      "outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP",1149      "result": "satisfied",1150      "type": "outcome_evaluation"1151    }1152  ],1153  "resources": [1154    {1155      "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",1156      "created_at": "2026-03-15T10:00:00Z",1157      "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",1158      "mount_path": "/uploads/receipt.pdf",1159      "type": "file",1160      "updated_at": "2026-03-15T10:00:00Z"1161    },1162    {1163      "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",1164      "created_at": "2026-03-15T10:00:00Z",1165      "mount_path": "/workspace/example-repo",1166      "type": "github_repository",1167      "updated_at": "2026-03-15T10:00:00Z",1168      "url": "https://github.com/example-org/example-repo",1169      "checkout": {1170        "name": "main",1171        "type": "branch"1172      }1173    }1174  ],1175  "stats": {1176    "active_seconds": 0,1177    "duration_seconds": 01178  },1179  "status": "idle",1180  "title": "Order #1234 inquiry",1181  "type": "session",1182  "updated_at": "2026-03-15T10:00:00Z",1183  "usage": {1184    "active_seconds": 0,1185    "cache_creation": {1186      "ephemeral_1h_input_tokens": 0,1187      "ephemeral_5m_input_tokens": 01188    },1189    "cache_read_input_tokens": 0,1190    "input_tokens": 0,1191    "list_cost": {1192      "amount": "2500",1193      "currency": "USD"1194    },1195    "output_tokens": 0,1196    "server_tool_use": {1197      "web_fetch_requests": 0,1198      "web_search_requests": 31199    }1200  },1201  "vault_ids": [1202    "vlt_011CZkZDLs7fYzm1hXNPeRjv"1203  ],1204  "deployment_id": "deployment_id"1205}1206```1207
Files main
Menu

Theme