<@ULVA73B9P>, can you give me all of prefect api s...
# ask-marvin
t
@Marvin, can you give me all of prefect api server's route?
m
thought for 181.7 seconds
Shortest path: the Prefect API server exposes an OpenAPI spec that lists every route. - Self-hosted Prefect Server (default): - Docs (Swagger): http://YOUR_HOST:4200/api/docs - OpenAPI JSON: http://YOUR_HOST:4200/api/openapi.json - Prefect Cloud: - Docs: Cloud API docs - OpenAPI JSON: https://app.prefect.cloud/api/openapi.json Notes: - In Prefect 3.x, all routes are prefixed with
/api
by default (configurable via
PREFECT_SERVER_API_BASE_PATH
). - Health endpoints
/api/health
and
/api/ready
are open even if basic auth is enabled on Server. - Cloud calls require an API key; if
openapi.json
returns 401, include
Authorization: Bearer <PREFECT_API_KEY>
. Quick ways to dump every route path from the spec: - With curl/jq (Server):
Copy code
curl -s <http://localhost:4200/api/openapi.json> | jq -r '.paths | keys[]' | sort
- With curl/jq (Cloud):
Copy code
curl -s <https://app.prefect.cloud/api/openapi.json> | jq -r '.paths | keys[]' | sort
- With Python (works for both; add auth if needed):
Copy code
import json, requests

url = "<http://localhost:4200/api/openapi.json>"  # or <https://app.prefect.cloud/api/openapi.json>
headers = {}  # For Cloud: {"Authorization": f"Bearer {PREFECT_API_KEY}"}
resp = requests.get(url, headers=headers)
resp.raise_for_status()
paths = sorted(resp.json().get("paths", {}).keys())
print("\n".join(paths))
print(f"\nTotal routes: {len(paths)}")
If you want, I can paste the full list of routes here for the latest Prefect 3.x release—just confirm: - Are you using self-hosted Server or Cloud? - If Server, what URL/port and are you using basic auth? - Do you want just the path list (e.g.,
/api/flow_runs/filter
) or also the HTTP methods and schemas? Helpful references: - Cloud interactive docs: Prefect Cloud API docs - REST API reference: Prefect REST API reference