Skip to main content
POST
/
api
/
deployments
/
filter
Read Deployments
curl --request POST \
  --url https://api.example.com/api/deployments/filter \
  --header 'Content-Type: application/json' \
  --data '
{
  "offset": 0,
  "flows": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "deployment": {
      "operator": "and_",
      "is_null_": true
    },
    "name": {
      "any_": [
        "my-flow-1",
        "my-flow-2"
      ],
      "like_": "marvin"
    },
    "tags": {
      "operator": "and_",
      "all_": [
        "tag-1",
        "tag-2"
      ],
      "is_null_": true
    }
  },
  "flow_runs": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "not_any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "name": {
      "any_": [
        "my-flow-run-1",
        "my-flow-run-2"
      ],
      "like_": "marvin"
    },
    "tags": {
      "operator": "and_",
      "all_": [
        "tag-1",
        "tag-2"
      ],
      "any_": [
        "tag-1",
        "tag-2"
      ],
      "is_null_": true
    },
    "deployment_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "is_null_": true
    },
    "work_queue_name": {
      "operator": "and_",
      "any_": [
        "work_queue_1",
        "work_queue_2"
      ],
      "is_null_": true
    },
    "state": {
      "operator": "and_",
      "type": {
        "any_": [
          "SCHEDULED"
        ],
        "not_any_": [
          "SCHEDULED"
        ]
      },
      "name": {
        "any_": [
          "<string>"
        ],
        "not_any_": [
          "<string>"
        ]
      }
    },
    "flow_version": {
      "any_": [
        "<string>"
      ]
    },
    "start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z",
      "is_null_": true
    },
    "end_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z",
      "is_null_": true
    },
    "expected_start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z"
    },
    "next_scheduled_start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z"
    },
    "parent_flow_run_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "parent_task_run_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "is_null_": true
    },
    "idempotency_key": {
      "any_": [
        "<string>"
      ],
      "not_any_": [
        "<string>"
      ]
    }
  },
  "task_runs": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "name": {
      "any_": [
        "my-task-run-1",
        "my-task-run-2"
      ],
      "like_": "marvin"
    },
    "tags": {
      "operator": "and_",
      "all_": [
        "tag-1",
        "tag-2"
      ],
      "is_null_": true
    },
    "state": {
      "operator": "and_",
      "type": {
        "any_": [
          "SCHEDULED"
        ]
      },
      "name": {
        "any_": [
          "<string>"
        ]
      }
    },
    "start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z",
      "is_null_": true
    },
    "expected_start_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z"
    },
    "subflow_runs": {
      "exists_": true
    },
    "flow_run_id": {
      "operator": "and_",
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "is_null_": false
    }
  },
  "deployments": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "not_any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "name": {
      "any_": [
        "my-deployment-1",
        "my-deployment-2"
      ],
      "like_": "marvin"
    },
    "flow_or_deployment_name": {
      "like_": "<string>"
    },
    "paused": {
      "eq_": true
    },
    "tags": {
      "operator": "and_",
      "all_": [
        "tag-1",
        "tag-2"
      ],
      "any_": [
        "tag-1",
        "tag-2"
      ],
      "is_null_": true
    },
    "work_queue_name": {
      "any_": [
        "work_queue_1",
        "work_queue_2"
      ]
    },
    "concurrency_limit": {
      "ge_": 123,
      "le_": 123,
      "is_null_": true
    }
  },
  "work_pools": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "name": {
      "any_": [
        "<string>"
      ]
    },
    "type": {
      "any_": [
        "<string>"
      ]
    }
  },
  "work_pool_queues": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "name": {
      "any_": [
        "wq-1",
        "wq-2"
      ],
      "startswith_": [
        "marvin",
        "Marvin-robot"
      ]
    }
  },
  "sort": "NAME_ASC",
  "limit": 123
}
'
[
  {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created": "2023-11-07T05:31:56Z",
    "updated": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "flow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "version": "<string>",
    "description": "<string>",
    "paused": false,
    "schedules": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "created": "2023-11-07T05:31:56Z",
        "updated": "2023-11-07T05:31:56Z",
        "schedule": {
          "interval": 123,
          "anchor_date": "2023-11-07T05:31:56Z",
          "timezone": "America/New_York"
        },
        "deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "active": true,
        "max_scheduled_runs": 1,
        "parameters": {},
        "slug": "<string>"
      }
    ],
    "concurrency_limit": 123,
    "global_concurrency_limit": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "created": "2023-11-07T05:31:56Z",
      "updated": "2023-11-07T05:31:56Z",
      "name": "<string>",
      "limit": 123,
      "active_slots": 123,
      "active": true,
      "slot_decay_per_second": 2
    },
    "concurrency_options": {
      "collision_strategy": "ENQUEUE",
      "grace_period_seconds": 43230
    },
    "job_variables": {},
    "parameters": {},
    "tags": [
      "<string>"
    ],
    "labels": {},
    "work_queue_name": "<string>",
    "work_queue_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "last_polled": "2023-11-07T05:31:56Z",
    "parameter_openapi_schema": {},
    "path": "<string>",
    "pull_steps": [
      {}
    ],
    "entrypoint": "<string>",
    "storage_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "infrastructure_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created_by": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "type": "<string>",
      "display_value": "<string>"
    },
    "updated_by": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "type": "<string>",
      "display_value": "<string>"
    },
    "work_pool_name": "<string>",
    "status": "NOT_READY",
    "enforce_parameter_schema": true
  }
]

Headers

x-prefect-api-version
string

Body

application/json
offset
integer
default:0
Required range: x >= 0
flows
FlowFilter · object

Filter for flows. Only flows matching all criteria will be returned.

flow_runs
FlowRunFilter · object

Filter flow runs. Only flow runs matching all criteria will be returned

task_runs
TaskRunFilter · object

Filter task runs. Only task runs matching all criteria will be returned

deployments
DeploymentFilter · object

Filter for deployments. Only deployments matching all criteria will be returned.

work_pools
WorkPoolFilter · object

Filter work pools. Only work pools matching all criteria will be returned

work_pool_queues
WorkQueueFilter · object

Filter work queues. Only work queues matching all criteria will be returned

sort
enum<string>
default:NAME_ASC

Defines deployment sorting options.

Available options:
CREATED_DESC,
UPDATED_DESC,
NAME_ASC,
NAME_DESC
limit
integer

Defaults to PREFECT_API_DEFAULT_LIMIT if not provided.

Response

Successful Response

id
string<uuid>
required
created
string<date-time> | null
required
updated
string<date-time> | null
required
name
string
required

The name of the deployment.

flow_id
string<uuid>
required

The flow id associated with the deployment.

version
string | null

An optional version for the deployment.

description
string | null

A description for the deployment.

paused
boolean
default:false

Whether or not the deployment is paused.

schedules
DeploymentSchedule · object[]

A list of schedules for the deployment.

concurrency_limit
integer | null
deprecated

DEPRECATED: Prefer global_concurrency_limit. Will always be None for backwards compatibility. Will be removed after December 2024.

global_concurrency_limit
GlobalConcurrencyLimitResponse · object

The global concurrency limit object for enforcing the maximum number of flow runs that can be active at once.

concurrency_options
ConcurrencyOptions · object

The concurrency options for the deployment.

job_variables
Job Variables · object

Overrides to apply to the base infrastructure block at runtime.

parameters
Parameters · object

Parameters for flow runs scheduled by the deployment.

tags
string[]

A list of tags for the deployment

Example:
["tag-1", "tag-2"]
labels
Labels · object

A dictionary of key-value labels. Values can be strings, numbers, or booleans.

Example:
{ "key": "value1", "key2": 42 }
work_queue_name
string | null

The work queue for the deployment. If no work queue is set, work will not be scheduled.

work_queue_id
string<uuid> | null

The id of the work pool queue to which this deployment is assigned.

last_polled
string<date-time> | null

The last time the deployment was polled for status updates.

parameter_openapi_schema
Parameter Openapi Schema · object

The parameter schema of the flow, including defaults.

path
string | null

The path to the working directory for the workflow, relative to remote storage or an absolute path.

pull_steps
Pull Steps · object[] | null

Pull steps for cloning and running this deployment.

entrypoint
string | null

The path to the entrypoint for the workflow, relative to the path.

storage_document_id
string<uuid> | null

The block document defining storage used for this flow.

infrastructure_document_id
string<uuid> | null

The block document defining infrastructure to use for flow runs.

created_by
CreatedBy · object

Optional information about the creator of this deployment.

updated_by
UpdatedBy · object

Optional information about the updater of this deployment.

work_pool_name
string | null

The name of the deployment's work pool.

status
enum<string> | null
default:NOT_READY

Whether the deployment is ready to run flows.

Available options:
READY,
NOT_READY
enforce_parameter_schema
boolean
default:true

Whether or not the deployment should enforce the parameter schema.