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