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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.