---
title: "Link a repository to a project"
method: PUT
path: "/v0/projects/{project}/github"
tags: ["projects", "github"]
---

# Link a repository to a project

`PUT /v0/projects/{project}/github`

## Request

- The document declares no server URL.
- Auth: none declared

Link the GitHub repository that a grant from the GitHub code exchange names. The grant must be for this project and from this user, and it lasts ten minutes. A project links at most one repository, so this replaces any link it had. The user must have `manage` permissions for the project.

## Path parameters

- `project` string, required

## Request body

- JsonNewLinkedRepository
  - `grant` string, required

## Response `200`

successful operation

- JsonLinkedRepository: A project's linked repository, which its dispatches go to.
  - `full_name` string, required
  - `linked` string, date-time, required
  - `reason` union
    - 'uninstalled': The app was uninstalled.
    - 'suspended': The app's installation was suspended.
    - 'removed': The repository was removed from the app's installation.
  - `status` 'connected' | 'disconnected', required
  - `user` JsonPubUser, required
    - `name` string, required
    - `slug` string, required
    - `uuid` string, uuid, required

## Other responses

- `4XX`: Error
- `5XX`: Error

## Changes

- **2026-10-31** `538b39b8d755`: 1 info
  - endpoint added
- **2026-10-31** `00d8f4574c39`: 1 breaking
  - api path removed without deprecation
- **2026-10-31** `c41a83b8d187`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bencherdev/apis/bencher-api/changes/v0/projects/:project/github/put.md)

---

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