v14

latestOpenAPI 3.0.32026-08-04377889.4 MB
projects

Edit an environment variable

Edit a specific environment variable for a given project by passing the environment variable identifier and either passing the project id or name in the URL.

patch/v9/projects/{idOrName}/env/{id}

Path parameters

idOrNamestring required

The unique project identifier or the project name

Example:prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA

The unique project identifier or the project name

idstring required

The unique environment variable identifier

Example:XMbOEya1gUUO1ir4

The unique environment variable identifier

Query parameters

teamIdstring
Example:team_1a2b3c4d5e6f7g8h9i0j1k2l

The Team identifier to perform the request on behalf of.

slugstring
Example:my-team-url-slug

The Team slug to perform the request on behalf of.

Request body

keystring

The name of the environment variable

targetstring[]

The target environment of the environment variable

gitBranchstring nullable

If defined, the git branch of the environment variable (must have target=preview)

type'system' | 'encrypted' | 'plain' | 'sensitive'

The type of environment variable

valuestring

The value of the environment variable

customEnvironmentIdsstring[]

The custom environments that the environment variable should be synced to

commentstring

A comment to add context on what this env var is for

Example request

{
  "key": "GITHUB_APP_ID",
  "target": [
    "preview"
  ],
  "gitBranch": "feature-1",
  "type": "plain",
  "value": "bkWIjbnxcvo78",
  "customEnvironmentIds": [
    "env_1234567890"
  ],
  "comment": "database connection string for production"
}

Response

type'encrypted' | 'plain' | 'secret' | 'sensitive' | 'system' required
valuestring required
edgeConfigIdstring nullable
edgeConfigTokenIdstring nullable
createdAtnumber
updatedAtnumber
idstring
keystring required
gitBranchstring
createdBystring nullable
updatedBystring nullable
sunsetSecretIdstring

This is used to identify variables that have been migrated from type secret to sensitive.

legacyValuestring

Legacy now-encryption ciphertext, present after migration swaps value/vsmValue

decryptedfalse | true
configurationIdstring nullable
visibility'config' | 'secret'

User-facing config/secret model. When set, authoritative for new code paths when the env-var-config-secret-ui flag is enabled. Legacy rows omit this field; legacy rows omit it and callers fall back to existing type behavior.

commentstring
customEnvironmentIdsstring[]