--- url: "https://platform.claude.com/docs/en/api/beta/environments" titulek: "Environments - Claude API Reference" h1: "Environments" popis: "API reference for Environments endpoints" jazyk: "en" kanonicka: "https://platform.claude.com/docs/en/api/beta/environments" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-15 03:16:34" znaku: 7492 slov: 818 kodovani: "iso-8859-2" sha256: "8551f9ae94b6657a24399d9e44f1accbd50e211c5a6c997bd5d6087aeda21297" --- # Environments ##### [Create Environment](/docs/en/api/http/beta/environments/create) POST /v1/environments Create a new environment with the specified configuration. ##### [List Environments](/docs/en/api/http/beta/environments/list) GET /v1/environments List environments with pagination support. ##### [Get Environment](/docs/en/api/http/beta/environments/retrieve) GET /v1/environments/{environment_id} Retrieve a specific environment by ID. ##### [Update Environment](/docs/en/api/http/beta/environments/update) POST /v1/environments/{environment_id} Update an existing environment's configuration. ##### [Delete Environment](/docs/en/api/http/beta/environments/delete) DELETE /v1/environments/{environment_id} Delete an environment by ID. Returns a confirmation of the deletion. ##### [Archive Environment](/docs/en/api/http/beta/environments/archive) POST /v1/environments/{environment_id}/archive Archive an environment by ID. Archived environments cannot be used to create new sessions. ##### Models BetaCloudConfig object{ type, networking, packages }`cloud` environment configuration. BetaCloudConfigParams object{ type, networking, packages }Request params for `cloud` environment configuration.Fields default to null; on update, omitted fields preserve the existing value. BetaEnvironment object{ type, id, archived_at, 7 more }Unified Environment resource for both cloud and self-hosted environments. BetaEnvironmentDeleteResponse object{ type, id }Response after deleting an environment.type: "environment_deleted"The type of responsedefaultenvironment_deletedid: stringEnvironment identifier BetaLimitedNetwork object{ type, allow_mcp_servers, allow_package_managers, allowed_hosts }Limited network access.type: "limited"Network policy typeallow_mcp_servers: booleanPermits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.allow_package_managers: booleanPermits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.allowed_hosts: array of stringSpecifies domains the container can reach. BetaLimitedNetworkParams object{ type, allow_mcp_servers, allow_package_managers, allowed_hosts }Limited network request params.Fields default to null; on update, omitted fields preserve the existing value.type: "limited"Network policy typeallow_mcp_servers: optional boolean or nullPermits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.allow_package_managers: optional boolean or nullPermits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array. Defaults to `false` on creation. Must be `true` when `packages` are specified.allowed_hosts: optional array of string or nullSpecifies domains the container can reach. BetaPackages object{ type, apt, cargo, 4 more }Packages (and their versions) available in this environment.type: optional "packages"Package configuration typedefaultpackagesapt: array of stringUbuntu/Debian packages to installcargo: array of stringRust packages to installgem: array of stringRuby packages to installgo: array of stringGo packages to installnpm: array of stringNode.js packages to installpip: array of stringPython packages to install BetaPackagesParams object{ type, apt, cargo, 4 more }Specify packages (and optionally their versions) available in this environment.When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest. Under `limited` networking, requires `networking.allow_package_managers` to be `true`.type: optional "packages"Package configuration typedefaultpackagesapt: optional array of string or nullUbuntu/Debian packages to installcargo: optional array of string or nullRust packages to installgem: optional array of string or nullRuby packages to installgo: optional array of string or nullGo packages to installnpm: optional array of string or nullNode.js packages to installpip: optional array of string or nullPython packages to install BetaSelfHostedConfig object{ type }Configuration for self-hosted environments.type: "self_hosted"Environment type BetaSelfHostedConfigParams object{ type }Request params for `self_hosted` environment configuration.type: "self_hosted"Environment type BetaUnrestrictedNetwork object{ type }Unrestricted network access.type: "unrestricted"Network policy type #### Environments[Work](/docs/en/api/http/beta/environments/work) ##### [Get Work Item](/docs/en/api/http/beta/environments/work/retrieve) GET /v1/environments/{environment_id}/work/{work_id} Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly. ##### [Poll for Work](/docs/en/api/http/beta/environments/work/poll) GET /v1/environments/{environment_id}/work/poll Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly. ##### [Acknowledge Work](/docs/en/api/http/beta/environments/work/ack) POST /v1/environments/{environment_id}/work/{work_id}/ack Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly. ##### [Record Heartbeat](/docs/en/api/http/beta/environments/work/heartbeat) POST /v1/environments/{environment_id}/work/{work_id}/heartbeat Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly. ##### [Stop Work](/docs/en/api/http/beta/environments/work/stop) POST /v1/environments/{environment_id}/work/{work_id}/stop Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly. ##### [List Work Items](/docs/en/api/http/beta/environments/work/list) GET /v1/environments/{environment_id}/work Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly. ##### [Update Work Item](/docs/en/api/http/beta/environments/work/update) POST /v1/environments/{environment_id}/work/{work_id} Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly. ##### [Get Queue Statistics](/docs/en/api/http/beta/environments/work/stats) GET /v1/environments/{environment_id}/work/stats Get statistics about the work queue for an environment.