PrivSource Menu

REST API

Whoami API Reference

Check your API token's identity and which APIs it can access.

Overview

Call this endpoint first to verify your API token and discover which APIs it can access. The response includes a buyer_account or seller_account object depending on the account the token belongs to, plus an apis array listing the APIs the token can call.

Who can access

Available with any active API key.

GET

Get current account context

/v1/whoami

Returns the current API token's account (buyer_account or seller_account) and the list of APIs the token can access.

Code Sample

curl "https://api.privsource.com/v1/whoami" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example Response

{
  "seller_account": {
    "company_name": "Globex"
  },
  "apis": [
    "buyer-lists"
  ]
}

Response Codes

200 Current account context
401 Unauthorized
402 Payment required - no active subscription

Schemas

ErrorResponse

Error response returned by authenticated API endpoints.

Field Type Description
errors required string[] One or more human-readable error messages.

WhoAmIResponse

Identity and API access for the current API token.

Field Type Description
buyer_account object Present when the token belongs to a buyer account.
seller_account object Present when the token belongs to a seller account.
apis enum[] APIs this token can access. Deals requires a buyer account with a paid subscription; buyer-lists requires a seller account with API access enabled.