Skip to main content
PARIXDocs

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

ArgumentDescription
<path>Relative API path or absolute URL.

Relative paths are resolved against the active Parix base URL:

parix api /api/v1/session

Absolute URLs are used directly:

parix api https://dev.parix.io/api/v1/session

Options

OptionDescription
-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, --helpDisplay 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/session

Call a local web app:

parix api /api/v1/session --base-url http://localhost:5173

Send 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.