Does anyone have insight on how to create a list of SSH tokens, personal access tokens by user name in Bitbucket Data Center 9.4.18? I've tried several SQL scripts found online with AI but nothing works or produces data. Rest API maybe?
Any help would be welcome.
Hello @GSHerber
Yep, for this stop chasing SQL and use the supported REST endpoints instead.
Also one small wording point: in Bitbucket DC these are SSH keys, not really “SSH tokens”.
For the two user-level items you want, Atlassian documents these endpoints:
- personal HTTP tokens:
GET /rest/access-tokens/latest/users/{userSlug}
- personal SSH keys:
GET /rest/ssh/latest/keys?userName={userName}
One thing to watch for, I found a related Community thread where someone queried the SSH endpoint and got an empty result, so I would test the SSH call with a known user first before you build the full report.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.