---
title: "OAuth redirect target (provider calls this)"
method: GET
path: "/v1/auth/{provider}/callback"
tags: ["Auth"]
---

# OAuth redirect target (provider calls this)

`GET /v1/auth/{provider}/callback`

## Request

- Base URL: `https://api.stackdata.io`
- URL: `https://api.stackdata.io/v1/auth/{provider}/callback`
- Auth: one of:
  - none
  - API key in header `X-API-Key`

Verifies state, exchanges the code, upserts the account, starts a session, and 302-redirects to the app with the session token in the URL fragment.

## Path parameters

- `provider` 'google' | 'github', required

## Query parameters

- `code` string
- `state` string

## Other responses

- `302`: Redirect back to the app (with `#session=…` on success or `#error=…` on failure).

---

[API](https://skmtc.dev/stackdata/apis/stackdata-api.md) · [All operations](https://skmtc.dev/stackdata/apis/stackdata-api/llms.txt) · [OpenAPI document](https://skmtc.dev/stackdata/apis/stackdata-api/revisions/91358ae3f6e8?raw)
