---
title: "Create a Variable"
method: POST
path: "/streaming/v2/variables"
tags: ["variable"]
---

# Create a Variable

`POST /streaming/v2/variables`

Creates a new variable. Duplicate variable names are not allowed.

## Request body

- NewVariable
  - `name` string, required — The unique name of the variable.
  - `description` string — Optional description of the variable.
  - `type` 'number' | 'bool' | 'string', required — The data type of the variable.

## Response `201`

Variable created

- Variable
  - `id` string, uuid, required
  - `name` string, required
  - `description` string
  - `type` 'number' | 'bool' | 'string', required
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `default` — Unexpected error

---

[API](https://skmtc.dev/blockdaemon/apis/staking-api.md) · [All operations](https://skmtc.dev/blockdaemon/apis/staking-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/blockdaemon/staking-api/revisions/f94e296a08a3/schema)
