Jobs /
Get job branches
Gets information about the branches of the given job.
Required permission
Project > Jobs > General > Read
Path parameters
projectId
string requiredID of the projectjobId
string requiredID of the job
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.
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/projects/{projectId}/jobs/{jobId}/branches
Example response
200 OK
Data about the job's available 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
}
}