---
title: "GitHub OAuth exchange"
method: POST
path: "/auth/oauth/github/exchange"
tags: ["auth"]
---

# GitHub OAuth exchange

`POST /auth/oauth/github/exchange`

Exchange GitHub OAuth code for JWTs

## Request body

- object
  - `code` string, required
  - `state` string, required

## Response `200`

Default Response

- object
  - `token` string, required
  - `refreshToken` string, required
  - `redirectTo` string

## Other responses

- `400` — Default Response
- `401` — Default Response
- `409` — Default Response
- `500` — Default Response
- `503` — Default Response

## Changes

- **2026-07-17** `b2c23a2d8170` — 1 info
  - endpoint added
- **2026-01-14** `4f6c72308c7a` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/blockmatic/apis/basilic-api/changes/auth/oauth/github/exchange/post.md)

---

[API](https://skmtc.dev/blockmatic/apis/basilic-api.md) · [All operations](https://skmtc.dev/blockmatic/apis/basilic-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/blockmatic/basilic-api/revisions/b2c23a2d8170/schema)
