I want to return all users in our bitbucket projects which are project administrators using a rest API as I couldn't find an option on audit logs
Hey Thembela — great question. Bitbucket’s REST API doesn’t provide a single direct endpoint to list all project admins across all projects, but here’s a workaround approach that works well:
Get all projects
Use this to list your projects:
GET /rest/api/1.0/projects
This returns a list of project keys.
Get project permissions
For each project key, run:
GET /rest/api/1.0/projects/{projectKey}/permissions/users
This will return all users with any level of access. You'll need to filter by PROJECT_ADMIN
permission from the response.
(Optional) Also check group permissions
If you’re assigning admin rights via groups, also run:
GET /rest/api/1.0/projects/{projectKey}/permissions/groups
Then map users from those groups separately.
This process can be scripted using Python or any HTTP client to loop through all projects and compile a full list of admins.
Let me know if you’d like a script template happy to send one over or walk through it in DM if that helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.