API Token expires without any notification. How to prevent that?

Abhi Srivastava
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!
June 5, 2023

Hi team,
Greetings!

At times, the API token expires without giving any notification. It has been at two scenarios:
1.) While trying forge login command in CLI: it gives cannot login invalid credentials, then I went to check my token it was revoked automatically. I created new and tried forge login with new token it worked.

2.) While developing forge application: we were using the rest api and while using that we were passing email id and token as basic auth but I was getting error as “Uncaught (in promise) Error: There was an error invoking the function - Unexpected token < in JSON at position 0”

I am aware that the API token has no expiration until we revoke, but I am unable to get why my token expires. Even if it expires it does not give any email notification.
Could you please guide us on this.

1 answer

1 accepted

0 votes
Answer accepted
Mahtab
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 26, 2024

Hi team,

By design, the User API tokens do not expire by default (This will however change soon per the new announcements from Atlassian )

So for the existing APIs that has been created to this date, when we set them up, there is no expiration date to be selected, and they are valid until they are intentionally revoked. Source: View user API tokens

 The main reason if the token would get revoked by Atlassian is if they are being used in public spaces as described in the following documentation: 

 Referring to Understand user API tokens , your org admin can also manage the user tokens and revoke if they see it necessary. So that is another possibility as we have seen org admins try to clean up user tokens without consulting with their users.  

https://admin.atlassian.com/o/ORGID/api-tokens

Hope this helps

Suggest an answer

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

Atlassian Community Events