Projects

Update an environment variable

Changed on
put/projects/{project_id}/env-vars/{var_id}

Request

  • Base URL
    /api (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    HTTP bearer

Path parameters

project_idinteger required

Project ID or slug

var_idinteger required

Environment variable ID

Request body

environment_idsinteger[] required
include_in_previewboolean
is_secretboolean nullable

Optional secret-flag transition.

  • Some(true) promotes a regular var to a secret.
  • Some(false) is rejected if the row is already secret (one-way flag).
  • None (omitted) leaves the flag unchanged.
keystring required
valuestring nullable

New plaintext value. None (omitted) keeps the existing ciphertext, which is the only way to edit a secret env var without re-typing its value (e.g. changing which environments it applies to).

Response

Environment variables updated successfully

created_atstring date-time required
idinteger required
include_in_previewboolean required

Include this environment variable in preview environments

is_secretboolean required

Whether the stored value is write-only. Marked secrets always have value: None in API responses and cannot be revealed.

keystring required
updated_atstring date-time required
valuestring nullable

Plaintext for regular variables in create/update responses, or "***" in list responses. Always None for marked secrets. Only regular variables can be read through the audited per-variable reveal endpoint.

Changes

    • breaking

      the created_at response's property type changed from integer to string, and format from int64 to date-time for status

    • breaking

      the updated_at response's property type changed from integer to string, and format from int64 to date-time for status

    • info

      the endpoint scheme security bearer_auth was added to the API