Agara

Create a personal access token

POST
/trade/v1/auth/tokens

Authorization

Authorization
Required
Bearer <token>

Privy identity token from a live browser session. Issued by the web app's Privy SDK; not obtainable via API. Used by operations that require a fresh browser session.

In: header

Request Body

application/jsonRequired

exchange
Required
string

Exchange the token's wallet is bound to.

Value in: "AGARA"

expires_atstring | null

Optional expiry, RFC 3339. Must be in the future; omit for a token that never expires.

Format: "date-time"

label
Required
string

User-supplied label, 1 to 100 characters. Shown on the token list so you can tell your tokens apart.

scopes
Required
array<string>

Scopes to grant, at least one. Every name must be one of portfolio:read, orders:read, orders:place, orders:place_signed, orders:cancel, orders:cancel_all, positions:split, positions:merge, batches:submit, account:stream, or faucet:bulk_fund. batches:submit is only issuable for an AGARA wallet, and duplicates are rejected. See Authentication for what each one covers.

curl -X POST "https://app.agara.xyz/trade/v1/auth/tokens" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "exchange": "AGARA",
    "label": "trading bot",
    "scopes": [
      "portfolio:read",
      "orders:read",
      "orders:place",
      "orders:cancel"
    ]
  }'

Token created. token is the plaintext bearer; shown exactly once.

{
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "label": "string",
  "scopes": [
    "string"
  ],
  "token": "string"
}