v49

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-261319281.7 MB

Update Environment

Update an existing environment's configuration.

post/v1/environments/{environment_id}?beta=true

Path parameters

environment_idstring required

Headers

anthropic-betastring

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.

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-versionstring

The version of the Claude API you want to use.

Read more about versioning and our version history here.

The version of the Claude API you want to use.

Read more about versioning and our version history here.

Request body

descriptionstring nullable

Updated description of the environment

metadataobject

User-provided metadata key-value pairs. Set a value to null or empty string to delete the key.

namestring 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.

Example request

{
  "description": "Python environment with data-analysis packages."
}

Response

Successful Response

archived_atstring nullable required

RFC 3339 timestamp when environment was archived, or null if not archived

created_atstring required

RFC 3339 timestamp when environment was created

descriptionstring required

User-provided description for the environment

idstring required

Environment identifier (e.g., 'env_...')

metadataobject required

User-provided metadata key-value pairs

namestring 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_atstring required

RFC 3339 timestamp when environment was last updated

Example response

{
  "type": "environment",
  "id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "name": "python-data-analysis",
  "description": "Python environment with data-analysis packages.",
  "config": {
    "type": "cloud",
    "networking": {
      "type": "limited",
      "allowed_hosts": [
        "api.example.com"
      ],
      "allow_package_managers": true,
      "allow_mcp_servers": false
    },
    "packages": {
      "type": "packages",
      "pip": [
        "pandas",
        "numpy"
      ],
      "npm": [],
      "apt": [],
      "cargo": [],
      "gem": [],
      "go": []
    }
  },
  "metadata": {},
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "updated_at": "2026-03-15T10:00:00Z"
}