Skip to main content
POST
/
api
/
variables
Create Variable
curl --request POST \
  --url https://api.example.com/api/variables/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "value": "my-value",
  "tags": [
    "<string>"
  ]
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created": "2023-11-07T05:31:56Z",
  "updated": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "value": "my-value",
  "tags": [
    "<string>"
  ]
}

Headers

x-prefect-api-version
string

Body

application/json

Data used by the Prefect REST API to create a Variable.

name
string
required

The name of the variable

Maximum string length: 255
value
required

The value of the variable

Example:

"my-value"

tags
string[]

A list of variable tags

Response

Successful Response

id
string<uuid>
required
created
string<date-time> | null
required
updated
string<date-time> | null
required
name
string
required

The name of the variable

Maximum string length: 255
value
required

The value of the variable

Example:

"my-value"

tags
string[]

A list of variable tags