---
title: "Update a user-level variable which is created by current doer"
method: PUT
path: "/user/actions/variables/{variablename}"
tags: ["user"]
---

# Update a user-level variable which is created by current doer

`PUT /user/actions/variables/{variablename}`

## Path parameters

- `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 variable

## Other responses

- `204` — response when updating a 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)
