Search docs

Find any page, endpoint, or guide.

Identify the calling token

Alpha
GEThttps://api.voxrouter.ai/v1/auth/whoami

Return the user/account behind the bearer token. Accepts both `pk_*` API keys and `vr_session_*` CLI session tokens — `auth` in the response distinguishes which kind authenticated. Useful for `voxrouter whoami` and as a generic "are my creds OK?" probe before running an expensive operation.

bash
curl https://api.voxrouter.ai/v1/auth/whoami \
  -H "Authorization: Bearer $VOXROUTER_API_KEY"

Headers

AuthorizationstringRequired
Bearer token. Send as Authorization: Bearer pk_....

Response

Caller identified.

json
{
  "user_id": "string",
  "auth": "api_key"
}
user_idstringRequired
Stable identifier of the calling user. For `pk_*` keys this is the account_id (org or user wallet); for `vr_session_*` tokens this is the user.id.
authenum (api_key | session)Required
Which token kind authenticated this request. `api_key` for `pk_*` keys, `session` for `vr_session_*` tokens issued by `voxrouter login`.
expires_atstring<date-time>Optional
ISO-8601 expiry of the session token. Only present when `auth = session`; `pk_*` keys do not expire on a clock.

Errors

Non-2xx responses return a JSON body with a machine-readable error code and an optional details string.

StatusMeaning
401Missing or invalid API key.