Forums

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

Rest api always return 401 with my access token and email

cong wang
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!
September 3, 2025

I'm encountering a 401 error when using the newly generated access_token to access the Jira Cloud API. After some troubleshooting, I found that I can retrieve data when accessing the link https://merico.atlassian.net/rest/api/2/myself via the web page, but the emailAddress field shows my email address before the modification. Additionally, I tried accessing the API using both the old and new email addresses along with the API token, but both attempts resulted in a 401 error.

2 answers

0 votes
sai chinamuthevi
Contributor
September 3, 2025

Hi,

Can you please share what endpoint you are trying to access and cross verify if you have access to specific project you are accessing through endpoints

cong wang
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!
September 3, 2025

The same endpoint as the web url I tested: /rest/api/2/myself

I don't think it require any additional privilege.

Tested Both curl and python script.

0 votes
Mohanraj Thangamuthu
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 3, 2025

Hello, Good day. Could you share the steps that you followed to create API token. Also provide the API end point that you are getting 401. Thanks!

cong wang
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!
September 3, 2025

The same endpoint as the web url I tested: /rest/api/2/myself

I don't think it require any additional privilege.

Tested both curl and python script.

 

from jira import JIRA
username = 'email'
token = 'token'

client = JIRA(
server="https://merico.atlassian.net",
basic_auth=(username, token)
)

print(client.myself())

 

Like Mohanraj Thangamuthu likes this
Mohanraj Thangamuthu
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 3, 2025

Thanks, I hope you are following the steps shown in https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/ to create the API token.

 

If possible please try once from postman, select basic auth method and use the email address and API token. Thanks!

cong wang
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!
September 4, 2025

image.png

I tried testing with Postman, but it still returned a 401 error.

Mohanraj Thangamuthu
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 4, 2025

Thanks. This looks correct. To make sure this API token is created from the same user account?. Could you generate a new token and check the status?

What happens when you try different end point, like to GET a specific work item?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events