---
title: "Connect Github"
method: POST
path: "/api/v1/sources/github/connection"
tags: ["authed"]
---

# Connect Github

`POST /api/v1/sources/github/connection`

## Request

- Base URL: `https://api.teaflask.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.teaflask.com/api/v1/sources/github/connection`
- Auth: none declared

## Request body

- ConnectGitHubRequest: The final leg: GitHub's authorization code plus the authorize state (which carries the installation id) minted by the previous leg.
  - `code` string, required
  - `state` string, required

## Response `201`

Successful Response

- GitHubConnectionResponse
  - `installation_id` integer, required
  - `account_login` string, required
  - `account_type` string, required
  - `status` 'active' | 'suspended' | 'removed', required
  - `repositories` GitHubRepositoryResponse[], required
    - `id` integer, required
    - `full_name` string, required
    - `private` boolean, required
    - `production_ref` string, nullable, required
  - `connected_by` string, nullable, required
  - `connected_at` string, date-time, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `405`: Method not allowed
- `422`: Validation error
- `500`: Internal server error

## Changes

- **2026-11-03** `c6ac9fd6657f`: 6 info
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `401`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `403`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `404`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `405`
  - …2 more

[Operation history](https://skmtc.dev/teaflask/apis/teaflask-api/changes/api/v1/sources/github/connection/post.md)

---

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