Create Environment
api/beta/environments/create
Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
api/beta/environments/create Changed · +28 / -45 lines
# Create Environment ## Headers ## Body parameters ## Returns ## Example ### Response (200) ## Create Environment ### Header Parameters ### Body Parameters ### Returns ### Example #### Response
---- -title: Create Environment -url: https://platform.claude.com/docs/en/api/beta/environments/create ---- +# Create Environment -## Create Environment +**POST** `/v1/environments` -**post** `/v1/environments` - Create a new environment with the specified configuration. -### Header Parameters +## Headers - `"anthropic-beta": optional array of AnthropicBeta`
- `"mid-conversation-tool-changes-2026-07-01"` -### Body Parameters +## Body parameters - `name: string` Human-readable name for the environment + maxLength: 256, minLength: 1 + - `config: optional BetaCloudConfigParams or BetaSelfHostedConfigParams or null` Environment configuration - - `BetaCloudConfigParams object { type, networking, packages }` + - `BetaCloudConfigParams object` Request params for `cloud` environment configuration.
Environment type - - `"cloud"` - - `networking: optional BetaUnrestrictedNetwork or BetaLimitedNetworkParams or null` Network configuration policy. Omit on update to preserve the existing value. - - `BetaUnrestrictedNetwork object { type }` + - `BetaUnrestrictedNetwork object` Unrestricted network access.
Network policy type - - `"unrestricted"` + - `BetaLimitedNetworkParams object` - - `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
Network policy type - - `"limited"` - - `allow_mcp_servers: optional boolean or null` Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.
Package configuration type - - `"packages"` + default: packages - - `BetaSelfHostedConfigParams object { type }` + - `BetaSelfHostedConfigParams object` Request params for `self_hosted` environment configuration.
Environment type - - `"self_hosted"` - - `description: optional string or null` Optional description of the environment + maxLength: 1024 + - `metadata: optional map[string]` User-provided metadata key-value pairs
- `"account"` -### Returns +## Returns -- `BetaEnvironment object { id, archived_at, config, 7 more }` +- `BetaEnvironment object` Unified Environment resource for both cloud and self-hosted environments.
Environment configuration (either Anthropic Cloud or self-hosted) - - `BetaCloudConfig object { networking, packages, type }` + - `BetaCloudConfig object` `cloud` environment configuration.
Network configuration policy. - - `BetaUnrestrictedNetwork object { type }` + - `BetaUnrestrictedNetwork object` Unrestricted network access.
Network policy type - - `"unrestricted"` + - `BetaLimitedNetwork object` - - `BetaLimitedNetwork object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }` - Limited network access. - `allow_mcp_servers: boolean`
Network policy type - - `"limited"` - - `packages: BetaPackages` Package manager configuration.
Package configuration type - - `"packages"` + default: packages - `type: "cloud"` Environment type - - `"cloud"` + - `BetaSelfHostedConfig object` - - `BetaSelfHostedConfig object { type }` - Configuration for self-hosted environments. - `type: "self_hosted"`
Environment type - - `"self_hosted"` - - `created_at: string` RFC 3339 timestamp when environment was created
The type of object (always 'environment') - - `"environment"` + default: environment - `updated_at: string`
- `"account"` -### Example +## Example -```http +```bash curl https://api.anthropic.com/v1/environments \ -H 'Content-Type: application/json' \ -H 'anthropic-version: 2023-06-01' \
}' ``` -#### Response +### Response (200) ```json {