# Bitbucket API token error

**URL:** <https://community.developer.atlassian.com/t/bitbucket-api-token-error/29303>\
**Category:** Bitbucket Development\
**Tags:** bitbucket-cloud\
**Created:** [May 15, 2019, 9:41am UTC](https://community.developer.atlassian.com/t/bitbucket-api-token-error/29303 "2019-05-15T09:41:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![warren.levy](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/warren.levy/32/38066_2.png) [@warren.levy](https://community.developer.atlassian.com/u/warren.levy)\
**Post date:** [May 15, 2019, 9:41am UTC](https://community.developer.atlassian.com/t/bitbucket-api-token-error/29303/1 "2019-05-15T09:41:41Z")

</div>

As per the e-mail that Atlassian sent me, I went to [this](https://confluence.atlassian.com/cloud/api-tokens-938839638.html?utm_source=alert-email&utm_medium=email&utm_campaign=jira-conf-api-auth-vs-tokens_EML-4935&jobid=104098709&subid=1288909003) page about changing to use tokens for API calls.

I have successfully implemented using a token for Jira, but, as per [this](https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html) page, I am having an issue with the Bitbucket API. In Postman, if I try a Bitbucket API call and use the token in the Password field, I get a “401 Unauthorized” error, whereas if I use the token in the Bearer field, I get the message below

 ![Screenshot_4](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/c/7/c7ccc61aa7c99d3d06f68c1b86a4ca34f595fcef.jpeg)

Just to confirm, this token has just been created and never used.

So firstly, should the token be used in place of Password (as I’m doing with Jira) or as Bearer?

Secondly, why isn’t it working successfully?

Thanks

---

<div class="post-metadata">

**Author:** ![warren.levy](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/warren.levy/32/38066_2.png) [@warren.levy](https://community.developer.atlassian.com/u/warren.levy)\
**Post date:** [May 23, 2019, 3:19pm UTC](https://community.developer.atlassian.com/t/bitbucket-api-token-error/29303/2 "2019-05-23T15:19:10Z")

</div>

I raised this as a support ticket with Atlassian and they helped me resolve it.

In case others have the same issue, I was using my Bitbucket e-mail address in the username field (as I do for Jira), but it required my Bitbucket username. Using the Bitbucket username and the generated App Password, I am now able to successfully call the API
