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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Bitbucket api creating repository

We are using rest apis for creating repositories, inviting team members, creating branches, restricting its permissions etc. but we want that token with limited permissions, current token seems admin and has repository deletion permissions as well, and we dont want that, any idea howe we can make it limited access?

1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 16, 2023

Hello @PravinU and welcome to the Community!

Currently, the OAuth scope repository:admin is required to execute most of the actions that you listed. Unfortunately, there's not a particular scope that includes all the actions you listed, except repo deletion. The admin scope also comes with the ability to delete the repository.

You can have a full description of what is included in each scope in the following documentation : 

Based on that list, you may adjust your scopes accordingly to the action being performed, and restrict the admin scope to only the API calls where it is strictly necessary.

Thank you, @PravinU !

Patrik S

Ohh, thanks.

Is there any way to restrict admin apis from ip etc? This seems issue for us if we expose api token with admin access, also is there any way to recover deleted repo is its done by mistake?
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 21, 2023

Hello @PravinU ,

If your workspace is under the premium plan, you can restrict access to the workspace to particular IPs by leveraging the IP allowlisting feature. However, this will restrict any access to the workspace originating from IPs that are not on the list. This includes both the API and UI access. It's not possible to limit only the admins APIs.

As for the repository deletion, support can help to recover if the repository was deleted within the last 7 days. You can open a support request on the following portal: 

Also, given that git is a distributed version control system, any previous clone that you or any member of your team have can also be considered a backup of the repo, as it contains the history of the repository. If that is the case, you can create a new repository and push the local backup repo to the new repo.

Thank you, @PravinU !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events