Forums

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

Can we refresh basic auth token?

Madhav sharma
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!
March 19, 2026

 

  • To create a service account:

    1. Go to  Atlassian Administration. Select your organization if you have more than one.

    2. Select Directory > Service accounts.

    3. Select Create a service account.

    4. For the service account name, enter an alphanumeric name with 6 to 30 characters.

    5. For the optional description, enter the name of a person or app that uses the account.

    6. Select roles for the apps that the service account needs to access. You can also add the service account to a group.

    7. Select Create.



    I have followed all the steps to create a service account in Atlassian Administration. Currently, I am using the REST API with Basic Authentication to fetch data.

    However, I would like to know if there is a way to automatically refresh the token via a script instead of manually generating a new token each time it expires. My goal is to create the token once and handle renewal programmatically without manual intervention.

 

2 answers

1 accepted

4 votes
Answer accepted
Florian Bonniec
Community Champion
March 19, 2026

Hi @Madhav sharma 

 

You may want to implement Oauth2 for this.

https://support.atlassian.com/user-management/docs/create-oauth-2-0-credential-for-service-accounts/

You will then be able to use the secret and client id to request a token.

 

Regards

0 votes
Arkadiusz Wroblewski
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 Champions.
March 19, 2026

Hello @Madhav sharma 

If the token needs to be replaced, the normal approach is simply to create a new API token and update your integration with that new value. If needed, revoke the old one afterwards.

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