---
title: "putEnvironmentVars"
method: PUT
path: "/platform/environments/{id}/vars"
tags: ["Platform"]
---

# putEnvironmentVars

`PUT /platform/environments/{id}/vars`

## Request

- Base URL: `https://api.imprezahost.com/v1`
- URL: `https://api.imprezahost.com/v1/platform/environments/{id}/vars`
- Auth: API key in header `X-API-Key` and API key in header `X-API-Secret`

Deploy scope. Replace the environment's whole variable group; identical contract to the project group (whole-group replacement, write-only sealed secrets, reserved names refused, empty group deleted, effective on the next deploy only). With base_revision, a group written since that revision is refused with 409 REVISION_CONFLICT and nothing is written. The exact value __IMPREZA_KEEP__ keeps the stored value of that name, in the map it is stored in; a marker with nothing to keep fails with 409 KEEP_TARGET_MISSING. Limits apply to the stored values, kept ones included.

## Path parameters

- `id` string, required

## Request body

- object
  - `vars` object
  - `secrets` object
  - `base_revision` integer: The revision a read returned; refuses the write if the group changed since

## Response `200`

The group after the write

## Other responses

- `400`: Invalid input (reserved name
- `403`: Required scope missing
- `404`: Resource or current ownership unavailable
- `409`: REVISION_CONFLICT (the group changed since base_revision), KEEP_TARGET_MISSING (the keep marker names no stored value), or another project operation is active
- `503`: Storage unavailable; read before retrying

---

[API](https://skmtc.dev/imprezahost/apis/impreza-host-public-api.md) · [All operations](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/revisions/db86511f604f?raw)
