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

# Create Variable

`POST /api/v1/variables/`

Create a new variable.

## Request body

- VariableCreate
  - `name` string, required — Name of the variable
  - `value` string, required — Encrypted value of the variable
  - `default_fields` string[], nullable, required
  - `type` string, nullable — Type of the variable
  - `created_at` string, date-time, nullable — Creation time of the variable
  - `updated_at` string, date-time, nullable — Creation time of the variable

## Response `201`

Successful Response

- VariableRead
  - `id` string, uuid, required
  - `name` string, nullable — Name of the variable
  - `type` string, nullable — Type of the variable
  - `value` string, nullable — Encrypted value of the variable
  - `default_fields` string[], nullable — Default fields for the variable

## Other responses

- `422` — Validation Error

## Changes

- **2025-10-16** `9bd3e81318d7` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/langflow-ai/apis/langflow/changes/api/v1/variables/post.md)

---

[API](https://skmtc.dev/langflow-ai/apis/langflow.md) · [All operations](https://skmtc.dev/langflow-ai/apis/langflow/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/langflow-ai/langflow/revisions/b0ee9ddb8d9f/schema)
