---
title: "Update a variable"
method: PUT
path: "/projects/{id}/variables/{name}"
tags: ["Variables"]
---

# Update a variable

`PUT /projects/{id}/variables/{name}`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/variables/{name}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Updates a project-level environment variable and triggers asynchronous propagation
to deployed functions and frontends in the project's configured regions.

## Path parameters

- `id` string, uuid, required
- `name` string, required

## Request body

- UpdateVariableRequest
  - `shared` boolean: Include this name in the project's shared function variables. Omission preserves existing membership; new variables default to true for legacy clients. Send false explicitly to create a non-shared variable.
  - `value` string, required

## Response `200`

Variable updated

- Variable
  - `shared` boolean: Include this name in the project's shared function variables. Omission preserves existing membership; new variables default to true for legacy clients. Send false explicitly to create a non-shared variable.
  - `frontend_shared` boolean: Whether this name is in the project's shared frontend-variable list.
  - `id` string, uuid, required
  - `project_id` string, uuid, required
  - `name` string, required
  - `value` string, required
  - `status` 'provisioning' | 'active' | 'failed': Latest project variable propagation status, when a sync has run.
  - `current_sync_id` string, uuid: Identifier of the latest variable propagation sync.
  - `provisioning_started_at` string, date-time: Timestamp when the current variable propagation phase started.
  - `deploy_source` 'git' | 'cli' | 'web' | 'api' | 'system' | 'unknown': What initiated the latest variable propagation sync, when one has run.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Invalid or reserved variable name
- `404`: Variable not found
- `503`: Private variable membership writes are disabled during rollout

## Changes

- **2026-10-07** `23e7875e7c4c`: 3 info
  - the endpoint scheme security `ProjectAccessToken` was added to the API
  - added the non-success response with the status `400`
  - added the optional property `frontend_shared` to the response with the `200` status
- **2026-09-19** `3a6f365f3f35`: 6 breaking, 15 info
  - added the new path request parameter `id`
  - added the new path request parameter `name`
  - added the new required request property `value`
  - the request's body type changed from no type to `object`
  - …17 more
- **2026-08-27** `bb44e98aba2e`: 10 breaking, 7 warning
  - the request's body type changed from `object` to no type
  - the response's body type changed from `object` to no type for status `200`
  - the response's body type changed from `object` to no type for status `404`
  - removed the required property `created_at` from the response with the `200` status
  - …13 more
- **2026-07-27** `bb52784e098a`: 1 info
  - added the optional property `code` to the response with the `404` status

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/variables/:name/put.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
