---
title: "Update a repo-level variable"
method: PUT
path: "/repos/{owner}/{repo}/actions/variables/{variablename}"
tags: ["repository"]
---

# Update a repo-level variable

`PUT /repos/{owner}/{repo}/actions/variables/{variablename}`

## Path parameters

- `owner` string, required
- `repo` string, required
- `variablename` string, required

## Request body

- UpdateVariableOption — UpdateVariableOption the option when updating variable
  - `description` string — Description of the variable to update
  - `name` string — New name for the variable. If the field is empty, the variable name won't be updated.
  - `value` string, required — Value of the variable to update

## Response `201`

response when updating a repo-level variable

## Other responses

- `204` — response when updating a repo-level variable
- `400` — APIError is error format response
- `404` — APINotFound is a not found empty response

---

[API](https://skmtc.net/gitea/apis/gitea-api.md) · [All operations](https://skmtc.net/gitea/apis/gitea-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitea/gitea-api/revisions/350de506cefa/schema)
