List a Bitbucket Cloud repository's branches
import requests
url = "https://platform.ankra.app/org/bitbucket-cloud/{credential_id}/branches"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://platform.ankra.app/org/bitbucket-cloud/{credential_id}/branches', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/bitbucket-cloud/{credential_id}/branches \
--cookie ankra_session={
"branches": [
{
"name": "<string>"
}
],
"default_branch": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Credentials
List a Bitbucket Cloud repository's branches
Lists the branches of a Bitbucket Cloud repository through a stored Bitbucket Cloud credential, for the repository and branch pickers. The credential must belong to the caller's organisation, and a personal credential must be the caller's own; any other id answers 404. Every page Bitbucket returns is followed, and default_branch is the repository's main branch, or null for an empty repository. A listing that cannot be read whole is refused with a 422 rather than answered partially, including a repository with more than 5000 branches. A 422 whose remedy is reconnecting the credential carries detail {message, error_code: bitbucket_cloud_credential_invalid}; any other failure Bitbucket reports is a plain-string detail.
GET
/
org
/
bitbucket-cloud
/
{credential_id}
/
branches
List a Bitbucket Cloud repository's branches
import requests
url = "https://platform.ankra.app/org/bitbucket-cloud/{credential_id}/branches"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://platform.ankra.app/org/bitbucket-cloud/{credential_id}/branches', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/bitbucket-cloud/{credential_id}/branches \
--cookie ankra_session={
"branches": [
{
"name": "<string>"
}
],
"default_branch": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Browser session. Mutations also require X-Ankra-CSRF.
Path Parameters
Query Parameters
The Bitbucket Cloud workspace slug.
Minimum string length:
1The repository slug within the workspace.
Minimum string length:
1Response
The repository's branches and its default branch