---
title: "Connect a CLI site to GitHub"
method: POST
path: "/v2/teamspaces/{teamspaceId}/sites/{siteId}/connect"
tags: ["Docs7 Sites"]
---

# Connect a CLI site to GitHub

`POST /v2/teamspaces/{teamspaceId}/sites/{siteId}/connect`

## Request

- Base URL: `https://context7.com/api`
- URL: `https://context7.com/api/v2/teamspaces/{teamspaceId}/sites/{siteId}/connect`
- Auth: HTTP bearer

Changes a site deployed from the CLI to build from a GitHub repository, keeping its id and address. The Docs7 GitHub App must be installed on the repository.

## Request body

- object
  - `repoUrl` string, required: https://github.com/owner/repo
  - `branch` string, required
  - `docsPath` string, required: Docs folder, `.` for the root.
  - `context7Index` boolean, required: Also keep the docs on Context7.

## Response `200`

The connected site

- object
  - `data` object

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid bearer
- `403`: Not allowed for this caller or plan
- `404`: Not found
- `409`: Conflict
- `500`: Internal error

## Changes

- **2026-10-28** `1fd763a39c5d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/context7/apis/context7-public-api/changes/v2/teamspaces/:teamspaceId/sites/:siteId/connect/post.md)

---

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