Update Environment
Updates a non-global environment. Only provided fields are changed. PATCH /v1/environments/global returns 400 with a pointer to the nested resource endpoints (variables, files, skills, MCPs, warm hooks) — the Global env’s metadata cannot be edited directly. Source-backed personal environments cannot change repository_id, repository_set_id, or system_prompt, but may set personal_preferences, instructions appended after the inherited system prompt. Returns 409 when an automation still references the environment in a way that blocks the requested change.
Authorizations
API key authentication. Obtain your API key from the Replicas dashboard under Organization → Settings → API Keys. User-session JWTs are not accepted by /v1/replica endpoints.
Path Parameters
Environment UUID. The literal global is rejected with 400 — see endpoint description.
Body
Request body for updating an environment. Only provided fields are changed. repository_id and repository_set_id remain mutually exclusive when both are supplied.
Enable or disable mobile testing. Only valid on team environments; enabling requires a trial, Team, or Enterprise plan and otherwise returns PLAN_UPGRADE_REQUIRED.
Only settable on personal environments. Appended after the (inherited) system prompt.
Response
Environment updated
An environment — the config bundle workspaces are created from. Holds an optional repository binding plus the runtime variables, files, skills, MCPs, and warm hook applied to every workspace built from it. Every organization has a singleton Global environment (is_global: true) whose values are layered onto every other environment. Personal environments have user_id set and are visible only to their owner. Source-backed personal environments expose source-derived repository binding and system prompt values while keeping the source link in source_environment_id.