v1

latestSwagger 2.02026-07-13180103150.2 KB
environmentVariables

Updates or creates a new value for an existing environment variable.

patch/accounts/{account_id}/env/{key}

Path parameters

account_idstring required

Scope response to account_id

keystring required

The existing environment variable key name (case-sensitive)

Query parameters

site_idstring

If provided, update an environment variable set on this site

Request body

context'all' | 'dev' | 'dev-server' | 'branch-deploy' | 'deploy-preview' | 'production' | 'branch'

The deploy context in which this value will be used. dev refers to local development when running netlify dev. branch must be provided with a value in context_parameter.

context_parameterstring

An additional parameter for custom branches. Currently, this is used for providing a branch name when context=branch.

valuestring

The environment variable's unencrypted value

Response

Created (success)

keystring

The environment variable key, like ALGOLIA_ID (case-sensitive)

scopesstring[]

The scopes that this environment variable is set to

is_secretboolean

Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret.

updated_atstring date-time

The timestamp of when the value was last updated