---
title: "Create a variable for a workspace"
method: POST
path: "/workspaces/{workspace}/pipelines-config/variables"
tags: ["Pipelines"]
---

# Create a variable for a workspace

`POST /workspaces/{workspace}/pipelines-config/variables`

Create a workspace level variable.

## Path parameters

- `workspace` string, required

## Request body

- PipelineVariable — A Pipelines variable.
  - `type` string, required
  - `uuid` string — The UUID identifying the variable.
  - `key` string — The unique name of the variable.
  - `value` string — The value of the variable. If the variable is secured, this will be empty.
  - `secured` boolean — If true, this variable will be treated as secured. The value will never be exposed in the logs or the REST API.

## Response `201`

The created variable.

- PipelineVariable — A Pipelines variable.
  - `type` string, required
  - `uuid` string — The UUID identifying the variable.
  - `key` string — The unique name of the variable.
  - `value` string — The value of the variable. If the variable is secured, this will be empty.
  - `secured` boolean — If true, this variable will be treated as secured. The value will never be exposed in the logs or the REST API.

## Other responses

- `404` — The workspace does not exist.
- `409` — A variable with the provided key already exists.

---

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