Claude Platform Docs

Environments

Create Environment
client.Beta.Environments.New(ctx, params) (*BetaEnvironment, error)
POST/v1/environments
List Environments
client.Beta.Environments.List(ctx, params) (*PageCursor[BetaEnvironment], error)
GET/v1/environments
Get Environment
client.Beta.Environments.Get(ctx, environmentID, query) (*BetaEnvironment, error)
GET/v1/environments/{environment_id}
Update Environment
client.Beta.Environments.Update(ctx, environmentID, params) (*BetaEnvironment, error)
POST/v1/environments/{environment_id}
Delete Environment
client.Beta.Environments.Delete(ctx, environmentID, body) (*BetaEnvironmentDeleteResponse, error)
DELETE/v1/environments/{environment_id}
Archive Environment
client.Beta.Environments.Archive(ctx, environmentID, body) (*BetaEnvironment, error)
POST/v1/environments/{environment_id}/archive
Models
type BetaCloudConfig struct{…}

cloud environment configuration.

type BetaCloudConfigParamsResp struct{…}

Request params for cloud environment configuration.

Fields default to null; on update, omitted fields preserve the existing value.

type BetaEnvironment struct{…}

Unified Environment resource for both cloud and self-hosted environments.

type BetaEnvironmentDeleteResponse struct{…}

Response after deleting an environment.

ID string

Environment identifier

Type BetaEnvironmentDeleteResponseType

The type of response

defaultenvironment_deleted
type BetaLimitedNetwork struct{…}

Limited network access.

AllowMCPServers bool

Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the allowed_hosts array.

AllowPackageManagers bool

Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the allowed_hosts array.

AllowedHosts []string

Specifies domains the container can reach.

Type Limited

Network policy type

type BetaLimitedNetworkParamsResp struct{…}

Limited network request params.

Fields default to null; on update, omitted fields preserve the existing value.

Type Limited

Network policy type

AllowMCPServers bool Optional

Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the allowed_hosts array. Defaults to false.

AllowPackageManagers bool Optional

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

AllowedHosts []string Optional

Specifies domains the container can reach.

type BetaPackages struct{…}

Packages (and their versions) available in this environment.

Apt []string

Ubuntu/Debian packages to install

Cargo []string

Rust packages to install

Gem []string

Ruby packages to install

Go []string

Go packages to install

Npm []string

Node.js packages to install

Pip []string

Python packages to install

Type BetaPackagesType Optional

Package configuration type

defaultpackages
type BetaPackagesParamsResp struct{…}

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.

Apt []string Optional

Ubuntu/Debian packages to install

Cargo []string Optional

Rust packages to install

Gem []string Optional

Ruby packages to install

Go []string Optional

Go packages to install

Npm []string Optional

Node.js packages to install

Pip []string Optional

Python packages to install

Type BetaPackagesParamsType Optional

Package configuration type

defaultpackages
type BetaSelfHostedConfig struct{…}

Configuration for self-hosted environments.

Type SelfHosted

Environment type

type BetaSelfHostedConfigParamsResp struct{…}

Request params for self_hosted environment configuration.

Type SelfHosted

Environment type

type BetaUnrestrictedNetwork struct{…}

Unrestricted network access.

Type Unrestricted

Network policy type

EnvironmentsWork

Get Work Item
client.Beta.Environments.Work.Get(ctx, workID, params) (*BetaSelfHostedWork, error)
GET/v1/environments/{environment_id}/work/{work_id}
Poll for Work
client.Beta.Environments.Work.Poll(ctx, environmentID, params) (*BetaSelfHostedWork, error)
GET/v1/environments/{environment_id}/work/poll
Acknowledge Work
client.Beta.Environments.Work.Ack(ctx, workID, params) (*BetaSelfHostedWork, error)
POST/v1/environments/{environment_id}/work/{work_id}/ack
Record Heartbeat
client.Beta.Environments.Work.Heartbeat(ctx, workID, params) (*BetaSelfHostedWorkHeartbeatResponse, error)
POST/v1/environments/{environment_id}/work/{work_id}/heartbeat
Stop Work
client.Beta.Environments.Work.Stop(ctx, workID, params) (*BetaSelfHostedWork, error)
POST/v1/environments/{environment_id}/work/{work_id}/stop
List Work Items
client.Beta.Environments.Work.List(ctx, environmentID, params) (*PageCursor[BetaSelfHostedWork], error)
GET/v1/environments/{environment_id}/work
Update Work Item
client.Beta.Environments.Work.Update(ctx, workID, params) (*BetaSelfHostedWork, error)
POST/v1/environments/{environment_id}/work/{work_id}
Get Queue Statistics
client.Beta.Environments.Work.Stats(ctx, environmentID, query) (*BetaSelfHostedWorkQueueStats, error)
GET/v1/environments/{environment_id}/work/stats