api
Command reference for parix api.
parix api makes an authenticated HTTP request with the bearer token from the stored CLI session.
parix api [options] <path>Use it for quick API inspection from the same identity and organization context as the CLI session. For application integrations, prefer API keys.
Arguments
| Argument | Description |
|---|---|
<path> | Relative API path or absolute URL. |
Relative paths are resolved against the active Parix base URL:
parix api /api/v1/sessionAbsolute URLs are used directly:
parix api https://dev.parix.io/api/v1/sessionOptions
| Option | Description |
|---|---|
-X, --method <method> | HTTP method. Defaults to GET. |
-d, --body <body> | Raw request body. |
-H, --header <header> | Additional header in key:value form. Repeat for multiple headers. |
-b, --base-url <url> | Override the stored base URL. |
-h, --help | Display command help. |
If --body is provided and no content-type header is set, the CLI sends content-type: application/json.
Examples
Inspect the current session:
parix api /api/v1/sessionCall a local web app:
parix api /api/v1/session --base-url http://localhost:5173Send a JSON request:
parix api /api/v1/databases \
--method POST \
--body '{"name":"payments-ledger","provider":"gcp","region":"asia-southeast1"}'Add a custom header:
parix api /api/v1/session --header "x-debug:true"Output
The command prints:
- HTTP status
- response content type
- formatted JSON when the response is JSON
- raw text for non-JSON responses
The CLI refreshes the stored OAuth token when needed. If a request returns 401, it attempts one forced refresh and retries the request.