---
title: "Connect a repository"
method: PUT
path: "/servers/{qualifiedName}/repo"
tags: ["servers"]
---

# Connect a repository

`PUT /servers/{qualifiedName}/repo`

Create or update the GitHub repository connection. Idempotent — updates if a connection already exists.

## Path parameters

- `qualifiedName` string, required

## Request body

- object
  - `repoOwner` string, required
  - `repoName` string, required
  - `baseDirectory` string
  - `branch` string, nullable
  - `autoDeploy` boolean

## Response `200`

Repository connection created or updated

- object
  - `repoOwner` string, required
  - `repoName` string, required
  - `baseDirectory` string, required
  - `branch` string, nullable, required
  - `autoDeploy` boolean, nullable, required
  - `isPrivate` boolean, required
  - `type` 'github', required

## Other responses

- `400` — Bad request (invalid input)
- `403` — Forbidden (user doesn't own server, GitHub App not installed, or missing permissions)
- `404` — Server not found

## Changes

- **2026-01-25** `55f4a37b970f` — 1 breaking
  - api path removed without deprecation
- **2026-01-25** `ea538dc2369a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/smithery-ai/apis/smithery-platform-api/changes/servers/:qualifiedName/repo/put.md)

---

[API](https://skmtc.dev/smithery-ai/apis/smithery-platform-api.md) · [All operations](https://skmtc.dev/smithery-ai/apis/smithery-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/smithery-ai/apis/smithery-platform-api/revisions/01f97a60fd96?raw)
