---
title: "Connect Github"
method: POST
path: "/v1/user/github/connect"
tags: ["v1-github"]
---

# Connect Github

`POST /v1/user/github/connect`

## Request

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

Store GitHub credentials after successful OAuth flow.

Called by frontend after Supabase linkIdentity() or initial OAuth login.
The access_token is received from Supabase's session as provider_token.

Body:
    access_token: GitHub OAuth access token (from provider_token)
    scopes: List of OAuth scopes granted (e.g., ['repo', 'user:email'])

## Request body

- GitHubConnectRequest: Request body for POST /v1/user/github/connect.
  - `access_token` string, required
  - `scopes` string[]

## Response `200`

Successful Response

- GitHubConnectResponse: Response for POST /v1/user/github/connect.
  - `success` boolean, required
  - `github_username` string, required
  - `github_user_id` string, required
  - `message` string, required

## Other responses

- `422`: Validation Error

---

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