> For the complete documentation index, see [llms.txt](https://docs.flowiseai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowiseai.com/api-reference/variables.md).

# Variables

## Create a new variable

> Create a new variable

```json
{"tags":[{"name":"variables"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Variable":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the variable"},"name":{"type":"string","description":"Name of the variable"},"value":{"type":"string","description":"Value of the variable","nullable":true},"type":{"type":"string","description":"Type of the variable (e.g., string, number)"},"createdDate":{"type":"string","format":"date-time","description":"Date and time when the variable was created"},"updatedDate":{"type":"string","format":"date-time","description":"Date and time when the variable was last updated"}}}}},"paths":{"/variables":{"post":{"tags":["variables"],"operationId":"createVariable","summary":"Create a new variable","description":"Create a new variable","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Variable"}}},"required":true},"responses":{"200":{"description":"Variable created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Variable"}}}},"400":{"description":"Invalid request body"},"422":{"description":"Validation error"},"500":{"description":"Internal server error"}}}}}}
```

## List all variables

> Retrieve a list of all variables

```json
{"tags":[{"name":"variables"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Variable":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the variable"},"name":{"type":"string","description":"Name of the variable"},"value":{"type":"string","description":"Value of the variable","nullable":true},"type":{"type":"string","description":"Type of the variable (e.g., string, number)"},"createdDate":{"type":"string","format":"date-time","description":"Date and time when the variable was created"},"updatedDate":{"type":"string","format":"date-time","description":"Date and time when the variable was last updated"}}}}},"paths":{"/variables":{"get":{"tags":["variables"],"summary":"List all variables","description":"Retrieve a list of all variables","operationId":"getAllVariables","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Variable"}}}}},"500":{"description":"Internal server error"}}}}}}
```

## Update a variable by ID

> Update a specific variable by ID

```json
{"tags":[{"name":"variables"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Variable":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the variable"},"name":{"type":"string","description":"Name of the variable"},"value":{"type":"string","description":"Value of the variable","nullable":true},"type":{"type":"string","description":"Type of the variable (e.g., string, number)"},"createdDate":{"type":"string","format":"date-time","description":"Date and time when the variable was created"},"updatedDate":{"type":"string","format":"date-time","description":"Date and time when the variable was last updated"}}}}},"paths":{"/variables/{id}":{"put":{"tags":["variables"],"summary":"Update a variable by ID","description":"Update a specific variable by ID","operationId":"updateVariable","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Variable ID"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Variable"}}},"required":true},"responses":{"200":{"description":"Variable updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Variable"}}}},"400":{"description":"Invalid ID or request body provided"},"404":{"description":"Variable not found"},"500":{"description":"Internal server error"}}}}}}
```

## Delete a variable by ID

> Delete a specific variable by ID

```json
{"tags":[{"name":"variables"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/variables/{id}":{"delete":{"tags":["variables"],"summary":"Delete a variable by ID","description":"Delete a specific variable by ID","operationId":"deleteVariable","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Variable ID"}],"responses":{"200":{"description":"Variable deleted successfully"},"400":{"description":"Invalid ID provided"},"404":{"description":"Variable not found"},"500":{"description":"Internal server error"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flowiseai.com/api-reference/variables.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
