Skip to main content
PATCH
/
api
/
v2
/
environments
/
{id}
Patch an environment
curl --request PATCH \
  --url https://agp.eu.hcompany.ai/api/v2/environments/{id} \
  --header 'Authorization: Bearer <token>'
Partial update: only the fields you send change, everything else is preserved. Send a field as null to clear it, for example vault_id: null to unbind a vault. The merged result is validated like a full update, and id and kind are not patchable. This makes binding a vault to an existing environment a one-liner, with no need to resend the full spec. Returns the updated Environment object.

Path parameters

id
string
required
The environment’s id (e.g. wide-browser or myorg/wide-browser). Slash-containing identifiers are supported.

Request body

Any subset of the Browser spec’s fields except id and kind: start_url, headless, mode, vault_id, browser_profile_id, network.

Examples

Bind a vault, leaving the rest of the spec untouched:
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/environments/wide-browser \
  -H "Authorization: Bearer $HAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"vault_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"}'

Errors

StatusCause
403The environment is reserved (h/) and read-only.
404Environment not found or you don’t have access.
422The merged spec fails validation, for example an invalid mode.