> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prefect.io/llms.txt
> Use this file to discover all available pages before exploring further.

# api

# `prefect.cli.api`

API command — native cyclopts implementation.

Make direct requests to the Prefect API.

## Functions

### `api_request` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/api.py#L130" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
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)')])
```

Make a direct request to the Prefect API.

**Examples:**

```bash theme={null}
# 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
```
