Forums

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

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