Update Environment Variables

Updates multiple environment variables for a given project. Only the value of each environment variable can be updated.

PATCH /projects/{projectId}/env-vars
import { v0 } from 'v0-sdk'

const result = await v0.projects.updateEnvVars({
  projectId: 'project_abc123',
  environmentVariables: [
    {
      id: 'env_def456',
      value: 'new_value_123'
    },
    {
      id: 'env_ghi789',
      value: 'updated_secret_key'
    }
  ]
})

console.log(result)

Parameters

Path Parameters

projectId string Required

The unique identifier of the project whose environment variables should be updated.


Query Parameters

decrypted enum

Whether to return decrypted values. Defaults to false (encrypted).

Possible values:

  • true
  • false

Request Body

environmentVariables object[] Required

An array of environment variables to update with id and value fields.

Array items:

id string Required

The unique identifier of the environment variable to update.


value string Required

The new value of the environment variable.


Response

Response Body

object string Required


data any[] Required

Array items: string