SPB Git

Repository Public

archive.md 17.8 KB 712 lines markdown

1---2title: Archive Deployment3url: https://platform.claude.com/docs/en/api/beta/deployments/archive4---56# Archive Deployment78**POST** `/v1/deployments/{deployment_id}/archive`910Archive Deployment1112## Path parameters1314- `deployment_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- `BetaManagedAgentsDeployment object`123124  A deployment is a configured instance of an agent — it binds the agent to everything needed to run it autonomously: an environment, credentials, initial events, and an optional schedule.125126  - `type: "deployment"`127128  - `id: string`129130    Unique identifier for this deployment.131132  - `agent: BetaManagedAgentsAgentReference`133134    A resolved agent reference with a concrete version.135136    - `type: "agent"`137138    - `id: string`139140    - `version: number`141142      format: int32143144  - `archived_at: string or null`145146    A timestamp in RFC 3339 format147148    format: date-time149150  - `created_at: string`151152    A timestamp in RFC 3339 format153154    format: date-time155156  - `description: string or null`157158    Description of what the deployment does.159160  - `environment_id: string`161162    ID of the `environment` where sessions run.163164  - `initial_events: array of BetaManagedAgentsDeploymentInitialEvent`165166    Events sent to each session immediately after creation.167168    - `BetaManagedAgentsDeploymentUserMessageEvent object`169170      A user message sent to the session.171172      - `type: "user.message"`173174      - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsRedactedBlock`175176        Array of content blocks for the user message.177178        - `BetaManagedAgentsTextBlock object`179180          Regular text content.181182          - `type: "text"`183184          - `text: string`185186            The text content.187188            minLength: 1189190        - `BetaManagedAgentsImageBlock object`191192          Image content specified directly as base64 data or as a reference via a URL.193194          - `type: "image"`195196          - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`197198            Union type for image source variants.199200            - `BetaManagedAgentsBase64ImageSource object`201202              Base64-encoded image data.203204              - `type: "base64"`205206              - `data: string`207208                Base64-encoded image data.209210                minLength: 1211212              - `media_type: string`213214                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").215216                minLength: 1217218            - `BetaManagedAgentsURLImageSource object`219220              Image referenced by URL.221222              - `type: "url"`223224              - `url: string`225226                URL of the image to fetch.227228                minLength: 1229230            - `BetaManagedAgentsFileImageSource object`231232              Image referenced by file ID.233234              - `type: "file"`235236              - `file_id: string`237238                ID of a previously uploaded file.239240                minLength: 1241242        - `BetaManagedAgentsDocumentBlock object`243244          Document content, either specified directly as base64 data, as text, or as a reference via a URL.245246          - `type: "document"`247248          - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`249250            Union type for document source variants.251252            - `BetaManagedAgentsBase64DocumentSource object`253254              Base64-encoded document data.255256              - `type: "base64"`257258              - `data: string`259260                Base64-encoded document data.261262                minLength: 1263264              - `media_type: string`265266                MIME type of the document (e.g., "application/pdf").267268                minLength: 1269270            - `BetaManagedAgentsPlainTextDocumentSource object`271272              Plain text document content.273274              - `type: "text"`275276              - `data: string`277278                The plain text content.279280                minLength: 1281282              - `media_type: "text/plain"`283284                MIME type of the text content. Must be "text/plain".285286            - `BetaManagedAgentsURLDocumentSource object`287288              Document referenced by URL.289290              - `type: "url"`291292              - `url: string`293294                URL of the document to fetch.295296                minLength: 1297298            - `BetaManagedAgentsFileDocumentSource object`299300              Document referenced by file ID.301302              - `type: "file"`303304              - `file_id: string`305306                ID of a previously uploaded file.307308                minLength: 1309310          - `context: optional string or null`311312            Additional context about the document for the model.313314          - `title: optional string or null`315316            The title of the document.317318        - `BetaManagedAgentsRedactedBlock object`319320          Placeholder for content withheld by Anthropic model policy.321322          - `type: "redacted"`323324    - `BetaManagedAgentsDeploymentUserDefineOutcomeEvent object`325326      An outcome the agent should work toward. The agent begins work on receipt.327328      - `type: "user.define_outcome"`329330      - `description: string`331332        What the agent should produce. This is the task specification.333334      - `rubric: BetaManagedAgentsFileRubric or BetaManagedAgentsTextRubric`335336        Rubric for grading the quality of an outcome.337338        - `BetaManagedAgentsFileRubric object`339340          Rubric referenced by a file uploaded via the Files API.341342          - `type: "file"`343344          - `file_id: string`345346            ID of the rubric file.347348        - `BetaManagedAgentsTextRubric object`349350          Rubric content provided inline as text.351352          - `type: "text"`353354          - `content: string`355356            Rubric content. Plain text or markdown — the grader treats it as freeform text.357358      - `max_iterations: optional number or null`359360        Eval→revision cycles before giving up. Default 3, max 20.361362        format: int32363364    - `BetaManagedAgentsDeploymentSystemMessageEvent object`365366      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt.367368      - `type: "system.message"`369370      - `content: array of BetaManagedAgentsSystemContentBlock`371372        System content blocks to append. Text-only.373374        - `type: "text"`375376        - `text: string`377378          The text content.379380          minLength: 1381382  - `metadata: map[string]`383384    Arbitrary key-value metadata. Maximum 16 pairs.385386  - `name: string`387388    Human-readable name.389390  - `paused_reason: BetaManagedAgentsDeploymentPausedReason or null`391392    Why a deployment is paused. Non-null exactly when `status` is `paused`.393394    - `BetaManagedAgentsManualDeploymentPausedReason object`395396      The caller invoked the pause endpoint on the deployment.397398      - `type: "manual"`399400    - `BetaManagedAgentsErrorDeploymentPausedReason object`401402      A scheduled fire recorded a failed run whose error auto-pauses the deployment.403404      - `type: "error"`405406      - `error: BetaManagedAgentsDeploymentPausedReasonError`407408        The error that triggered an auto-pause. Matches the failed run's `error.type`.409410        - `BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError object`411412          The deployment's environment was archived.413414          - `type: "environment_archived_error"`415416        - `BetaManagedAgentsAgentArchivedDeploymentPausedReasonError object`417418          The deployment's agent was archived.419420          - `type: "agent_archived_error"`421422        - `BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError object`423424          The deployment's environment no longer exists.425426          - `type: "environment_not_found_error"`427428        - `BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError object`429430          A vault referenced by the deployment no longer exists.431432          - `type: "vault_not_found_error"`433434        - `BetaManagedAgentsFileNotFoundDeploymentPausedReasonError object`435436          A file resource referenced by the deployment no longer exists.437438          - `type: "file_not_found_error"`439440        - `BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError object`441442          A referenced resource no longer exists and its kind was not reported.443444          - `type: "session_resource_not_found_error"`445446        - `BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError object`447448          The deployment's workspace was archived.449450          - `type: "workspace_archived_error"`451452        - `BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError object`453454          The deployment's organization is disabled.455456          - `type: "organization_disabled_error"`457458        - `BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError object`459460          A memory store referenced by the deployment is archived.461462          - `type: "memory_store_archived_error"`463464        - `BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError object`465466          A skill referenced by the deployment's agent no longer exists.467468          - `type: "skill_not_found_error"`469470        - `BetaManagedAgentsVaultArchivedDeploymentPausedReasonError object`471472          A vault referenced by the deployment is archived.473474          - `type: "vault_archived_error"`475476        - `BetaManagedAgentsUnknownDeploymentPausedReasonError object`477478          An unrecognized error auto-paused the deployment. A fallback variant; matches a run whose `error.type` is `unknown_error`.479480          - `type: "unknown_error"`481482        - `BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError object`483484          The deployment configures resources, but its environment is self-hosted and cannot mount them.485486          - `type: "self_hosted_resources_unsupported_error"`487488        - `BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError object`489490          An MCP server host used by the deployment's agent is blocked by the environment's network policy.491492          - `type: "mcp_egress_blocked_error"`493494  - `resources: array of BetaManagedAgentsSessionResourceConfig`495496    Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials.497498    - `BetaManagedAgentsGitHubRepositoryResourceConfig object`499500      A GitHub repository mounted into each session's container. The authorization token is write-only and never returned.501502      - `type: "github_repository"`503504      - `url: string`505506        Github URL of the repository507508      - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout or null`509510        Branch or commit to check out. Defaults to the repository's default branch.511512        - `BetaManagedAgentsBranchCheckout object`513514          - `type: "branch"`515516          - `name: string`517518            Branch name to check out.519520            minLength: 1, maxLength: 255521522        - `BetaManagedAgentsCommitCheckout object`523524          - `type: "commit"`525526          - `sha: string`527528            Full commit SHA to check out.529530            minLength: 7, maxLength: 64531532      - `mount_path: optional string or null`533534        Mount path in the container. Defaults to `/workspace/<repo-name>`.535536    - `BetaManagedAgentsFileResourceConfig object`537538      A file mounted into each session's container.539540      - `type: "file"`541542      - `file_id: string`543544        ID of a previously uploaded file.545546      - `mount_path: optional string or null`547548        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.549550    - `BetaManagedAgentsMemoryStoreResourceConfig object`551552      A memory store attached to each session created from this deployment.553554      - `type: "memory_store"`555556      - `memory_store_id: string`557558        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.559560      - `access: optional "read_write" or "read_only" or null`561562        Access mode for an attached memory store.563564        - `"read_write"`565566        - `"read_only"`567568      - `instructions: optional string or null`569570        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.571572  - `schedule: BetaManagedAgentsSchedule or null`573574    5-field POSIX cron schedule with computed runtime timestamps.575576    - `type: "cron"`577578    - `expression: string`579580      5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).581582      minLength: 1, maxLength: 256583584    - `timezone: string`585586      IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").587588      minLength: 1589590    - `last_run_at: optional string or null`591592      A timestamp in RFC 3339 format593594      format: date-time595596    - `upcoming_runs_at: optional array of string`597598      Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time.599600  - `status: BetaManagedAgentsDeploymentStatus`601602    Lifecycle status of a deployment.603604    - `"active"`605606    - `"paused"`607608  - `updated_at: string`609610    A timestamp in RFC 3339 format611612    format: date-time613614  - `vault_ids: array of string`615616    Vault IDs supplying stored credentials for sessions created from this deployment.617618  - `budget: optional BetaManagedAgentsBudgetLimit or null`619620    A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.621622    - `type: "limit"`623624    - `max_list_cost: BetaMonetaryAmount`625626      A monetary amount in a specific currency.627628      - `amount: string`629630        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.631632      - `currency: BetaCurrency`633634        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.635636## Example637638```bash639curl https://api.anthropic.com/v1/deployments/$DEPLOYMENT_ID/archive \640    -X POST \641    -H 'anthropic-version: 2023-06-01' \642    -H 'anthropic-beta: managed-agents-2026-04-01' \643    -H "X-Api-Key: $ANTHROPIC_API_KEY"644```645646### Response (200)647648```json649{650  "id": "depl_011CZkZcDH3vPqd7xnEfwTai",651  "agent": {652    "id": "agent_011CZkYpogX7uDKUyvBTophP",653    "type": "agent",654    "version": 1655  },656  "archived_at": null,657  "created_at": "2026-03-15T10:00:00Z",658  "description": "Compiles yesterday's orders into a report every weekday morning.",659  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",660  "initial_events": [661    {662      "content": [663        {664          "text": "Compile yesterday's orders into report.md.",665          "type": "text"666        }667      ],668      "type": "user.message"669    }670  ],671  "metadata": {},672  "name": "Daily order report",673  "paused_reason": {674    "type": "manual"675  },676  "resources": [677    {678      "type": "github_repository",679      "url": "url",680      "checkout": {681        "name": "main",682        "type": "branch"683      },684      "mount_path": "mount_path"685    }686  ],687  "schedule": {688    "expression": "0 9 * * 1-5",689    "timezone": "America/Los_Angeles",690    "type": "cron",691    "last_run_at": "2026-03-16T16:00:09Z",692    "upcoming_runs_at": [693      "2026-03-17T16:00:00Z",694      "2026-03-18T16:00:00Z"695    ]696  },697  "status": "active",698  "type": "deployment",699  "updated_at": "2026-03-15T10:00:00Z",700  "vault_ids": [701    "vlt_011CZkZDLs7fYzm1hXNPeRjv"702  ],703  "budget": {704    "max_list_cost": {705      "amount": "2500",706      "currency": "USD"707    },708    "type": "limit"709  }710}711```712
Files main
Menu

Theme