Skip to content
Get Started

Authentication

ACCESS_TOKEN based request authentication

BrokerAPI authenticates every request with an ACCESS_TOKEN: put your broker’s ACCESS_TOKEN in the Authorization header with the Bearer scheme.

Required Headers

Header Value Example
Authorization Bearer ACCESS_TOKEN Bearer ${access_token}
Content-Type Content type application/json; charset=utf-8

Example Request

curl --request POST \
  --url https://b-api.longbridge.xyz/v1/datasets/account_cash_balances \
  --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Content-Type: application/json; charset=utf-8" \
  --data '{"filters": {}, "page": 1, "page_size": 20}'

Obtaining Credentials

The ACCESS_TOKEN is a broker-level credential (Broker-scoped Authorization — it covers your organization’s approved data scope). A broker administrator creates it in the console:

  1. Go to Global Settings → Identity Management → API Token.
  2. Click New Token (top right). In the Create Access Token dialog, fill in:
    • Name: a label for its purpose (e.g. reconciliation service, market-data sync). 2–30 characters. The name also serves as the service account name — unique within the tenant and not reusable after deletion.
    • Expiry: choose as needed (e.g. 1 day).
  3. Click Create. The full ACCESS_TOKEN is shown only once — copy and store it immediately. It cannot be viewed again after you close the dialog; if lost, you can only create a new one.

After creation, the API Token list shows the key name, key prefix, status, expiry, last-used time / IP, and creation time, with per-token actions to edit, reset, enable / disable, or delete.

Warning

The ACCESS_TOKEN grants broker-level data access. Keep it safe: use it server-side only, and never embed it in client code, logs, or version control. If you suspect it has leaked, contact Longport Whale immediately to rotate the credential.

Whale Docs