---
title: "Add a GitHub repository"
method: POST
path: "/v2/add/repo/github"
tags: ["Add Library"]
---

# Add a GitHub repository

`POST /v2/add/repo/github`

Submit a GitHub repository for documentation processing. Supports private repos via a gitToken or by connecting your GitHub account at https://context7.com/add-library.

## Request body

- AddRepoRequest — Request body for adding a Git repository
  - `docsRepoUrl` string, uri, required — The repository URL
  - `gitToken` string — Personal access token for private repositories. If not provided, the token from your OAuth connection at https://context7.com/add-library is used.
  - `private` boolean — Whether the repository is private
  - `skipVersionFiltering` boolean — Skip filtering out version-specific documentation pages
  - `generateDocs` boolean — Generate documentation from the repository source code. Applies to private repository submissions.

## Response `200`

Library submitted successfully for processing

- AddLibraryResponse — Response after successfully submitting a library
  - `libraryName` string, required — The library identifier assigned — the URL path of the library on context7.com. `/owner/repo` for GitHub repositories, or `/<source>/<id>` for other sources (e.g., `/vercel/next.js`, `/websites/uploadcare_com`). See [Library ID format](/api-guide#library-id-format).
  - `message` string, required — Human-readable success message

## Other responses

- `400` — Bad Request - Invalid input parameters
- `401` — Unauthorized - Invalid or missing API key
- `403` — Forbidden - Insufficient permissions or plan restrictions
- `404` — Not Found - Resource doesn't exist
- `409` — Conflict - Resource already exists
- `429` — Too Many Requests - Rate limit exceeded
- `500` — Internal Server Error
- `504` — Gateway Timeout - Processing timed out waiting for logs

---

[API](https://skmtc.net/context7/apis/context7-public-api.md) · [All operations](https://skmtc.net/context7/apis/context7-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/context7/context7-public-api/versions/5e85fc74bff0/schema)
