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

API to Delete user from Repository

Rahul Jakhmola September 22, 2020

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
Atlassian Team members are employees working across the company in a wide variety of roles.
September 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

Rahul Jakhmola September 23, 2020

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

Rahul Jakhmola September 24, 2020

Hi Daniel - Please reply !

Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 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

Rahul Jakhmola September 29, 2020

Thank you Daniel for the help :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events