Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it possible to get list of users having access to specific branch in bitbucket through API ?

Veera Durai
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!
September 30, 2024

We are using bitbucket and having lot many branches created on it. I need to collect list of users having access to each branch. Can I use API method to accomplish this task ?
If yes. Kindly share the link to refer the documents.

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2024

Hi Veera and welcome to the community!

Do you use Bitbucket Cloud or Bitbucket Data Center? The APIs for each product are different. If you are unsure, the URL of a Bitbucket Cloud repo on your browser starts with https://bitbucket.org/, while Bitbucket Data Center repos have a different, custom URL.

When you say "users having access to specific branch", I assume you mean access via branch restrictions?

If so, and if you use Bitbucket Cloud, you can use the following API endpoint:

Please note that this will return the branch restrictions that are set up on a certain repository. Project branch restrictions cannot be retrieved via API yet, we have the following feature request: https://jira.atlassian.com/browse/BCLOUD-22732

I'm not sure about Bitbucket Data Center, as I specialize in Cloud, but you can check the REST APIs for Bitbucket Data Center (latest version, 9.2) here:

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events