---
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

## Changes

- **2026-03-26** `81a4d07f1a76` — 1 info
  - added the new optional request property `data/attributes/pipeline`
- **2026-03-26** `57ca08879f22` — 4 info
  - added the optional property `data/attributes/pipeline_id` to the response with the `200` status
  - added the optional property `data/attributes/pipeline_id` to the response with the `201` status
  - added the optional property `data/links` to the response with the `200` status
  - added the optional property `data/links` to the response with the `201` status
- **2026-03-13** `d96e70b5a1ae` — 3 info
  - added the new optional request property `data/attributes/upstream_url`
  - added the optional property `data/attributes/upstream_url` to the response with the `200` status
  - added the optional property `data/attributes/upstream_url` to the response with the `201` status
- **2026-02-19** `41466db231c5` — 8 warning
  - removed the request property `data/attributes/pipeline`
  - removed the request property `data/attributes/upstream_url`
  - removed the optional property `data/attributes/pipeline_id` from the response with the `200` status
  - removed the optional property `data/attributes/pipeline_id` from the response with the `201` status
  - …4 more

[Change history](https://skmtc.dev/helixml/apis/kodit-api/changes/repositories/post.md)

---

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