Prefect Variables API

The Variables API from Prefect — 5 operation(s) for variables.

Operations 9

POST /api/accounts/{account_id}/workspaces/{workspace_id}/variables/ Create Variable #
GET /api/accounts/{account_id}/workspaces/{workspace_id}/variables/{id} Read Variable #
PATCH /api/accounts/{account_id}/workspaces/{workspace_id}/variables/{id} Update Variable #
DELETE /api/accounts/{account_id}/workspaces/{workspace_id}/variables/{id} Delete Variable #
GET /api/accounts/{account_id}/workspaces/{workspace_id}/variables/name/{name} Read Variable By Name #
PATCH /api/accounts/{account_id}/workspaces/{workspace_id}/variables/name/{name} Update Variable By Name #
DELETE /api/accounts/{account_id}/workspaces/{workspace_id}/variables/name/{name} Delete Variable By Name #
POST /api/accounts/{account_id}/workspaces/{workspace_id}/variables/filter Read Variables #
POST /api/accounts/{account_id}/workspaces/{workspace_id}/variables/count Count Variables #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/prefect-variables-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

prefect-variables-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Prefect Cloud Account Billing Variables API
  description: Prefect Cloud REST API documentation.
  version: 0.8.4
tags:
- name: Variables
paths:
  /api/accounts/{account_id}/workspaces/{workspace_id}/variables/:
    post:
      tags:
      - Variables
      summary: Create Variable
      description: '


        Required workspace scopes: `write_variables`'
      operationId: create_variable_api_accounts__account_id__workspaces__workspace_id__variables__post
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/accounts/{account_id}/workspaces/{workspace_id}/variables/{id}:
    get:
      tags:
      - Variables
      summary: Read Variable
      description: '


        Required workspace scopes: `see_variables`'
      operationId: read_variable_api_accounts__account_id__workspaces__workspace_id__variables__id__get
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Id
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Variables
      summary: Update Variable
      description: '


        Required workspace scopes: `write_variables`'
      operationId: update_variable_api_accounts__account_id__workspaces__workspace_id__variables__id__patch
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Id
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableUpdate'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Variables
      summary: Delete Variable
      description: '


        Required workspace scopes: `manage_variables`'
      operationId: delete_variable_api_accounts__account_id__workspaces__workspace_id__variables__id__delete
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Id
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/accounts/{account_id}/workspaces/{workspace_id}/variables/name/{name}:
    get:
      tags:
      - Variables
      summary: Read Variable By Name
      description: '


        Required workspace scopes: `see_variables`'
      operationId: read_variable_by_name_api_accounts__account_id__workspaces__workspace_id__variables_name__name__get
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
          title: Name
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Variables
      summary: Update Variable By Name
      description: '


        Required workspace scopes: `write_variables`'
      operationId: update_variable_by_name_api_accounts__account_id__workspaces__workspace_id__variables_name__name__patch
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
          title: Name
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableUpdate'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Variables
      summary: Delete Variable By Name
      description: '


        Required workspace scopes: `manage_variables`'
      operationId: delete_variable_by_name_api_accounts__account_id__workspaces__workspace_id__variables_name__name__delete
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
          title: Name
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/accounts/{account_id}/workspaces/{workspace_id}/variables/filter:
    post:
      tags:
      - Variables
      summary: Read Variables
      description: '


        Required workspace scopes: `see_variables`'
      operationId: read_variables_api_accounts__account_id__workspaces__workspace_id__variables_filter_post
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Body_read_variables_api_accounts__account_id__workspaces__workspace_id__variables_filter_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Variable'
                title: Response Read Variables Api Accounts  Account Id  Workspaces  Workspace Id  Variables Filter Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/accounts/{account_id}/workspaces/{workspace_id}/variables/count:
    post:
      tags:
      - Variables
      summary: Count Variables
      description: '


        Required workspace scopes: `see_variables`'
      operationId: count_variables_api_accounts__account_id__workspaces__workspace_id__variables_count_post
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Body_count_variables_api_accounts__account_id__workspaces__workspace_id__variables_count_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: integer
                title: Response Count Variables Api Accounts  Account Id  Workspaces  Workspace Id  Variables Count Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_read_variables_api_accounts__account_id__workspaces__workspace_id__variables_filter_post:
      properties:
        offset:
          type: integer
          minimum: 0.0
          title: Offset
          default: 0
        variables:
          anyOf:
          - $ref: '#/components/schemas/VariableFilter'
          - type: 'null'
        sort:
          $ref: '#/components/schemas/VariableSort'
          default: NAME_ASC
        limit:
          type: integer
          title: Limit
          description: Defaults to PREFECT_ORION_API_DEFAULT_LIMIT if not provided.
      type: object
      title: Body_read_variables_api_accounts__account_id__workspaces__workspace_id__variables_filter_post
    Body_count_variables_api_accounts__account_id__workspaces__workspace_id__variables_count_post:
      properties:
        variables:
          anyOf:
          - $ref: '#/components/schemas/VariableFilter'
          - type: 'null'
      type: object
      title: Body_count_variables_api_accounts__account_id__workspaces__workspace_id__variables_count_post
    prefect_cloud__orion__schemas__filters__Operator:
      type: string
      enum:
      - and_
      - or_
      title: Operator
      description: Operators for combining filter criteria.
    VariableCreate:
      properties:
        name:
          type: string
          maxLength: 255
          title: Name
          description: The name of the variable
          examples:
          - my_variable
        value:
          anyOf:
          - type: string
          - type: integer
          - type: number
          - type: boolean
          - additionalProperties: true
            type: object
          - items: {}
            type: array
          - type: 'null'
          title: Value
          description: The value of the variable
          examples:
          - my-value
        tags:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Tags
          description: A list of variable tags
          examples:
          - - tag-1
            - tag-2
      additionalProperties: false
      type: object
      required:
      - name
      - value
      title: VariableCreate
      description: Data used by the Orion API to create a Variable.
    VariableSort:
      type: string
      enum:
      - CREATED_DESC
      - UPDATED_DESC
      - NAME_DESC
      - NAME_ASC
      title: VariableSort
      description: Defines variables sorting options.
    VariableFilterName:
      properties:
        any_:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Any
          description: A list of variables names to include
        like_:
          anyOf:
          - type: string
          - type: 'null'
          title: Like
          description: A string to match variable names against. This can include SQL wildcard characters like `%` and `_`.
          examples:
          - my_variable_%
      additionalProperties: false
      type: object
      title: VariableFilterName
      description: Filter by `Variable.name`.
    VariableFilter:
      properties:
        operator:
          $ref: '#/components/schemas/prefect_cloud__orion__schemas__filters__Operator'
          description: Operator for combining filter criteria. Defaults to 'and_'.
          default: and_
        id:
          anyOf:
          - $ref: '#/components/schemas/VariableFilterId'
          - type: 'null'
          description: Filter criteria for `Variable.id`
        name:
          anyOf:
          - $ref: '#/components/schemas/VariableFilterName'
          - type: 'null'
          description: Filter criteria for `Variable.name`
        value:
          anyOf:
          - $ref: '#/components/schemas/VariableFilterValue'
          - type: 'null'
          description: Filter criteria for `Variable.value`
        tags:
          anyOf:
          - $ref: '#/components/schemas/VariableFilterTags'
          - type: 'null'
          description: Filter criteria for `Variable.tags`
      additionalProperties: false
      type: object
      title: VariableFilter
      description: Filter variables. Only variables matching all criteria will be returned
    VariableFilterTags:
      properties:
        operator:
          $ref: '#/components/schemas/prefect_cloud__orion__schemas__filters__Operator'
          description: Operator for combining filter criteria. Defaults to 'and_'.
          default: and_
        all_:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: All
          description: A list of tags. Variables will be returned only if their tags are a superset of the list
          examples:
          - - tag-1
            - tag-2
        is_null_:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Null
          description: If true, only include Variables without tags
      additionalProperties: false
      type: object
      title: VariableFilterTags
      description: Filter by `Variable.tags`.
    VariableFilterId:
      properties:
        any_:
          anyOf:
          - items:
              type: string
              format: uuid
            type: array
          - type: 'null'
          title: Any
          description: A list of variable ids to include
      additionalProperties: false
      type: object
      title: VariableFilterId
      description: Filter by `Variable.id`.
    VariableFilterValue:
      properties:
        any_:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Any
          description: A list of variables value to include
        like_:
          anyOf:
          - type: string
          - type: 'null'
          title: Like
          description: A string to match variable value against. This can include SQL wildcard characters like `%` and `_`.
          examples:
          - my-value-%
      additionalProperties: false
      type: object
      title: VariableFilterValue
      description: Filter by `Variable.value`.
    Variable:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created
        updated:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updated
        name:
          type: string
          maxLength: 255
          title: Name
          description: The name of the variable
          examples:
          - my_variable
        value:
          anyOf:
          - type: string
          - type: integer
          - type: number
          - type: boolean
          - additionalProperties: true
            type: object
          - items: {}
            type: array
          - type: 'null'
          title: Value
          description: The value of the variable
          examples:
          - my-value
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: A list of variable tags
          examples:
          - - tag-1
            - tag-2
      type: object
      required:
      - name
      - value
      title: Variable
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    VariableUpdate:
      properties:
        name:
          anyOf:
          - type: string
            maxLength: 255
          - type: 'null'
          title: Name
          description: The name of the variable
          examples:
          - my_variable
        value:
          anyOf:
          - type: string
          - type: integer
          - type: number
          - type: boolean
          - additionalProperties: true
            type: object
          - items: {}
            type: array
          - type: 'null'
          title: Value
          description: The value of the variable
          examples:
          - my-value
        tags:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Tags
          description: A list of variable tags
          examples:
          - - tag-1
            - tag-2
      additionalProperties: false
      type: object
      title: VariableUpdate
      description: Data used by the Orion API to update a Variable.