Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create list of SSH tokens, personal access tokens by user name

GSHerber
Contributor
April 9, 2026

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.

1 answer

0 votes
Arkadiusz Wroblewski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
April 10, 2026

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}

  • get your users from the admin user list
  • loop through them
  • call the HTTP token endpoint per user
  • call the SSH key endpoint per user
  • write the result out to CSV/JSON.

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.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.4.18
TAGS
AUG Leaders

Atlassian Community Events