---
title: "Create a variable for a user"
method: POST
path: "/users/{selected_user}/pipelines_config/variables"
tags: ["Pipelines"]
deprecated: true
---

# Create a variable for a user

`POST /users/{selected_user}/pipelines_config/variables`

> **Deprecated.**

Create a user level variable.
This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).

## Path parameters

- `selected_user` 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 account 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)
