OpenAPI Specification
openapi: 3.1.0
info:
title: Prefect Cloud Account Billing Flows API
description: Prefect Cloud REST API documentation.
version: 0.8.4
tags:
- name: Flows
description: Interact with a Workspace's Flows.
externalDocs:
description: Write and run flows
url: https://docs.prefect.io/v3/develop/write-flows
paths:
/api/accounts/{account_id}/workspaces/{workspace_id}/flows/:
post:
tags:
- Flows
summary: Create Flow
description: 'Gracefully creates a new flow from the provided schema. If a flow with the
same name already exists, the existing flow is returned.
Required workspace scopes: `run_flows`'
operationId: create_flow_api_accounts__account_id__workspaces__workspace_id__flows__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/FlowCreate'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Flow'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/flows/{id}:
patch:
tags:
- Flows
summary: Update Flow
description: 'Updates a flow.
Required workspace scopes: `run_flows`'
operationId: update_flow_api_accounts__account_id__workspaces__workspace_id__flows__id__patch
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: id
in: path
required: true
schema:
type: string
format: uuid
description: The flow id
title: Id
description: The flow id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account 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/FlowUpdate'
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
get:
tags:
- Flows
summary: Read Flow
description: 'Get a flow by id.
Required workspace scopes: `see_flows`'
operationId: read_flow_api_accounts__account_id__workspaces__workspace_id__flows__id__get
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: id
in: path
required: true
schema:
type: string
format: uuid
description: The flow id
title: Id
description: The flow id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account 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/Flow'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Flows
summary: Delete Flow
description: 'Delete a flow by id.
Required workspace scopes: `manage_flows`'
operationId: delete_flow_api_accounts__account_id__workspaces__workspace_id__flows__id__delete
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: id
in: path
required: true
schema:
type: string
format: uuid
description: The flow id
title: Id
description: The flow 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}/flows/count:
post:
tags:
- Flows
summary: Count Flows
description: 'Count flows.
Required workspace scopes: `see_flows`'
operationId: count_flows_api_accounts__account_id__workspaces__workspace_id__flows_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_flows_api_accounts__account_id__workspaces__workspace_id__flows_count_post'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: integer
title: Response Count Flows Api Accounts Account Id Workspaces Workspace Id Flows Count Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/flows/name/{name}:
get:
tags:
- Flows
summary: Read Flow By Name
description: 'Get a flow by name.
Required workspace scopes: `see_flows`'
operationId: read_flow_by_name_api_accounts__account_id__workspaces__workspace_id__flows_name__name__get
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: name
in: path
required: true
schema:
type: string
description: The name of the flow
title: Name
description: The name of the flow
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account 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/Flow'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/flows/filter:
post:
tags:
- Flows
summary: Read Flows
description: 'Query for flows.
Required workspace scopes: `see_flows`'
operationId: read_flows_api_accounts__account_id__workspaces__workspace_id__flows_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_flows_api_accounts__account_id__workspaces__workspace_id__flows_filter_post'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Flow'
title: Response Read Flows Api Accounts Account Id Workspaces Workspace Id Flows Filter Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/flows/bulk_delete:
post:
tags:
- Flows
summary: Bulk Delete Flows
description: 'Bulk delete flows using a filter.
This endpoint soft-deletes flows matching the provided filter criteria,
then hard-deletes their associated deployments.
Flow runs are soft-deleted asynchronously in the background.
Associated automations are cleaned up asynchronously in the background.
If ANY deployment for a flow is unauthorized, the entire request fails
and nothing is deleted.
Required workspace scopes: `manage_flows`'
operationId: bulk_delete_flows_api_accounts__account_id__workspaces__workspace_id__flows_bulk_delete_post
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account 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/Body_bulk_delete_flows_api_accounts__account_id__workspaces__workspace_id__flows_bulk_delete_post'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/BulkDeleteResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/flows/paginate:
post:
tags:
- Flows
summary: Paginate Flows
description: 'Pagination query for flows.
Required workspace scopes: `see_flows`'
operationId: paginate_flows_api_accounts__account_id__workspaces__workspace_id__flows_paginate_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_paginate_flows_api_accounts__account_id__workspaces__workspace_id__flows_paginate_post'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/FlowPaginationResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/ui/flows/count-deployments:
post:
tags:
- Flows
summary: Count Deployments By Flow
description: 'Get deployment counts by flow id.
Required workspace scopes: `see_flows`'
operationId: count_deployments_by_flow_api_accounts__account_id__workspaces__workspace_id__ui_flows_count_deployments_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/Body_count_deployments_by_flow_api_accounts__account_id__workspaces__workspace_id__ui_flows_count_deployments_post'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties:
type: integer
propertyNames:
format: uuid
title: Response Count Deployments By Flow Api Accounts Account Id Workspaces Workspace Id Ui Flows Count Deployments Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/ui/flows/next-runs:
post:
tags:
- Flows
summary: Next Runs By Flow
description: 'Get the next flow run by flow id.
Required workspace scopes: `see_flows`'
operationId: next_runs_by_flow_api_accounts__account_id__workspaces__workspace_id__ui_flows_next_runs_post
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account 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/Body_next_runs_by_flow_api_accounts__account_id__workspaces__workspace_id__ui_flows_next_runs_post'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties:
anyOf:
- $ref: '#/components/schemas/SimpleNextFlowRun'
- type: 'null'
propertyNames:
format: uuid
title: Response Next Runs By Flow Api Accounts Account Id Workspaces Workspace Id Ui Flows Next Runs Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
FlowRunFilterNextScheduledStartTime:
properties:
before_:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Before
description: Only include flow runs with a next_scheduled_start_time or before this time
after_:
anyOf:
- type: string
format: date-time
- type: 'null'
title: After
description: Only include flow runs with a next_scheduled_start_time at or after this time
additionalProperties: false
type: object
title: FlowRunFilterNextScheduledStartTime
description: Filter by `FlowRun.next_scheduled_start_time`.
FlowSort:
type: string
enum:
- CREATED_DESC
- CREATED_ASC
- UPDATED_DESC
- UPDATED_ASC
- NAME_ASC
- NAME_DESC
title: FlowSort
description: Defines flow sorting options.
WorkPoolFilterType:
properties:
any_:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Any
description: A list of work pool types to include
additionalProperties: false
type: object
title: WorkPoolFilterType
description: Filter by `WorkPool.type`.
DeploymentFilterCreatedBy:
properties:
operator:
$ref: '#/components/schemas/prefect_cloud__orion__schemas__filters__Operator'
description: Operator for combining filter criteria. Defaults to 'and_'.
default: and_
id_:
anyOf:
- items:
type: string
format: uuid
type: array
- type: 'null'
title: Id
description: A list of creator IDs to include
type_:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Type
description: A list of creator types to include
is_null_:
anyOf:
- type: boolean
- type: 'null'
title: Is Null
description: If true, only include deployments without a creator
additionalProperties: false
type: object
title: DeploymentFilterCreatedBy
description: Filter by `Deployment.created_by`.
FlowRunFilterParentTaskRunId:
properties:
operator:
$ref: '#/components/schemas/prefect_cloud__orion__schemas__filters__Operator'
description: Operator for combining filter criteria. Defaults to 'and_'.
default: and_
any_:
anyOf:
- items:
type: string
format: uuid
type: array
- type: 'null'
title: Any
description: A list of flow run parent_task_run_ids to include
is_null_:
anyOf:
- type: boolean
- type: 'null'
title: Is Null
description: If true, only include flow runs without parent_task_run_id
additionalProperties: false
type: object
title: FlowRunFilterParentTaskRunId
description: Filter by `FlowRun.parent_task_run_id`.
DeploymentFilterName:
properties:
any_:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Any
description: A list of deployment names to include
examples:
- - my-deployment-1
- my-deployment-2
like_:
anyOf:
- type: string
- type: 'null'
title: Like
description: A case-insensitive partial match. For example, passing 'marvin' will match 'marvin', 'sad-Marvin', and 'marvin-robot'.
examples:
- marvin
additionalProperties: false
type: object
title: DeploymentFilterName
description: Filter by `Deployment.name`.
DeploymentFilter:
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/DeploymentFilterId'
- type: 'null'
description: Filter criteria for `Deployment.id`
branch:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterBranch'
- type: 'null'
description: Filter criteria for `Deployment.branch`
base:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterBase'
- type: 'null'
description: Filter criteria for `Deployment.base`
root:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterRoot'
- type: 'null'
description: Filter criteria for `Deployment.root`
name:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterName'
- type: 'null'
description: Filter criteria for `Deployment.name`
is_schedule_active:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterIsScheduleActive'
- type: 'null'
description: Filter criteria for `Deployment.is_schedule_active`
paused:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterPaused'
- type: 'null'
description: Filter criteria for `Deployment.paused`
tags:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterTags'
- type: 'null'
description: Filter criteria for `Deployment.tags`
work_queue_name:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterWorkQueueName'
- type: 'null'
description: Filter criteria for `Deployment.work_queue_name`
concurrency_limit:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterConcurrencyLimit'
- type: 'null'
description: 'DEPRECATED: Prefer `Deployment.concurrency_limit_id` over `Deployment.concurrency_limit`. If provided, will be ignored for backwards-compatibility. Will be removed after December 2024.'
deprecated: true
work_queue_id:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterWorkQueueId'
- type: 'null'
description: Filter criteria for `Deployment.work_queue_id`
status:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterStatus'
- type: 'null'
description: Filter criteria for `Deployment.status`
flow_or_deployment_name:
anyOf:
- $ref: '#/components/schemas/DeploymentOrFlowNameFilter'
- type: 'null'
description: Filter criteria for `Deployment.name` or `Flow.name`
flow_id:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterFlowId'
- type: 'null'
description: Filter criteria for `Deployment.flow_id`
created_by:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterCreatedBy'
- type: 'null'
description: Filter criteria for `Deployment.created_by`
updated_by:
anyOf:
- $ref: '#/components/schemas/DeploymentFilterUpdatedBy'
- type: 'null'
description: Filter criteria for `Deployment.updated_by`
additionalProperties: false
type: object
title: DeploymentFilter
description: Filter for deployments. Only deployments matching all criteria will be returned.
DeploymentFilterBase:
properties:
operator:
$ref: '#/components/schemas/prefect_cloud__orion__schemas__filters__Operator'
description: Operator for combining filter criteria. Defaults to 'and_'.
default: and_
any_:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Any
description: A list of deployments that have a base to include
examples:
- - deployment1
- deployment2
additionalProperties: false
type: object
title: DeploymentFilterBase
description: Filter by `Deployment.base`.
FlowCreate:
properties:
name:
type: string
maxLength: 5000
pattern: ^[^/%&><]+$
title: Name
description: The name of the flow
examples:
- my-flow
tags:
items:
type: string
type: array
title: Tags
description: A list of flow tags
examples:
- - tag-1
- tag-2
- tag-3
labels:
anyOf:
- additionalProperties:
anyOf:
- type: boolean
- type: integer
- type: number
- type: string
type: object
- type: 'null'
title: Labels
description: A dictionary of key-value labels. Values can be strings, numbers, or booleans.
examples:
- key: value1
key2: 42
additionalProperties: false
type: object
required:
- name
title: FlowCreate
description: Data used by the Orion API to create a flow.
FlowRunFilterStateName:
properties:
any_:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Any
description: A list of flow run state names to include
not_any_:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Not Any
description: A list of flow run state names to exclude
additionalProperties: false
type: object
title: FlowRunFilterStateName
TaskRunFilterStartTime:
properties:
before_:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Before
description: Only include task runs starting at or before this time
after_:
anyOf:
- type: string
format: date-time
- type: 'null'
title: After
description: Only include task runs starting at or after this time
is_null_:
anyOf:
- type: boolean
- type: 'null'
title: Is Null
description: If true, only return task runs without a start time
additionalProperties: false
type: object
title: TaskRunFilterStartTime
description: Filter by `TaskRun.start_time`.
FlowRunFilterTags:
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. Flow runs will be returned only if their tags are a superset of the list
examples:
- - tag-1
- tag-2
any_:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Any
description: A list of tags. Flow runs will be returned if their tags contain any of the tags in the list
examples:
- - tag-1
- tag-2
is_null_:
anyOf:
- type: boolean
- type: 'null'
title: Is Null
description: If true, only include flow runs without tags
additionalProperties: false
type: object
title: FlowRunFilterTags
description: Filter by `FlowRun.tags`.
DeploymentFilterConcurrencyLimit:
properties:
ge_:
anyOf:
- type: integer
- type: 'null'
title: Ge
description: Only include deployments with a concurrency limit greater than or equal to this value
le_:
anyOf:
- type: integer
- type: 'null'
title: Le
description: Only include deployments with a concurrency limit less than or equal to this value
is_null_:
anyOf:
- type: boolean
- type: 'null'
title: Is Null
description: If true, only include deployments without a concurrency limit
additionalProperties: false
type: object
title: DeploymentFilterConcurrencyLimit
description: 'DEPRECATED: Prefer `Deployment.concurrency_limit_id` over `Deployment.concurrency_limit`.'
TaskRunFilterExpectedStartTime:
properties:
before_:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Before
description: Only include task runs expected to start at or before this time
after_:
anyOf:
- type: string
format: date-time
- type: 'null'
title: After
description: Only include task runs expected to start at or after this time
additionalProperties: false
type: object
title: TaskRunFilterExpectedStartTime
description: Filter by `TaskRun.expected_start_time`.
WorkPoolFilterCreatedBy:
properties:
operator:
$ref: '#/components/schemas/prefect_cloud__orion__schemas__filters__Operator'
description: Operator for combining filter criteria. Defaults to 'and_'.
default: and_
id_:
anyOf:
- items:
type: string
format: uuid
type: array
- type: 'null'
title: Id
description: A list of creator IDs to include
type_:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Type
description: A list of creator types to include
is_null_:
anyOf:
- type: boolean
- type: 'null'
title: Is Null
description: If true, only include work pools without a creator
additionalProperties: false
type: object
title: WorkPoolFilterCreatedBy
description: Filter by `WorkPool.created_by`.
FlowRunFilterStateType:
properties:
any_:
anyOf:
- items:
$ref: '#/components/schemas/StateType'
type: array
- type: 'null'
title: Any
description: A list of flow run state types to include
not_any_:
anyOf:
- items:
$ref: '#/components/schemas/StateType'
type: array
- type: 'null'
title: Not Any
description: A list of flow run state types to exclude
additionalProperties: false
type: object
title: FlowRunFilterStateType
description: Filter by `FlowRun.state_type`.
TaskRunFilterSubFlowRuns:
properties:
exists_:
anyOf:
- type: boolean
- type: 'null'
title: Exists
description: If true, only include task runs that are subflow run parents; if false, exclude parent task runs
additionalProperti
# --- truncated at 32 KB (84 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/prefect/refs/heads/main/openapi/prefect-flows-api-openapi.yml