Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

Update an environment variable's value

PATCH/v1/environment-variables/{envVarId}Update an environment variable's value

⚠️ Experimental endpoint: this API is in active development and may change at any time without notice. ⚠️

Replaces the value of an existing environment variable. Only the value is mutable — the project, environment, key, and branch are fixed at create-time.

Parameters

envVarIdstringpathrequired

pattern ^(envvar_)?([cC][^\s-]{8,}|[a-z0-9]+)$

Request body

application/json
object
valuestringrequired

minLength 1

Example request
{
  "value": "string"
}

Responses

200Variable updated.application/json
object
dataobjectrequired
Show child attributes
branchIdnull | stringrequired
classstringrequired

one of "production", "preview"

createdAtstring · date-timerequired
idstringrequired
isManagedBySystembooleanrequired
keystringrequired
projectIdstringrequired
typestringrequired

const "environment-variable"

updatedAtstring · date-timerequired
urlstring · urirequired
valueKidstringrequired
Example response
{
  "data": {
    "branchId": "string",
    "class": "preview",
    "createdAt": "2026-06-09T00:00:00Z",
    "id": "string",
    "isManagedBySystem": true,
    "key": "string",
    "projectId": "string",
    "type": "environment-variable",
    "updatedAt": "2026-06-09T00:00:00Z",
    "url": "https://example.com",
    "valueKid": "string"
  }
}
401Missing or invalid authorization token.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
404Variable not found, or token does not have access to it.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
422Invalid request.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
500Internal error while processing the encrypted variable (e.g., a master-key rotation or deploy issue prevents the project's wrapped DEK from being decrypted). Not a client-fixable condition.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
Documentation menu