---
title: "Create Git Repository"
method: POST
path: "/api/v1/git-repositories/"
tags: ["git-integration", "Git Integration"]
---

# Create Git Repository

`POST /api/v1/git-repositories/`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/git-repositories/`
- Auth: none declared

Create a new git repository configuration.

Args:
    repository_data: Repository creation data
    ctx: Application context with session, user, and company info

Returns:
    StandardResponse with created repository

## Headers

- `Authorization` string

## Request body

- GitRepositoryCreate: Schema for creating a git repository.
  - `provider_id` string, required: Git provider public ID (UUID)
  - `repository_name` string, required: Repository name
  - `repository_url` string, uri, required: Full repository URL (e.g., https://github.com/org/repo)
  - `default_branch` string: Default branch name
  - `sync_method` 'webhook' | 'polling' | 'manual': Repository synchronization method.
  - `polling_interval_minutes` integer: Polling interval in minutes (5-1440)

## Response `201`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
