Integrations /
List branches
Gets a list of branches for the repo
Required permission
Account > Git > General > Read
Path parameters
vcsService
string requiredVersion control provider of the repositoryrepositoryOwner
string requiredName of the owner of the repositoryrepositoryName
string requiredName of the repository
Query parameters
per_page
integerThe number of results to display per request. Maximum of 100 results per page.page
integerThe page number to access.cursor
stringThe cursor returned from the previous page of results, used to request the next page.vcs_link_id
stringIf provided, uses the given VCS link to access the repository's data.
Response body
- {object}Response object.
data
{object} requiredResult data.branches
[array]A list of branches for this repository.- {object}Details about a branch.
name
string requiredName of the branch.id
string requiredcommit
{object} requiredDetails about the most recent commit on the branch.sha
string requiredSHA identifier of the commit.message
stringCommit message of the commit.date
stringTimestamp of the commit.pagination
{object} requiredData about the endpoint pagination.hasNextPage
boolean requiredIs there another page of results available?cursor
stringThe cursor to access the next page of results.count
number requiredThe number of results returned by this request.
API
CLI
JS Client
GET /v1/integrations/vcs/repos/{vcsService}/{repositoryOwner}/{repositoryName}/branches
Example response
200 OK
The list of branches.
JSON
{
"data": {
"branches": [
{
"name": "main",
"id": "MDM6UmVmMzA0MDU5MzM0OnJlZnMvaGVhZHMvbWFpbg=",
"commit": {
"sha": "f8aca180e989be62cba71db629d2ede05f2d10c4",
"author": {
"login": "northflank"
},
"message": "Initial commit",
"date": "2021-09-17T14:04:39.000Z"
}
}
]
},
"pagination": {
"hasNextPage": false,
"count": 1
}
}