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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Accessing Bibucket license details API calls.

Hi Team,

We are trying to fetch the license details of our Bitbucket product through API calls using Personal Access tokens.

we are getting 401 Unauthorized access error.Please find the error details.

The remote server returned an error: (401) Unauthorized.

API Used: https://bitbuckethosturl/rest/api/1.0/admin/license

I have created the token for an admin account.we are able to view the license details in the UI but when tried through API we are getting above exception.

Please let us know how we can fix this authentication issue. Let me know if anything  i need to change in my settings.

Awaiting for your reply.


1 answer


My experience with Bitbucket REST API is that personal access tokens cannot be used with administrator related REST endpoints.

I am not sure why.

So, for admin related REST endpoints basic auth may be the way to go but not ideal. I would prefer personal access tokens over basic auth.

Basic AUTH:

curl -v -X GET -u admin-username:password https://bitbuckethosturl/rest/api/1.0/admin/license

Response HTTP 200 with license info.

Personal access token:  

curl -v -X GET -H "Authorization: Bearer MTQ1NTY0MDA4OTEwOtAOXXXXXXXXX" https://bitbuckethosturl/rest/api/1.0/admin/license

Response HTTP 401

Bitbucket access tokens and Bitbucket


Lasse Langhorn

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Bitbucket

How do you use the Bitbucket-Jira integration? How does it help your team?

Hey everyone, over the past year, we've added several new features on how you can use Bitbucket and Jira together. We'd love to know how you'll are using the integration and how it's helping your t...

121 views 0 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you