from line 1
1---
2title: Update Environment
3url: https://platform.claude.com/docs/en/api/beta/environments/update
4---
1# Update Environment
52
6## Update Environment
3**POST** `/v1/environments/{environment_id}`
74
8**post** `/v1/environments/{environment_id}`
9
105Update an existing environment's configuration.
116
12### Path Parameters
7## Path parameters
138
149- `environment_id: string`
1510
16### Header Parameters
11## Headers
1712
1813- `"anthropic-beta": optional array of AnthropicBeta`
1914
from line 86
9186
9287 - `"mid-conversation-tool-changes-2026-07-01"`
9388
94### Body Parameters
89## Body parameters
9590
9691- `config: optional BetaCloudConfigParams or BetaSelfHostedConfigParams or null`
9792
9893 Updated environment configuration
9994
100 - `BetaCloudConfigParams object { type, networking, packages }`
95 - `BetaCloudConfigParams object`
10196
10297 Request params for `cloud` environment configuration.
10398
from line 103
108103
109104 Environment type
110105
111 - `"cloud"`
112
113106 - `networking: optional BetaUnrestrictedNetwork or BetaLimitedNetworkParams or null`
114107
115108 Network configuration policy. Omit on update to preserve the existing value.
116109
117 - `BetaUnrestrictedNetwork object { type }`
110 - `BetaUnrestrictedNetwork object`
118111
119112 Unrestricted network access.
120113
from line 115
122115
123116 Network policy type
124117
125 - `"unrestricted"`
118 - `BetaLimitedNetworkParams object`
126119
127 - `BetaLimitedNetworkParams object { type, allow_mcp_servers, allow_package_managers, allowed_hosts }`
128
129120 Limited network request params.
130121
131122 Fields default to null; on update, omitted fields preserve the
from line 126
135126
136127 Network policy type
137128
138 - `"limited"`
139
140129 - `allow_mcp_servers: optional boolean or null`
141130
142131 Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.
from line 172
183172
184173 Package configuration type
185174
186 - `"packages"`
175 default: packages
187176
188 - `BetaSelfHostedConfigParams object { type }`
177 - `BetaSelfHostedConfigParams object`
189178
190179 Request params for `self_hosted` environment configuration.
191180
from line 182
193182
194183 Environment type
195184
196 - `"self_hosted"`
197
198185- `description: optional string or null`
199186
200187 Updated description of the environment. Omit to preserve; null clears to null; an empty string is stored as an empty string.
201188
189 maxLength: 1024
190
202191- `metadata: optional map[string]`
203192
204193 User-provided metadata key-value pairs. Set a value to null or empty string to delete the key.
from line 196
207196
208197 Updated name for the environment
209198
199 maxLength: 256, minLength: 1
200
210201- `scope: optional "organization" or "account" or null`
211202
212203 The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only.
from line 206
215206
216207 - `"account"`
217208
218### Returns
209## Returns
219210
220- `BetaEnvironment object { id, archived_at, config, 7 more }`
211- `BetaEnvironment object`
221212
222213 Unified Environment resource for both cloud and self-hosted environments.
223214
from line 224
233224
234225 Environment configuration (either Anthropic Cloud or self-hosted)
235226
236 - `BetaCloudConfig object { networking, packages, type }`
227 - `BetaCloudConfig object`
237228
238229 `cloud` environment configuration.
239230
from line 232
241232
242233 Network configuration policy.
243234
244 - `BetaUnrestrictedNetwork object { type }`
235 - `BetaUnrestrictedNetwork object`
245236
246237 Unrestricted network access.
247238
from line 240
249240
250241 Network policy type
251242
252 - `"unrestricted"`
243 - `BetaLimitedNetwork object`
253244
254 - `BetaLimitedNetwork object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
255
256245 Limited network access.
257246
258247 - `allow_mcp_servers: boolean`
from line 260
271260
272261 Network policy type
273262
274 - `"limited"`
275
276263 - `packages: BetaPackages`
277264
278265 Package manager configuration.
from line 292
305292
306293 Package configuration type
307294
308 - `"packages"`
295 default: packages
309296
310297 - `type: "cloud"`
311298
312299 Environment type
313300
314 - `"cloud"`
301 - `BetaSelfHostedConfig object`
315302
316 - `BetaSelfHostedConfig object { type }`
317
318303 Configuration for self-hosted environments.
319304
320305 - `type: "self_hosted"`
from line 306
321306
322307 Environment type
323308
324 - `"self_hosted"`
325
326309 - `created_at: string`
327310
328311 RFC 3339 timestamp when environment was created
from line 326
343326
344327 The type of object (always 'environment')
345328
346 - `"environment"`
329 default: environment
347330
348331 - `updated_at: string`
349332
from line 340
357340
358341 - `"account"`
359342
360### Example
343## Example
361344
362```http
345```bash
363346curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID \
364347 -H 'Content-Type: application/json' \
365348 -H 'anthropic-version: 2023-06-01' \
from line 353
370353 }'
371354```
372355
373#### Response
356### Response (200)
374357
375358```json
376359{
No line in this hunk matches that.