SPB Git

Repository Public

list.md 6.9 KB 334 lines markdown

1---2title: List Environments3url: https://platform.claude.com/docs/en/api/beta/environments/list4---56# List Environments78**GET** `/v1/environments`910List environments with pagination support.1112## Query parameters1314- `include_archived: optional boolean`1516  Include archived environments in the response1718  default: false1920- `limit: optional number`2122  Maximum number of environments to return2324  default: 20, maximum: 1000, minimum: 12526- `page: optional string`2728  Opaque cursor from previous response for pagination. Pass the `next_page` value from the previous response.2930## Headers3132- `"anthropic-beta": optional array of AnthropicBeta`3334  Optional header to specify the beta version(s) you want to use.3536  - `string`3738  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`3940    - `"message-batches-2024-09-24"`4142    - `"prompt-caching-2024-07-31"`4344    - `"computer-use-2024-10-22"`4546    - `"computer-use-2025-01-24"`4748    - `"pdfs-2024-09-25"`4950    - `"token-counting-2024-11-01"`5152    - `"token-efficient-tools-2025-02-19"`5354    - `"output-128k-2025-02-19"`5556    - `"files-api-2025-04-14"`5758    - `"mcp-client-2025-04-04"`5960    - `"mcp-client-2025-11-20"`6162    - `"dev-full-thinking-2025-05-14"`6364    - `"interleaved-thinking-2025-05-14"`6566    - `"code-execution-2025-05-22"`6768    - `"extended-cache-ttl-2025-04-11"`6970    - `"context-1m-2025-08-07"`7172    - `"context-management-2025-06-27"`7374    - `"model-context-window-exceeded-2025-08-26"`7576    - `"skills-2025-10-02"`7778    - `"fast-mode-2026-02-01"`7980    - `"output-300k-2026-03-24"`8182    - `"user-profiles-2026-03-24"`8384    - `"user-profiles-2026-08-18"`8586    - `"user-profiles-2026-09-04"`8788    - `"advisor-tool-2026-03-01"`8990    - `"managed-agents-2026-04-01"`9192    - `"cache-diagnosis-2026-04-07"`9394    - `"dreaming-2026-04-21"`9596    - `"thinking-token-count-2026-05-13"`9798    - `"server-side-fallback-2026-06-01"`99100    - `"server-side-fallback-2026-07-01"`101102    - `"fallback-credit-2026-06-01"`103104    - `"fallback-credit-2026-07-01"`105106    - `"agent-memory-2026-07-22"`107108    - `"mid-conversation-tool-changes-2026-07-01"`109110    - `"compact-2026-01-12"`111112    - `"computer-use-2025-11-24"`113114    - `"mcp-tunnels-2026-06-22"`115116    - `"structured-outputs-2025-11-13"`117118    - `"task-budgets-2026-03-13"`119120    - `"thinking-display-updates-2026-08-18"`121122    - `"ce-user-management-2026-07-13"`123124    - `"mid-conversation-output-config-2026-07-01"`125126    - `"thinking-binding-controls-2026-08-01"`127128    - `"mid-conversation-system-clear-at-2026-08-21"`129130    - `"compact-2026-09-04"`131132- `"anthropic-workspace-id": optional string`133134## Returns135136- `data: array of BetaEnvironment`137138  List of environments.139140  - `type: "environment"`141142    The type of object (always 'environment')143144    default: environment145146  - `id: string`147148    Environment identifier (e.g., 'env_...')149150  - `archived_at: string or null`151152    RFC 3339 timestamp when environment was archived, or null if not archived153154  - `config: BetaCloudConfig or BetaSelfHostedConfig`155156    Environment configuration (either Anthropic Cloud or self-hosted)157158    - `BetaCloudConfig object`159160      `cloud` environment configuration.161162      - `type: "cloud"`163164        Environment type165166      - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`167168        Network configuration policy.169170        - `BetaUnrestrictedNetwork object`171172          Unrestricted network access.173174          - `type: "unrestricted"`175176            Network policy type177178        - `BetaLimitedNetwork object`179180          Limited network access.181182          - `type: "limited"`183184            Network policy type185186          - `allow_mcp_servers: boolean`187188            Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.189190          - `allow_package_managers: boolean`191192            Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.193194          - `allowed_hosts: array of string`195196            Specifies domains the container can reach.197198      - `packages: BetaPackages`199200        Package manager configuration.201202        - `type: optional "packages"`203204          Package configuration type205206          default: packages207208        - `apt: array of string`209210          Ubuntu/Debian packages to install211212        - `cargo: array of string`213214          Rust packages to install215216        - `gem: array of string`217218          Ruby packages to install219220        - `go: array of string`221222          Go packages to install223224        - `npm: array of string`225226          Node.js packages to install227228        - `pip: array of string`229230          Python packages to install231232    - `BetaSelfHostedConfig object`233234      Configuration for self-hosted environments.235236      - `type: "self_hosted"`237238        Environment type239240  - `created_at: string`241242    RFC 3339 timestamp when environment was created243244  - `description: string or null`245246    User-provided description for the environment; null when unset247248  - `metadata: map[string]`249250    User-provided metadata key-value pairs251252  - `name: string`253254    Human-readable name for the environment255256  - `updated_at: string`257258    RFC 3339 timestamp when environment was last updated259260  - `scope: optional "organization" or "account"`261262    The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.263264    - `"organization"`265266    - `"account"`267268- `next_page: string or null`269270  Token for fetching the next page of results. If `null`, there are no more results available. Pass this value to the `page` parameter in the next request.271272## Example273274```bash275curl https://api.anthropic.com/v1/environments \276    -H 'anthropic-version: 2023-06-01' \277    -H 'anthropic-beta: managed-agents-2026-04-01' \278    -H "X-Api-Key: $ANTHROPIC_API_KEY"279```280281### Response (200)282283```json284{285  "data": [286    {287      "id": "env_011CZkZ9X2dpNyB7HsEFoRfW",288      "archived_at": null,289      "config": {290        "networking": {291          "allow_mcp_servers": false,292          "allow_package_managers": true,293          "allowed_hosts": [294            "api.example.com"295          ],296          "type": "limited"297        },298        "packages": {299          "apt": [300            "string"301          ],302          "cargo": [303            "string"304          ],305          "gem": [306            "string"307          ],308          "go": [309            "string"310          ],311          "npm": [312            "string"313          ],314          "pip": [315            "pandas",316            "numpy"317          ],318          "type": "packages"319        },320        "type": "cloud"321      },322      "created_at": "2026-03-15T10:00:00Z",323      "description": "Python environment with data-analysis packages.",324      "metadata": {},325      "name": "python-data-analysis",326      "type": "environment",327      "updated_at": "2026-03-15T10:00:00Z",328      "scope": "organization"329    }330  ],331  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="332}333```334
Files main
Menu

Theme