---
title: "Facebook Oauth Exchange"
method: POST
path: "/api/v1/auth/facebook/exchange"
tags: ["auth"]
---

# Facebook Oauth Exchange

`POST /api/v1/auth/facebook/exchange`

## Request

- Base URL: `https://api.alert.camp` (the document declares no server; this is the origin it was published from)
- URL: `https://api.alert.camp/api/v1/auth/facebook/exchange`
- Auth: none declared

Exchange a one-time code for Firebase tokens.

Called by the mobile app after receiving the deep link from the
OAuth callback. The code is single-use and expires after 5 minutes.
Performs the Facebook token exchange, Firebase sign-in, and DB
user creation/lookup that was deferred from the callback.

## Request body

- FacebookExchangeRequest: Schema for exchanging a Facebook OAuth code for tokens.
  - `code` string, required: Exchange code from OAuth callback
  - `language` string, nullable

## Response `200`

Successful Response

- DirectTokenResponse: Response containing Firebase tokens for direct auth (no SDK needed).
  - `id_token` string, required
  - `refresh_token` string, required
  - `user_id` string, required
  - `email` string, required
  - `display_name` string, nullable
  - `email_verified` boolean
  - `terms_accepted` boolean
  - `terms_previously_accepted` boolean

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/alert/apis/alertcamp.md) · [All operations](https://skmtc.dev/alert/apis/alertcamp/llms.txt) · [OpenAPI document](https://skmtc.dev/alert/apis/alertcamp/revisions/864c8c9ef833?raw)
