---
title: "Create a new repo"
method: POST
path: "/api/repos"
tags: ["Repos"]
---

# Create a new repo

`POST /api/repos`

## Request body

- object
  - `url` string, required
  - `name` string, required
  - `clonePath` string
  - `defaultBranch` string
  - `autoClone` boolean
  - `hooks` RepoHooks
    - `enabled` boolean
  - `guidelines` RepoGuidelines, nullable
    - `prChecks` string[], required
    - `mergeChecks` string[], required
    - `allowMerge` boolean
    - `review` string[], required

## Response `201`

Repo created

- SwarmRepo
  - `id` string, uuid, required
  - `url` string, required
  - `name` string, required
  - `clonePath` string, required
  - `defaultBranch` string
  - `autoClone` boolean
  - `hooks` RepoHooks
    - `enabled` boolean
  - `guidelines` RepoGuidelines, nullable
    - `prChecks` string[], required
    - `mergeChecks` string[], required
    - `allowMerge` boolean
    - `review` string[], required
  - `createdAt` string, required
  - `lastUpdatedAt` string, required

## Other responses

- `400` — Validation error
- `409` — Duplicate repo

---

[API](https://skmtc.net/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.net/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/versions/0375890be8c4/schema)
