Skip to main content
PUT
/
api
/
v2
/
environments
/
{id}
Update an environment
curl --request PUT \
  --url https://agp.eu.hcompany.ai/api/v2/environments/{id} \
  --header 'Authorization: Bearer <token>'
Updates an existing environment. This is a full replacement of the Browser spec. The id must match the URL identifier: renames are not supported. 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

A full replacement of the Browser spec. The id in the body must equal the URL identifier. Because this replaces the resource, resend a field’s current value to keep it unchanged.

Examples

curl -X PUT https://agp.eu.hcompany.ai/api/v2/environments/wide-browser \
  -H "Authorization: Bearer $H_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "wide-browser",
    "kind": "web",
    "headless": true,
    "width": 1920,
    "height": 1080,
    "start_url": "https://example.com",
    "mode": "multimodal"
  }'
Response
{
  "id": "wide-browser",
  "kind": "web",
  "headless": true,
  "width": 1920,
  "height": 1080,
  "start_url": "https://example.com",
  "mode": "multimodal"
}

Errors

StatusCause
400The id in the body does not match the URL identifier (renames are not supported).
403The environment is reserved (h/) and you are not an H employee.
404Environment not found or you don’t have access.
422Body fails validation; common cases: invalid id shape, missing required field.