---
title: "Oauth Callback"
method: GET
path: "/api/oauth/callback"
---

# Oauth Callback

`GET /api/oauth/callback`

Handle OAuth provider redirect after user authorization.

The provider redirects here with an authorization code and the state
parameter we generated earlier. We exchange the code for tokens,
persist them, and redirect the user to the frontend success page.

All parameters are optional because OAuth providers may redirect with
only error parameters (no code/state) when the user denies access.

When the flow was initiated from chat (source="chat"), a standalone
HTML page is returned instead of redirecting to the SPA, so users
on SMS/iMessage see a "you can close this tab" message.

## Query parameters

- `code` string
- `state` string
- `realmId` string
- `error` string
- `error_description` string

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mozilla-ai/apis/clawbolt.md) · [All operations](https://skmtc.net/mozilla-ai/apis/clawbolt/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mozilla-ai/clawbolt/versions/327e305858ac/schema)
