---
title: "Read Variables"
method: POST
path: "/api/variables/filter"
tags: ["Variables"]
---

# Read Variables

`POST /api/variables/filter`

## Request

- The document declares no server URL.
- Auth: none declared

## Headers

- `x-prefect-api-version` string

## Request body

- BodyReadVariablesVariablesFilterPost
  - `offset` integer
  - `variables` VariableFilter: Filter variables. Only variables matching all criteria will be returned
    - `operator` 'and_' | 'or_': Operators for combining filter criteria.
    - `id` VariableFilterId: Filter by `Variable.id`.
      - `any_` string[]: A list of variable ids to include
    - `name` VariableFilterName: Filter by `Variable.name`.
      - `any_` string[]: A list of variables names to include
      - `like_` string: A string to match variable names against. This can include SQL wildcard characters like `%` and `_`.
    - `value` VariableFilterValue: Filter by `Variable.value`.
      - `any_` string[]: A list of variables value to include
      - `like_` string: A string to match variable value against. This can include SQL wildcard characters like `%` and `_`.
    - `tags` VariableFilterTags: Filter by `Variable.tags`.
      - `operator` 'and_' | 'or_': Operators for combining filter criteria.
      - `all_` string[]: A list of tags. Variables will be returned only if their tags are a superset of the list
      - `is_null_` boolean: If true, only include Variables without tags
  - `sort` 'CREATED_DESC' | 'UPDATED_DESC' | 'NAME_DESC' | 'NAME_ASC': Defines variables sorting options.
  - `limit` integer: Defaults to PREFECT_API_DEFAULT_LIMIT if not provided.

## Response `200`

Successful Response

- Variable[]
  - `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.dev/prefecthq/apis/prefect-unreleased-api.md) - [All operations](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/llms.txt) - [OpenAPI document](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/revisions/29ba6c4f8837?raw)
