Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


I am trying to create an app for my workspace usin atlassian-python-api package but can't call APIs.


Hi everyone, I am new here. So it might be the case that I am missing something. It would be of great help if someone could guide me through the process. I wrote the following python code to try and get a list of all the users associated with my organization:


from atlassian import Bitbucket
import os

class Driver():
    def __init__(self):
    self.username = "admin"
    self.app_password = os.environ.get('BITBUCKET_APP_PASSWORD')

    self.bitbucket = Bitbucket(

    def getVendorData(self):
       response = self.bitbucket.get_users()


I have created the BITBUCKET_APP_PASSWORD for an admin account and have granted it literally all the permissions. Bit when I try to run the `getVendorData` method I get:

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url:


Note: The app I am working on is still in a testing phase so I am using a free Bitbucket test workspace.


Thank you for your time

2 answers

1 vote
Aron Gombas
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.
Mar 05, 2023

I think that the problem is not with the permissions, but your code can't authenticated using the given username and password.

  1. Are you 100% sure that "admin" should be used here? AFAI Bitbucket Cloud is using email addresses to identify user accounts...
  2. Are you sure that the password is correctly set in the local environment variable? Maybe printing this out from the script could confirm this.
0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 07, 2023

Hello @Ishita Chauhan ,

Welcome to Atlassian Community!

From the logs you have shared seems like this library is trying to use Bitbucket API v1.0 endpoints, which were deprecated a few years ago (see Users endpoint 1.0).

In this case, you would need to use the endpoints available in Bitbucket API v2.0. If your goal is to list all the members within a workspace, the following 2.0 endpoint might be of help : 

You can also check all the other available endpoints in the Bitbucket API 2.0 Reference documentation.

Also, I see that in your script you are using the username "admin". The username used in the authentication must be the same username of the account under which you created the app password. You can check the username of your account on the website by clicking on your personal avatar in the top right corner, selecting Personal Settings, and looking for the field Username. This should be the username used in your script.

Hope that helps!  Let me know in case you have any questions.

Thank you, @Ishita Chauhan !

Patrik S

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events