---
title: "Github App Callback"
method: GET
path: "/api/integrations/github-app/callback"
tags: ["github-app-integration"]
---

# Github App Callback

`GET /api/integrations/github-app/callback`

## Request

- Base URL: `https://app.thinqos.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.thinqos.com/api/integrations/github-app/callback`
- Auth: none declared

Handle GitHub's redirect back from an App installation.

``state`` is the authentication primitive here - no session auth is
required (see module docstring). Flow:

1. Look up the state row by ``state`` -> error redirect on miss.
2. Check expiry -> error redirect + discard on expired.
3. ``setup_action == "request"``: a non-admin org member requested install;
   GitHub queues it for owner approval with no ``installation_id`` to
   record yet - discard the state and redirect with an info marker, no
   connection row.
4. Otherwise ``installation_id`` must be present.
5. TOS-7262: ``code`` must be present and prove that the GitHub user who
   installed can access ``installation_id`` (see module docstring). Any
   failure records nothing, discards the state and error-redirects.
6. Write the per-caller connection and discard the state.

## Query parameters

- `installation_id` integer, nullable
- `setup_action` string, nullable
- `state` string, nullable
- `code` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

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