---
title: "Create or update a variable"
method: POST
path: "/projects/{id}/variables"
tags: ["Variables"]
---

# Create or update a variable

`POST /projects/{id}/variables`

## Request

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

Creates 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

## Request body

- CreateVariableRequest
  - `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.
  - `name` string, required: Project variable name. Function runtime names such as AWS_REGION are reserved and return 400; see the environment variables guide for the full list.
  - `value` string, required

## Response `201`

Variable created

- 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`: Bad request
- `503`: Private variable membership writes are disabled during rollout

## Changes

- **2026-10-07** `23e7875e7c4c`: 2 info
  - the endpoint scheme security `ProjectAccessToken` was added to the API
  - added the optional property `frontend_shared` to the response with the `201` status
- **2026-09-19** `3a6f365f3f35`: 6 breaking, 15 info
  - added the new path request parameter `id`
  - added the new required request property `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 `201`
  - the response's body type changed from `object` to no type for status `400`
  - removed the required property `created_at` from the response with the `201` status
  - …13 more
- **2026-07-27** `bb52784e098a`: 1 info
  - added the optional property `code` to the response with the `400` status

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/variables/post.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)
