Skip to main content
POST
/
api
/
bitbucket
/
repositories
/
branches
/bitbucket/repositories/branches
curl --request POST \
  --url https://api.anysite.io/api/bitbucket/repositories/branches \
  --header 'Content-Type: application/json' \
  --header 'access-token: <api-key>' \
  --data '
{
  "repo": "<string>",
  "count": 2,
  "timeout": 300,
  "query": "name~\"master\"",
  "sort": "name"
}
'
[
  {
    "name": "<string>",
    "@type": "BitbucketBranch",
    "target": {
      "hash": "<string>",
      "@type": "BitbucketCommit",
      "text": "",
      "created_at": "",
      "author_raw": "",
      "author": {
        "@type": "BitbucketAccount",
        "uuid": "",
        "display_name": "",
        "nickname": "<string>",
        "account_id": "<string>",
        "account_type": "",
        "account_status": "<string>",
        "is_staff": false,
        "location": "<string>",
        "created_at": "<string>",
        "image": "<string>",
        "web_url": ""
      },
      "parents": [],
      "repository_alias": "",
      "web_url": ""
    },
    "default_merge_strategy": "",
    "merge_strategies": [],
    "sync_strategies": [],
    "web_url": ""
  }
]

Authorizations

access-token
string
header
required

API token from the dashboard

Headers

access-token
string
required

Body

application/json
repo
string
required

Repository in 'workspace/repo' format or a Bitbucket repository URL

Minimum string length: 1
Examples:

"atlassian/aui"

"https://bitbucket.org/atlassian/aui"

count
integer
required

Number of branches to return

Required range: x >= 1
timeout
integer
default:300

Max scrapping execution timeout (in seconds)

Required range: 20 <= x <= 1500
query
string | null

Filter branches by name, e.g. 'name~"release"'

Example:

"name~\"master\""

sort
enum<string>
default:name

Sort branches by this field

Available options:
name,
-name,
-target.date,
target.date

Response

Successful Response

name
string
required
@type
string
default:BitbucketBranch
target
object | null
default_merge_strategy
string
default:""
merge_strategies
string[]
sync_strategies
string[]
web_url
string
default:""