Agent

Archive Environment

Archive an execution environment; archived ones can no longer be used to create new sessions.

Call Create environment first and replace env_123 with its returned ID.

POST /agent/v1/environments/{environment_id}/archive◐ Partial

Request parameters

  • environment_idstring必填

    path: Environment id, as returned by environments.create or environments.list. Built-in environments can be read but not changed.

Returns

200

Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringEnvironment identifier (e.g., 'env_...')
archived_atnull | stringRFC 3339 timestamp when environment was archived, or null if not archived
configobjectEnvironment configuration (either Anthropic Cloud or self-hosted)
config.networkingobjectNetwork configuration policy.
config.packagesobjectPackage manager configuration.
config.typestringEnvironment type
created_atstringRFC 3339 timestamp when environment was created
descriptionnull | stringUser-provided description for the environment; null when unset
metadataobjectUser-provided metadata key-value pairs
namestringHuman-readable name for the environment
typestringThe type of object (always 'environment')
updated_atstringRFC 3339 timestamp when environment was last updated
scopestringThe visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.