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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Adding users/groups to a repository using REST API 2.0

I am trying to add existing user/group to a bitbucket repository (public/private) using REST API 2.0. I am not able to find any endpoints available for it! Can anyone help me with it?

This might be a duplicate of the question:

But even there no answers are found!!

2 answers

0 votes

Hi @Akshay b and welcome to the community.

At the moment there is no support for adding users/groups to a repo via API 2.0 in Bitbucket Cloud. Until this is implemented, we have temporary support for 1.0 API resources that can do this.

The following endpoint can be used to send an invitation for direct repo access, see POST send an invite:

The following can be used to send an invitation to a user group, see Issue an invitation to a group:

If you want to create a new user group in a workspace, you can use the following endpoint, see POST a new group:

I hope this helps, please feel free to let me know if you have any questions!

Kind regards,

Thanks @Theodora Boudale . I was able to add groups to a repository in a different way. Check out my answer.


I was able to add groups to a repo via API 2.0 in Bitbucket Cloud. Instead of trying to add groups to a repo directly, I tired to add Branch Permission to a repository. Something like this.

curl --url "{WORKSPACE}/branch-restrictions" --user username:password --request POST --header "Content-Type: application/json" --data "{"kind": "push", "pattern": "{branch_name}","groups": [{"name": "{group_name}","type": "group", "slug": "{group_name}"}]}"

By executing this I was able to add the group to my repository and also was able to set branch permission to that group. But there is one issue, Executing this added all the available groups to the repository with admin access.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

2,570 views 1 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you