Call the CircleCI REST API directly

## Usage

`circleci api <path> [flags]`

## Arguments

`<path>` is the request path. It is relative to /api/v3 by default
(for example, "projects/{project-id}"). To target
a different version prefix, include it explicitly, for example, "api/v2/me".

## Flags

| Flag                       | Description                                                                       |
| -------------------------- | --------------------------------------------------------------------------------- |
| `-d, --data string`        | Raw request body sent verbatim; @file reads from a file, @- from stdin            |
| `-f, --field stringArray`  | Add a field: key=value (query param for GET/DELETE, JSON body for POST/PUT/PATCH) |
| `-H, --header stringArray` | Add a request header: "Key: Value"                                                |
| `--jq string`              | Process values from the response using jq syntax (see `circleci help formatting`) |
| `-X, --method string`      | HTTP method (default: GET, or POST when -f or -d is used)                         |

Global flags: `-c, --config`, `--debug`, `--no-color`, `-q, --quiet` — see `circleci --help`.

## Examples

- Get your user profile: 
  `circleci api me`
- List runs for a project: 
  `circleci api projects/{project-id}/runs`
- Trigger a pipeline on a branch: 
  `circleci api projects/{project-id}/run -f definition_id=<id> -f "config[branch]=main"`
- Send a body read from a file (@- reads from stdin): 
  `circleci api projects/{project-id}/run -d @payload.json`
- Access the v1.1 API with a custom header: 
  `circleci api api/v1.1/me -H "X-Custom: value"`

## Details

Make an authenticated HTTP request to the REST API and print the raw
response body. The Authorization header is added from your stored token.

Exit code reflects the HTTP response: 0 for 2xx, 4 for 4xx/5xx.

