palbaseDocs

Palbase Auth API · API

POST/auth/token/exchange

Exchange custom token for session

Trades a server-minted custom token (Firebase-style backend-issued token) for a regular session — access + refresh tokens. Only a token minted by /admin/token/custom, within its TTL, is taken, and once: it alone carries the custom token's audience and no session. Any other token the project signs — a session's access token, signed out or not, an impersonation's — is refused with 401 invalid_token, as is a custom token presented again (401 token_used).

Called by your app, with the publishable key.

Request body

custom_tokenstring · required
curl
curl -X POST "https://<your-ref>.palbase.studio/auth/token/exchange" \
  -H "apikey: $PALBASE_PUBLISHABLE_KEY" \
  -H "content-type: application/json" \
  -d '{"custom_token":"string"}'

Responses

200Signed in

400Validation failed or required field missing

401Missing, invalid, or expired credentials

403Authenticated but not permitted (banned, hook denial, role mismatch)

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation ExchangeCustomToken of auth's contract.