Coregit
API Reference

Repositories

Create, list, update, and delete Git repositories via the API.

Create Repository

Permission: Master API key only.

POST /v1/repos
{
  "slug": "my-repo",
  "namespace": "alice",
  "description": "An example repository",
  "visibility": "private",
  "default_branch": "main",
  "init": true,
  "is_template": false
}
  • slug — Required. Lowercase letters, numbers, and hyphens (1–100 chars)
  • namespace — Optional. Organize repos into groups (same format as slug)
  • description — Optional (max 500 chars)
  • visibility"public" or "private" (default: "private")
  • default_branch — Default: "main"
  • init — Create an initial empty commit (default: true)
  • is_template — Mark as a forkable template (default: false)

Response 201:

{
  "id": "repo_abc123",
  "namespace": "alice",
  "slug": "my-repo",
  "description": "An example repository",
  "visibility": "private",
  "default_branch": "main",
  "is_template": false,
  "git_url": "https://api.coregit.dev/myorg/alice/my-repo.git",
  "api_url": "https://api.coregit.dev/v1/repos/alice/my-repo",
  "created_at": "2025-01-01T00:00:00Z"
}

List Repositories

GET /v1/repos?limit=50&offset=0&namespace=alice&is_template=true
  • limit — Max results (default: 50, max: 100)
  • offset — Skip items (default: 0)
  • cursor — Keyset pagination cursor (from next_cursor in previous response)
  • namespace — Filter by namespace (optional)
  • is_template — Filter to only template repos (optional, true)

Response 200:

{
  "repos": [
    {
      "id": "repo_abc123",
      "namespace": "alice",
      "slug": "my-repo",
      "description": "An example repository",
      "default_branch": "main",
      "visibility": "private",
      "is_template": false,
      "forked_from": null,
      "created_at": "2025-01-01T00:00:00Z",
      "updated_at": "2025-01-02T00:00:00Z"
    }
  ],
  "limit": 50,
  "offset": 0,
  "next_cursor": "eyJ1cGRhdGVkX2F0Ijoi..."
}

Get Repository

GET /v1/repos/:slug
GET /v1/repos/:namespace/:slug

Returns the full repository object including is_empty, git_url, and api_url.

Update Repository

Permission: Master API key only.

PATCH /v1/repos/:slug
PATCH /v1/repos/:namespace/:slug
{
  "description": "Updated description",
  "visibility": "public",
  "default_branch": "develop",
  "is_template": true
}

All fields are optional.

Delete Repository

Permission: Master API key only.

DELETE /v1/repos/:slug
DELETE /v1/repos/:namespace/:slug

Deletes the repository and all associated snapshots. Git objects in storage are cleaned up asynchronously.

On this page