---
title: "Add repository"
method: POST
path: "/repositories"
tags: ["repositories"]
---

# Add repository

`POST /repositories`

Add a new Git repository to track

## Request body

- DtoRepositoryCreateRequest
  - `data` DtoRepositoryCreateData
    - `attributes` DtoRepositoryCreateAttributes
      - `pipeline` string — Optional pipeline name; looked up by name and assigned to the repository (defaults to the system default pipeline)
      - `remote_uri` string
      - `upstream_url` string — Optional canonical upstream URL; used for deduplication when multiple clone URLs point to the same repo
    - `type` string

## Response `200`

Repository already exists

- DtoRepositoryResponse
  - `data` DtoRepositoryData
    - `attributes` DtoRepositoryAttributes
      - `cloned_path` string
      - `created_at` string
      - `last_scanned_at` string
      - `num_branches` integer
      - `num_commits` integer
      - `num_tags` integer
      - `pipeline_id` integer
      - `remote_uri` string
      - `tracking_branch` string
      - `updated_at` string
      - `upstream_url` string — The canonical upstream URL (e.g. github.com/org/repo); falls back to remote_uri when not set
    - `id` string
    - `links` DtoRepositoryLinks
      - `pipeline` string
    - `type` string

## Other responses

- `201` — Repository created
- `400` — Bad Request
- `500` — Internal Server Error

---

[API](https://skmtc.net/helixml/apis/kodit-api.md) · [All operations](https://skmtc.net/helixml/apis/kodit-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/helixml/kodit-api/versions/3f72fa58f3fb/schema)
