---
title: "create variable"
method: POST
path: "/w/{workspace}/variables/create"
tags: ["variable"]
---

# create variable

`POST /w/{workspace}/variables/create`

## Path parameters

- `workspace` string, required

## Query parameters

- `already_encrypted` boolean

## Request body

- CreateVariable
  - `path` string, required — The path to the variable
  - `value` string, required — The value of the variable
  - `is_secret` boolean, required — Whether the variable is a secret
  - `description` string, required — The description of the variable
  - `account` integer — The account identifier
  - `is_oauth` boolean — Whether the variable is an OAuth variable
  - `expires_at` string, date-time — The expiration date of the variable
  - `labels` string[]
  - `ws_specific` boolean

## Response `201`

variable created

---

[API](https://skmtc.net/windmill/apis/windmill-api.md) · [All operations](https://skmtc.net/windmill/apis/windmill-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/windmill/windmill-api/versions/155a35b3caff/schema)
