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

Granting access for existing group to a private repository using REST API 2.0

Vinay Cheguri April 20, 2022

I am trying to add an existing group to a private bitbucket repository using REST API 2.0. I am not able to find any endpoint or curl command in the documentation.

I came across a similar question asked in 2020, and one of the answers says "At the moment there is no support for adding users/groups to a repo via API 2.0 in Bitbucket Cloud".

Is it still the same or now the REST API 2.0 support for adding groups?

1 answer

1 accepted

1 vote
Answer accepted
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2022

Hi @Vinay Cheguri

Welcome to the community.

Unfortunately, there's still no API 2.0 endpoint for adding user groups to a repository.
However, until we get a replacement for it, you can continue to use the API version 1 for adding user groups to a repository.

You can check the documentation on this link (Under "PUT group privileges on a repository") for more information.

Here's the exact endpoint:

PUT https://api.bitbucket.org/1.0/group-privileges/{workspace_id}/{repo_slug}/{group_owner}/{group_slug} --data "{privilege}"

As an example, if your repository is: some_workspace/some_repo

And your user group name is: some_group

The API endpoint would look like these in a CURL command:

curl --request PUT --user bb_username:app_password https://api.bitbucket.org/1.0/group-privileges/some_workspace/some_repo/some_workspace/some_group --data read

Btw, please also make sure you're using an App password (as your password credential) as we recently deprecated the Atlassian account password.

Hope it helps and do let me know if you have further questions that I can help with.

Regards,
Mark C

Vinay Cheguri April 21, 2022

Thanks, @Mark C  for providing the replacement option

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events