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

# Oauth Twitch Callback

`GET /api/oauth/twitch/callback`

## Request

- Base URL: `https://sleipnir.tv` (the document declares no server; this is the origin it was published from)
- URL: `https://sleipnir.tv/api/oauth/twitch/callback`
- Auth: none declared

Twitch redirects here with code+state. Exchange code for tokens,
fetch the Twitch user profile, save (replacing any existing active
connection for this Sleipnir user), redirect to account page.

Shared by the chat-connect and destination-connect flows: a dest grant
is recognised by its state matching the ISOLATED dest state store. If so,
we handle the destination and return; otherwise we fall through to the
chat logic below, unchanged.

## Query parameters

- `code` string, nullable
- `state` string, nullable
- `error` string, nullable

## Cookies

- `__Host-connect_nonce` string, nullable
- `relay_session` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/sleipnir/apis/relay-control-plane.md) · [All operations](https://skmtc.dev/sleipnir/apis/relay-control-plane/llms.txt) · [OpenAPI document](https://skmtc.dev/sleipnir/apis/relay-control-plane/revisions/79829f6945a4?raw)
