What is the API endpoint for the "User and group access" page of repository settings?

Tim Eichholz March 22, 2019

I am looking for the Rest API endpoint for this section of the repository configuration.

 

Thank you.

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 25, 2019

Hello Tim and welcome to the Community!

The Bitbucket cloud is going through a depreciation of the v1 REST API which is removing multiple endpoints and reducing some endpoints to only have the verb of GET, meaning you will no longer be able to manage permissions within Bitbucket cloud via the REST API.

As far as which permission endpoints you do have access to, you can review the following to see which endpoints allow you to view data; Bitbucket Cloud REST API | Permissions.

Additional information on the depreciation of the v1 API along with which v2 endpoints (if applicable) are replacing v1 endpoints can be found at Deprecation notice - Bitbucket Cloud REST API version 1 is deprecated effective 30 June 2018.

I hope this proves helpful and you’re able to find the v2 endpoints you need.

Regards,
Stephen Sifers

Richard Killeen August 25, 2023

Hi I am getting the following error message "Error setting permissions for repository repo_name 403 - This endpoint does not support token-based authentication" I am not using token based authorization. This is the method in the python script I use: 

 

def set_repository_permissions(username, password, destination_workspace, repo_name, source_repo_permissions):
destination_repo_permissions_url = f"https://api.bitbucket.org/2.0/workspaces/{destination_workspace}/permissions/repositories/{repo_name}"
print(destination_repo_permissions_url)
headers = {
"Content-Type": "application/json",
}
for permission in source_repo_permissions:
response = requests.post(destination_repo_permissions_url, auth=(username,password), json=permission, headers=headers)
if response.status_code != 201:
print(f"Error setting permissions for repository {repo_name}: {response.status_code} - {response.text}")
print(f"Permissions set for repository {repo_name}.")

 

Is there a reason it returns that particular error message
                                                      

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events