Forums

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

All API calls return 401 Unauthorized, regardless of the authentication method used.

Penny
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 11, 2026

Hello Bitbucket Support Team,

We are facing an authentication issue with Bitbucket REST API. We are trying to integrate Bitbucket with an AWS Lambda function to fetch PR and pipeline data for our internal DevOps chatbot.

Problem: All API calls return 401 Unauthorized, regardless of the authentication method used.

What we have tried:

  1. HTTP Access Token (Bearer): Generated from Repository Settings → Access tokens. Returns 401.
  2. Basic Auth (email + App Password): The "App passwords" option is not visible in our Bitbucket account settings. We cannot find it under Personal Settings.
  3. Basic Auth (email + HTTP Access Token): Also returns 401.

Our setup:

Questions:

  1. Why is "App passwords" not available in our account settings?
  2. Is our account on Bitbucket Cloud or Bitbucket Data Center? (Authentication methods differ)
  3. What is the correct way to authenticate REST API calls for our workspace?

Please advise on the correct authentication method for our account.

Thank you,
Penny
Tracxsystems DevOps Team

1 answer

0 votes
Derek Fields _RightStar_
Community Champion
March 11, 2026

@Penny It appears that you are on Bitbucket Cloud since that is the URL that you are using. If you are on Data Center, you would be calling a URL on your Data Center instance. Is your repo at https://bitbucket.org/tracxsystems/<repo slug>? If so, then you are on Cloud. If your repo is at something like https://tracxsystems.com:<port>/... then you are on Data Center.

App passwords are no longer supported for APIs. you either need to generate an API Token associated with your account or set up OAuth for authentication. To set up an API token, you would go to your avatar and select Account Settings. From there, you would select Security and scroll down until you see API Tokens. Create a new token and submit it just the way you indicate above using Basic authorization. 

You need to use Scoped Tokens for Bitbucket Cloud. I tested it with Classic (non-scoped) and it didn't work. When I created a Scoped Token, it worked for me.

Hope this helps. Good luck.

Suggest an answer

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

Atlassian Community Events