---
title: "Create Variable"
method: POST
path: "/api/variables/"
tags: ["Variables"]
---

# Create Variable

`POST /api/variables/`

## Headers

- `x-prefect-api-version` string

## Request body

- VariableCreate — Data used by the Prefect REST API to create a Variable.
  - `name` string, required — The name of the variable
  - `value` string, required — The value of the variable
  - `tags` string[] — A list of variable tags

## Response `201`

Successful Response

- Variable — A PrefectBaseModel with an auto-generated UUID ID value and created / updated timestamps, intended for compatibility with our standard ORM models. The ID, created, and updated fields are reset on copy() and not included in equality comparisons.
  - `id` string, uuid
  - `created` string, date-time
  - `updated` string, date-time
  - `name` string, required — The name of the variable
  - `value` string, required — The value of the variable
  - `tags` string[] — A list of variable tags

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/prefecthq/apis/untitled-api-2.md) · [All operations](https://skmtc.net/prefecthq/apis/untitled-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prefecthq/untitled-api-2/revisions/29ba6c4f8837/schema)
