Forums

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

Manage API Tokens of JIRA users

badong.jm December 15, 2023

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?

1 answer

1 accepted

1 vote
Answer accepted
Sunny Ape
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 Leaders.
December 15, 2023

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.

badong.jm December 18, 2023

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?

Sunny Ape
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 Leaders.
December 18, 2023

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.

badong.jm December 18, 2023

@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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events