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, but the CLI still attaches the bearer token from the stored session. Only use an absolute URL on the same trusted Parix origin as that session. To change environments, authenticate to the target first with parix auth login --base-url <target-origin>; an absolute URL does not mint a token for a different origin.

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

Authenticate (production is the default), then call the session endpoint:

parix auth login
parix api /api/v1/session

Do not point parix api, --base-url, or an absolute request URL at an origin you do not trust. The CLI attaches the current stored bearer token to the request, even when the requested origin differs from the one stored with the session.

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.