---
title: "Get repository branches"
method: GET
path: "/repositories/{owner}/{repo}/branches"
tags: ["Repositories"]
---

# Get repository branches

`GET /repositories/{owner}/{repo}/branches`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/repositories/{owner}/{repo}/branches`
- Auth: HTTP bearer

## Path parameters

- `owner` string, required
- `repo` string, required

## Query parameters

- `connection_id` integer, required
- `fresh` boolean

## Response `200`

List of branches

- BranchListResponse
  - `branches` BranchInfo[], required
    - `commit_sha` string, required
    - `is_default` boolean, required: Whether this is the repository's default branch, as reported by the git provider (e.g. `main` or `master`). Clients should use this instead of guessing from the branch name.
    - `name` string, required
    - `protected` boolean, required

## Other responses

- `401`: Unauthorized
- `403`: Git provider permission required
- `404`: Repository not found
- `500`: Internal server error

## Changes

- **2026-09-11** `0597896e6540`: 1 info
  - added the required property `branches/items/is_default` to the response with the `200` status
- **2026-09-11** `8b0ca7a1320f`: 1 breaking
  - removed the required property `branches/items/is_default` from the response with the `200` status
- **2026-09-09** `961c884b4940`: 1 info
  - added the required property `branches/items/is_default` to the response with the `200` status
- **2026-09-07** `38e97c3c35dd`: 1 info
  - added the non-success response with the status `403`
- **2026-09-07** `f7404eb7ac98`: 1 info
  - removed the non-success response with the status `403`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/repositories/:owner/:repo/branches/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
