---
title: "Create a user-level variable"
method: POST
path: "/user/actions/variables/{variablename}"
tags: ["user"]
---

# Create a user-level variable

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

## Path parameters

- `variablename` string, required

## Request body

- CreateVariableOption — CreateVariableOption the option when creating variable
  - `description` string — Description of the variable to create
  - `value` string, required — Value of the variable to create

## Response `201`

successfully created the user-level variable

## Other responses

- `400` — APIError is error format response
- `409` — variable name already exists.

---

[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)
