Skip to content
Kapten
Esc
↑↓navigate↵open⌘Jpreview

List repository branches

Returns a repository’s branches, read from GitHub, once the installation is checked to still have access to the repository.

GET/integration/github/installations/{installation_id}/repositories/{repository_id}/branches
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT token passed in the Authorization header using the Bearer <token> format.

Path parameters
installation_iduuidrequired

Kapten UUID of the GitHub installation binding.

repository_idstringrequired

Immutable GitHub repository ID encoded as a decimal string.

matches ^[1-9][0-9]*$
Query parameters
pageinteger

One-based GitHub page number.

min 1 · default: 1
per_pageinteger

Number of GitHub records returned per page.

min 1 · max 100 · default: 50
Responses
200

Live GitHub branches retrieved

recordsgithub_branch[]required
Show properties
Array of github_branch
namestringrequired
head_shastringrequired
protectedbooleanrequired
pageintegerrequired
min 1
per_pageintegerrequired
min 1 · max 100
next_pageinteger | null
min 1
422

Installation or repository is inactive or inaccessible

codeinteger<int32>required
messagestringrequired
reasonstring

Optional stable machine-readable reason for programmatic error handling

503

GitHub is temporarily unavailable

codeinteger<int32>required
messagestringrequired
reasonstring

Optional stable machine-readable reason for programmatic error handling

default

Error

codeinteger<int32>required
messagestringrequired
reasonstring

Optional stable machine-readable reason for programmatic error handling

Request
curl -X GET 'https://api.kapten.io/integration/github/installations/497f6eca-6276-4993-bfeb-53cbbbba6f08/repositories/string/branches' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "records": [
    {
      "name": "string",
      "head_sha": "string",
      "protected": true
    }
  ],
  "page": 1,
  "per_page": 1,
  "next_page": 1
}

Was this page helpful?