Skip to main content
POST
/
v1
/
auth
/
login
/
privy
Log in with Privy token
curl --request POST \
  --url https://perp-api.phoenix.trade/v1/auth/login/privy \
  --header 'Content-Type: application/json' \
  --data '
{
  "privy_token": "string"
}
'
{
  "access_token": "<string>",
  "expires_in": 1,
  "pop_key": "<string>",
  "refresh_expires_in": 1,
  "refresh_token": "<string>",
  "token_type": "<string>"
}

Body

application/json

JSON request payload for post.v1.auth.login.privy.

privy_token
string
required
wallet_proof
object

Proof of ownership of wallet_pubkey, obtained by signing the transaction returned from POST /v1/auth/privy/wallet-challenge. When supplied this satisfies the first-time binding ownership check without needing the Privy linked-accounts lookup.

wallet_pubkey
string | null

Optional Solana wallet pubkey the caller is asserting ownership of. For first-time bindings ownership must be proved either by including wallet_proof (a Solana memo transaction signed by the wallet — works for Ledger which cannot sign off-chain messages) or, absent a proof, by Privy's linked_accounts API confirming the wallet is linked to the authenticated user. An unverified pubkey is rejected with wallet_not_linked. For returning users, if supplied, it must match the bound pubkey. If omitted when no mapping exists, login still succeeds but the issued token will not carry a wallet claim and so cannot satisfy user-scoped authorization.

Response

Phoenix JWT pair issued

access_token
string
required
expires_in
integer<int64>
required
Required range: x >= 0
pop_key
string
required
refresh_expires_in
integer<int64>
required
Required range: x >= 0
refresh_token
string
required
token_type
string
required