prefect.cli
api
API command — native cyclopts implementation. Make direct requests to the Prefect API.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
prefect.cli.apiapi_request api_request(method: Annotated[str, cyclopts.Parameter(help='HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS)')], path: Annotated[str, cyclopts.Parameter(help='API path (e.g., /flows, /flows/filter)')])
# GET request
$ prefect api GET /flows/abc-123
# POST request with data
$ prefect api POST /flows/filter --data '{"limit": 10}'
# POST to filter endpoint (defaults to empty object)
$ prefect api POST /flows/filter
# Custom headers
$ prefect api POST /flows/filter -H "X-Custom: value" --data '{}'
# Verbose output
$ prefect api GET /flows --verbose
# Account-level operation (Cloud)
$ prefect api GET /workspaces --account
# API root level (Cloud only)
$ prefect api GET /me --root
Was this page helpful?