Currently the API tokens generated by users in JIRA do not have expiry dates. This is against our policy that development tokens should only be valid until 90 days after which it should be renewed or revoked. I know administrators can manually revoke API tokens but with thousands of users I don't think it's feasible to do it that way.
Does anyone know if there is a JIRA Cloud REST API (3) end point that can allow me to get API tokens of users, this way I can build something that I can run monthly to automate reminder emails for users before we automatically revoke them?
Hello @badong.jm
There are no Jira Cloud REST API endpoints to manage user tokens.
You must use the API Tokens endpoints from the Cloud Admin APIs to GET and / or DEL user tokens instead of doing it manually using the GUI.
Hi @Sunny Ape thank you for the response. I tried using this endpoint https://api.atlassian.com/users/<account Id>/manage/api-tokens both in Postman and test python codes but getting 401 Unauthorized on both.
I know that the token works since I use it to call https://jira-pg.atlassian.net/rest/api/3/user?accountId=<account ID> with no issue.
Any idea what I might be missing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea what I might be missing?
Yep. You probably just didn't read the Admin APIs documentation properly.
You must use a key + token for an ORGANISATION ADMINISTRATOR not just any old plain user's key + token.
Only once you have that super special key + token, which only Organisation Admins can create, then can you access those endpoints.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sunny Ape Thanks for the idea, I'm actually an Org Admin. I was able to get this working by generating an Admin API Key. Was not aware that it would be different than the persornal API Key.
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.