Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

API to Delete user from Repository

Hi Experts,

I have a task to delete user from repository. Can anyone guide me how would I develop the same workflow and to reach it how many APIs I need to call. Please guide me where would I get all the Bitbucket APIs including Delete user API.

Thanks!
Rahul

1 answer

1 accepted

1 vote
Answer accepted
Daniel Eads Atlassian Team Sep 22, 2020

Hi Rahul, welcome to the Community!

The APIs you'll use depend on if you're using Bitbucket Server / Data Center (run on-premise on your own server) or if you're on Bitbucket Cloud (the address is bitbucket.org).

Hopefully those references are the starting point you need to fulfill your task.

Cheers,
Daniel

Hi Daniel,

Thank you so much for replying. Please don't mind if I keep this thread open for sometime. We are using on premise Data Server. Could you please tell how would I know that in how many repositories a user has access on. Please help me with API I need to call for it.

Regards,
Rahul

Hi Daniel - Please reply !

Daniel Eads Atlassian Team Sep 29, 2020

Hi Rahul,

The REST API doesn't have an endpoint that would return all the repositories a user has access to. You would need to paginate through the repo/projects individually and check the permissions for the particular user or groups they are a member of.

If you are trying to remove all permissions for a user, I would recommend disabling the user instead. You can use the admin/users endpoint to disable them, and get details if their user is coming from the internal directory or an external managed directory. Disabling users also has the benefit of reducing your licensed user count.

Cheers,
Daniel

Thank you Daniel for the help :)

Suggest an answer

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

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,441 views 4 7
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