Forums

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

Is there a way to change the branching model configuration using the Bitbucket v2 API

Bharath Singireddy December 29, 2018

currently, we are using the bitbuckets new branching model.
we currently have around 30 feature repositories and its kind of a pain to set the same configuration manually on all those 30 repositories.
i wanted to know if there is an API endpoint where I can do a  POST or PUT to all the repositories and have the same configuration on all them.
FYI, We are using BitBucket Cloud

1 answer

0 votes
Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 30, 2018

Hi @Bharath Singireddy,

Reviewing the endpoint used by Bitbucket Cloud in Branching Model (you can hit the following on your web browser - https://bitbucket.org/!api/internal/repositories/USERNAME/REPOITORY_SLUG/branching-model/settings - replacing USERNAME and REPOSITORY_SLUG) we can notice an internal API is being used.

At the same time, reviewing public API available to Bitbucket Server, there is only a GET on branchmodel (https://docs.atlassian.com/bitbucket-server/rest/5.16.0/bitbucket-branch-rest.html). For this reason, it seems there is no POST or PUT method available using API v2.

Perhaps you could visit https://bitbucket.org/USERNAME/REPOSITORY_SLUG/admin/branching-model and get the PUT http request that is being issued when saving the branching model configuration.

Bharath Singireddy December 31, 2018

Hello Rafeal,
Thanks for the response to my query.
i tried internal API's which you mentioned and I get a 401 unauthorized error.
I am using the basic authentication to call the internal API's.I am actually the admin for the account but still, I get a 401.
do u know if I have to use some other authentication type?

Thanks 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events