---
title: "Create or update server repository connection"
method: PUT
path: "/servers/{namespace}/repo"
tags: ["servers"]
---

# Create or update server repository connection

`PUT /servers/{namespace}/repo`

Upsert a GitHub repository connection for a server. Creates a new connection if none exists, or updates the existing one.

## Path parameters

- `namespace` 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-27** `12e546828dc5` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/smithery-ai/apis/smithery-platform-api/changes/servers/:namespace/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/9d53933ba12e?raw)
