Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Does Jira / Atlassian API give you an easy way to check if your PAT is still valid

AJP
Contributor
February 20, 2024

I want to automate using Jira as part of our deployment processes but it's not clear to me that there's a PAT (personal access token) endpoint that allows you to determine if your access token is still valid or not.  I would use some other endpoint like one to get your profile or an issue but this also requires setting the account_id for each developer or some random issue id which seems like a fragile and unnecessarily burdensome workaround solution.

How do other people determine if their PAT is still valid for use with the API for Jira as part of an automated process / workflow?

 

2 answers

1 accepted

3 votes
Answer accepted
Nikola Perisic
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2024

Welcome to the community @AJP !

Sadly, there are no validators for PAT's. To find more information about the API and PAT's, you can refer to this page: https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html

Bear in mind that this is for the server version.

0 votes
David Bakkers
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.
February 20, 2024

Hello @AJP 

If a user makes a call to the Get current user endpoint with an invalid key + token, they will get a 401 error. Ergo, by inverse logic, if they get a normal response, their key + token is valid.

PS. The term 'Personal Access Token' or 'PAT' refers to the Jira Server / Data Centre platform. On the Cloud platform, they are just called 'API tokens' to differentiate them.

Suggest an answer

Log in or Sign up to answer