---
title: "Update Environment"
method: POST
path: "/v1/environments/{environment_id}?beta=true"
---

# Update Environment

`POST /v1/environments/{environment_id}?beta=true`

Update an existing environment's configuration.

## Path parameters

- `environment_id` string, required

## Headers

- `anthropic-beta` string — Optional header to specify the beta version(s) you want to use. To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.
- `anthropic-version` string — The version of the Claude API you want to use. Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).

## Request body

- BetaPublicEnvironmentUpdateRequest — Public API request to update an environment (without org/account fields).
  - `config` union — Updated environment configuration
    - BetaCloudConfigParams — Request params for `cloud` environment configuration. Fields default to null; on update, omitted fields preserve the existing value.
      - `networking` union — Network configuration policy. Omit on update to preserve the existing value.
        - BetaUnrestrictedNetwork — Unrestricted network access.
          - `type` 'unrestricted', required — Network policy type
        - BetaLimitedNetworkParams — Limited network request params. Fields default to null; on update, omitted fields preserve the existing value.
          - `allow_mcp_servers` boolean, nullable — Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.
          - `allow_package_managers` boolean, nullable — Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array. Defaults to `false`.
          - `allowed_hosts` string[], nullable — Specifies domains the container can reach.
          - `type` 'limited', required — Network policy type
      - `packages` BetaPackagesParams — 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.
        - `apt` string[], nullable — Ubuntu/Debian packages to install
        - `cargo` string[], nullable — Rust packages to install
        - `gem` string[], nullable — Ruby packages to install
        - `go` string[], nullable — Go packages to install
        - `npm` string[], nullable — Node.js packages to install
        - `pip` string[], nullable — Python packages to install
        - `type` 'packages' — Package configuration type
      - `type` 'cloud', required — Environment type
    - BetaSelfHostedConfigParams — Request params for `self_hosted` environment configuration.
      - `type` 'self_hosted', required — Environment type
  - `description` string, nullable — Updated description of the environment
  - `metadata` object — User-provided metadata key-value pairs. Set a value to null or empty string to delete the key.
  - `name` string, nullable — Updated name for the environment
  - `scope` 'organization' | 'account', nullable — The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only.

## Response `200`

Successful Response

- BetaEnvironment — Unified Environment resource for both cloud and self-hosted environments.
  - `archived_at` string, nullable, required — RFC 3339 timestamp when environment was archived, or null if not archived
  - `config` union, required — Environment configuration (either Anthropic Cloud or self-hosted)
    - BetaCloudConfig — `cloud` environment configuration.
      - `networking` union, required — Network configuration policy.
        - BetaUnrestrictedNetwork — Unrestricted network access.
          - `type` 'unrestricted', required — Network policy type
        - BetaLimitedNetwork — Limited network access.
          - `allow_mcp_servers` boolean, required — Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
          - `allow_package_managers` boolean, required — Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
          - `allowed_hosts` string[], required — Specifies domains the container can reach.
          - `type` 'limited', required — Network policy type
      - `packages` BetaPackages, required — Packages (and their versions) available in this environment.
        - `apt` string[], required — Ubuntu/Debian packages to install
        - `cargo` string[], required — Rust packages to install
        - `gem` string[], required — Ruby packages to install
        - `go` string[], required — Go packages to install
        - `npm` string[], required — Node.js packages to install
        - `pip` string[], required — Python packages to install
        - `type` 'packages' — Package configuration type
      - `type` 'cloud', required — Environment type
    - BetaSelfHostedConfig — Configuration for self-hosted environments.
      - `type` 'self_hosted', required — Environment type
  - `created_at` string, required — RFC 3339 timestamp when environment was created
  - `description` string, required — User-provided description for the environment
  - `id` string, required — Environment identifier (e.g., 'env_...')
  - `metadata` object, required — User-provided metadata key-value pairs
  - `name` string, required — Human-readable name for the environment
  - `scope` 'organization' | 'account' — The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.
  - `type` 'environment', required — The type of object (always 'environment')
  - `updated_at` string, required — RFC 3339 timestamp when environment was last updated

## Other responses

- `4XX` — Error response. See our [errors documentation](https://platform.claude.com/docs/en/api/errors) for more details.

---

[API](https://skmtc.net/anthropics/apis/anthropic-api.md) · [All operations](https://skmtc.net/anthropics/apis/anthropic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/anthropics/anthropic-api/versions/93d8fd7d6493/schema)
