Hi Community,
I need to know is there any REST endpoint for Bitbucket server to fetch all users who have created HTTP access tokens.
I have more than 2000 users using Bitbucket and it is time consuming if I go and search each and every users account details. So, that's why need to know if any endpoint is available to ease this work.
Could you please help me with this?
Thanks,
Jayanth
Hello @Jayanth
you may want to clarify the deployment first, because your post says Bitbucket server, but the thread is tagged Bitbucket Cloud?
If you really mean Server / Data Center, then I do not know a single endpoint that gives you one full list of all users who created personal HTTP access tokens across the whole instance. What you usually have is a per-user check, so for 2000 users this normally means querying it user by user.
If you actually mean Cloud, then you are looking at a different token model entirely.
Hello @Arkadiusz Wroblewski
Thanks for your response.
Yes, I'm asking this for Bitbucket Data Center. If there is no endpoint for full list of users with HTTP token created, is there any other endpoint to get HTTP token details for single user search?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jayanth
Yes, there is a per-user endpoint for Bitbucket Data Center.
GET /rest/access-tokens/1.0/users/{userSlug}
This returns the HTTP access tokens created by that user. There's no single admin endpoint that lists all tokens across all users in one call, but you can script around that: paginate through all users via GET /rest/api/1.0/admin/users and call the tokens endpoint for each user slug. It's not elegant for 2000 users, but it's fully automatable in a simple script.
Just make sure the account running the queries has admin-level access, as the access-tokens endpoint requires it for querying other users' tokens.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.