---
title: "Exchange Token"
method: POST
path: "/v2/auth/exchange-token"
tags: ["v2 - Viewer Auth"]
---

# Exchange Token

`POST /v2/auth/exchange-token`

## Request

- Base URL: `https://api.jubjubapp.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.jubjubapp.com/v2/auth/exchange-token`
- Auth: HTTP bearer

PUBLIC. Exchange a firebase_custom_token (from register-viewer) for a
Firebase ID token + refresh token, SERVER-SIDE — so the browser never calls
the referrer-restricted Google Identity Toolkit endpoint directly.

## Request body

- ExchangeTokenRequest
  - `firebase_custom_token` string, required: The firebase_custom_token returned by /v2/auth/register-viewer

## Response `200`

Successful Response

- ExchangeTokenResponse
  - `id_token` string, required
  - `refresh_token` string, required
  - `expires_in` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/jubjubapp/apis/jubjub-api.md) - [All operations](https://skmtc.dev/jubjubapp/apis/jubjub-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jubjubapp/apis/jubjub-api/revisions/353157b296f2?raw)
