---
title: "Exchange Firebase Token"
method: POST
path: "/v1/oauth/exchange_firebase_token"
tags: ["oauth"]
---

# Exchange Firebase Token

`POST /v1/oauth/exchange_firebase_token`

## Request

- Base URL: `https://api.linktodm.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.linktodm.com/v1/oauth/exchange_firebase_token`
- Auth: none declared

Consent granted: verify the Firebase session and mint an auth code.

Returns the callback URL for the consent screen to navigate to, rather
than a 302 — the screen calls this with fetch, which cannot usefully
follow a cross-origin redirect to the partner's callback.

## Request body `application/x-www-form-urlencoded`

- BodyExchangeFirebaseTokenV1OauthExchangeFirebaseTokenPost
  - `firebase_token` string, required
  - `client_id` string, required
  - `redirect_uri` string, required
  - `state` string, required
  - `scope` string, nullable
  - `code_challenge` string, nullable
  - `code_challenge_method` string, nullable

## Response `200`

Successful Response

- AuthorizationGrantResponse: Returned to the consent screen after the user clicks Allow. The frontend performs the redirect itself rather than following a 302, because the browser fetch that carries the Firebase ID token cannot usefully follow a cross-origin redirect to the partner's callback.
  - `redirect_url` string, required: Fully-built callback URL including code and state.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/linktodm/apis/salesmorph.md) - [All operations](https://skmtc.dev/linktodm/apis/salesmorph/llms.txt) - [OpenAPI document](https://skmtc.dev/linktodm/apis/salesmorph/revisions/4af0ad5dbe92?raw)
