Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Collect information via API for bitbucket datacenter

Itay Semel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 18, 2025

We are using a compliance orchestration tool which fetch data for compliance monitoring and evidence collection.

 

We are using Bitbucket datacenter and would like to know:

 

  1. is it possible to extend current branches API with additional information about : branch rules, branch commits, required checks etc.
  2. is there any other endpoints which allows to collect this information for each branch?

 

We would like to collect the following:

 

  1. Branch protection rules
  2. Number of required approvals
  3. Required checks (builds)

 

 

1 answer

1 vote
Mehul Chauhan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 23, 2025

Hi Itay Semel,

  • Direct Extension: The standard Bitbucket Data Center REST API for branches (/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches) does not natively include branch protection rules, required approvals, or required checks in its response. It primarily returns metadata about branches (name, latest commit, etc.).

  • Custom Extension: To include additional compliance data in a single API call, you would need to build a custom integration or service that aggregates data from multiple endpoints (see below).

Reference:
The Bitbucket Data Center REST API

Summary Table

Requirement

Endpoint

Notes

Branch protection rules

/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions

Lists all branch restrictions (write, merge, etc.)

Required approvals

/rest/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/conditions

Lists reviewer/approval requirements per branch pattern

Required checks (builds)

/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests

Lists merge checks, including required builds

Build status (per commit)

/rest/build-status/1.0/commits/{commitId}

Shows build status for a specific commit

Details regarding each api are referenced below.
Reference:
The Bitbucket Data Center REST API

Hope this answer helps.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events