---
title: "Get repository branches"
method: POST
path: "/api/v1/repositories/branches"
tags: ["Repositories"]
---

# Get repository branches

`POST /api/v1/repositories/branches`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v1/repositories/branches`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Fetches available branches for a linked repository. Supports GitHub, GitLab, Bitbucket, Azure DevOps, Gerrit, CVS, and Generic Git. CVS exposes its single materialized branch.

## Request body

- union
  - object
    - `organizationId` string
    - `repositoryId` string, required
    - `externalGithubRepositoryId` string
    - `search` string
    - `page` integer
  - object
    - `organizationId` string
    - `repositoryId` string
    - `externalGithubRepositoryId` string, required
    - `search` string
    - `page` integer

## Response `200`

Successful response

- RepositoryBranches
  - `defaultBranch` string, required
  - `branches` string[], required
  - `hasMore` boolean, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized

---

[API](https://skmtc.dev/zeropath/apis/zeropath-api-2.md) - [All operations](https://skmtc.dev/zeropath/apis/zeropath-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/zeropath/apis/zeropath-api-2/revisions/ea6ae4b68cd3?raw)
