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

# Update a variable

`PUT /api/variables/{id}`

Update an existing text or secret variable's key, value, secret flag, or description. File-type variables must be managed through the project UI upload workflow.

## Request body

- object
  - `key` string
  - `value` string
  - `isSecret` boolean
  - `description` string

## Response `200`

Variable updated

- Variable
  - `id` string, uuid
  - `projectId` string, uuid
  - `key` string
  - `type` 'variable' | 'secret' | 'file' — Variable type. File variables expose metadata in API responses; file contents are not returned.
  - `value` string — Plaintext for regular variables, redacted for secrets, and empty for file variables
  - `isSecret` boolean
  - `description` string, nullable
  - `fileName` string, nullable
  - `fileSize` integer, nullable
  - `mimeType` string, nullable
  - `createdAt` string, date-time
  - `updatedAt` string, date-time, nullable

## Other responses

- `401` — Authentication required or token invalid
- `404` — Resource not found

## Changes

> 4 revisions in range; 1 could not be searched.

- **2026-02-08** `78bbac89339b` — 6 warning
  - removed the optional property `fileName` from the response with the `200` status
  - removed the optional property `fileSize` from the response with the `200` status
  - removed the optional property `mimeType` from the response with the `200` status
  - removed the optional property `projectId` from the response with the `200` status
  - …2 more

[Change history](https://skmtc.dev/supercheck-io/apis/supercheck-api/changes/api/variables/:id/put.md)

---

[API](https://skmtc.dev/supercheck-io/apis/supercheck-api.md) · [All operations](https://skmtc.dev/supercheck-io/apis/supercheck-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/supercheck-io/supercheck-api/revisions/81782deccf0e/schema)
