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

# GitHub OAuth

`POST /auth/github`

Sign in or register using a GitHub OAuth authorization code.

## Request body

- object
  - `code` string, required — GitHub OAuth authorization code

## Response `200`

Authentication successful

- AuthResponse
  - `success` boolean
  - `user` UserObject
    - `id` string
    - `email` string, email
    - `name` string
    - `plan` 'free' | 'starter' | 'pro'
    - `avatarUrl` string, nullable
    - `emailVerified` boolean
    - `isAdmin` boolean
    - `createdAt` string, date-time
  - `accessToken` string — JWT access token (15 min expiry). Store in memory only.
  - `message` string

## Other responses

- `400` — Invalid or expired authorization code
- `501` — GitHub OAuth not configured

---

[API](https://skmtc.net/snapapi/apis/snapapi-screenshot-web-data-api.md) · [All operations](https://skmtc.net/snapapi/apis/snapapi-screenshot-web-data-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/snapapi/snapapi-screenshot-web-data-api/versions/b12ff2791613/schema)
