---
title: "Update a project variable"
method: PATCH
path: "/projects/{projectId}/variables/{projectVariableId}"
tags: ["Project Variables"]
---

# Update a project variable

`PATCH /projects/{projectId}/variables/{projectVariableId}`

Update a single user-defined project variable.
The `value` can be either a string or a JSON
object (default: string), as specified by the `is_json` boolean flag.
See the [Variables](https://docs.upsun.com/anchors/variables/set/project/create/)
section in our documentation for more information.

## Path parameters

- `projectId` string, required
- `projectVariableId` string, required

## Request body

- ProjectVariablePatch
  - `name` string — Name of the variable
  - `attributes` object — Arbitrary attributes attached to this resource
  - `value` string — Value of the variable
  - `is_json` boolean — The variable is a JSON string
  - `is_sensitive` boolean — The variable is sensitive
  - `visible_build` boolean — The variable is visible during build
  - `visible_runtime` boolean — The variable is visible at runtime
  - `application_scope` string[] — Applications that have access to this variable

## Response `default`

- AcceptedResponse
  - `status` string, required — The status text of the response
  - `code` integer, required — The status code of the response

---

[API](https://skmtc.net/upsun/apis/upsun-com-rest-api.md) · [All operations](https://skmtc.net/upsun/apis/upsun-com-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/upsun/upsun-com-rest-api/revisions/6cc88fde6435/schema)
