Forums

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

Do we get the API token expiry date through rest API

Naveen Kumar C
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 24, 2024

I need to know the Rest API to see the API Token of the current user espiry date. Do we have such Rest API. Please help me

2 answers

1 vote
Nikola Perisic
Community Champion
November 24, 2024
amo March 3, 2025

Hi @Nikola Perisic 

As per December 15 2024 now the APi tokens shall have a expiring date

See API tokens will now have a maximum one‑year expiry - Atlassian Community

From this prospective It would be useful to have a Rest API that can read the users API tokens and expiring date to be able to be notified and take actions

Do you know if Atlassian is thinking about this rest API?

Thanks

Alberto

Nikola Perisic
Community Champion
March 3, 2025

Hello @amo 

Yes Atlassian did include the expiry date for the API token.

https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/

I am not aware that Atlassian will provide the REST API endpoint for this one, but it is a good idea indeed.

 

amo March 3, 2025

Hi @Nikola Perisic 

Do you know if there is a place where we can suggest this new API to Atlassian? Something like a Jira Backlog for proposals.

BR

Alberto

Nikola Perisic
Community Champion
March 3, 2025
amo March 3, 2025

Hi @Nikola Perisic 

Ok thanks for the info

BR

Alberto

amo March 5, 2025

For the next one searching the possibility to read the Jira API tokens there is actually already an API

The API Access REST API

You need to use an Jira API Key as Bearer token

e.g. in Powershell


$headers = @{
    Authorization = "Bearer $apiKey"
    ContentType   = "application/json"
}

Hope this helping someone else :-)
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.
March 14, 2025

You need to use an Jira API Key as Bearer token

I think you're mistaken. Access to the API Access REST API is restricted to Org Admins and requires the use of an Organization API Key.

A 'plain' Jira (user) API Key will not work.

amo March 14, 2025

hi @Sunny Ape 

yes indeed. I have used the organisation API token as bearer token and it is working fine. Thanks for the info

the API I have mentioned is indeed a Org Rest API 

but good point

0 votes
Tomislav Tobijas
Community Champion
November 24, 2024

Hi @Naveen Kumar C ,

I'm not sure if API for this exists but you might want to check the following developer documentation: https://developer.atlassian.com/cloud/admin/organization/rest/intro/#About

Also, if you're using Atlassian Guard (Standard or Premium), from the Admin Hub you can view all API tokens for managed users. However, I've just tested this and it seems that you cannot see the token expiry date, whether from the Admin Hub or when you export that data into CSV. More about viewing user API tokens can be found here:  https://support.atlassian.com/organization-administration/docs/view-user-api-tokens/

Might be worth a shot to try to reach out Atlassian Support and ask them directly about it.

Cheers,
Tom

Suggest an answer

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

Atlassian Community Events