---
title: "Link repositories to a project"
method: POST
path: "/repos"
tags: ["Repos"]
---

# Link repositories to a project

`POST /repos`

Link repositories to a project by access source id. Select only one access source per repository; re-linking an already-linked repository refreshes its selected access source.

## Request body

- object
  - `projectId` string, uuid — Project to link the repositories to. Auto-filled from CLI and SDK context when omitted.
  - `accessSourceIds` string[], required — Access source ids (from repos.list) to link. Select only one access source per repository.

## Response `200`

OK

- object
  - `repos` object[], required — The now-linked repositories.
    - `id` string, uuid, required — Repository row id — stable across access sources; use it as the path id for repos.remove.
    - `accessSourceId` string, uuid, required — Access source granting this view of the repository (GitHub App installation, personal connection, or integration). Pass to repos.add to link the repository through this source.
    - `source` 'githubApp' | 'personal' | 'integration', required — Kind of access source granting this view: an organization GitHub App installation, the caller's personal forge connection, or an organization integration.
    - `sourceLabel` string, required — Display label for the access source (e.g. "GitHub app", "Personal").
    - `provider` 'github' | 'bitbucket', required — Forge hosting the repository.
    - `owner` string, required — Repository owner (user or organization).
    - `name` string, required — Repository name without the owner.
    - `fullName` string, required — Full name in owner/name form.
    - `defaultBranch` string, nullable, required — Default branch, when the forge reports one.
    - `isPrivate` boolean, required — Whether the repository is private.
    - `linked` boolean, required — Whether the repository is already linked to the project.

---

[API](https://skmtc.dev/sazabi/apis/sazabi-public-api.md) · [All operations](https://skmtc.dev/sazabi/apis/sazabi-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sazabi/sazabi-public-api/revisions/1d12b71c735a/schema)
