Forums

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

Migrating from App Password to API Token - Authentication failed

Brandon OBrien
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 13, 2026

I currently have several repositories with BitBucket and I'm trying to switch from using App Passwords to the new API Token.  I already  have the repositories cloned to my desktop and have been working on them for years.

I'm just trying to make the transition but I keep getting authorization failed notices.

I've tried both of the following from the command line in MacOS Terminal when I'm in the directory:

`git remote set-url origin https://{my_username}:{api_token}@bitbucket.org/{workspace}/{repo_name}.git`

and 

`git remote set-url origin https://{my_username}@bitbucket.org/{workspace}/{repo_name}.git`

 

(i obviously used my actual username, worskpace and repo_name in the curly brackets above)

Both of which give me the following error after I try to push a commit to bitbucket:

`remote: You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated.
fatal: Authentication failed for 'https://bitbucket.org/{workspace}/{repo_name}.git/'`

What do I need to do in order to get this to work?  The API token is just a normal API token without any scopes.  I would think this means I can use it for any of my repositories using any command (like a push).

2 answers

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 17, 2026

Hi @Brandon OBrien @Ajay 

The API token requires scopes, you may not use it without scopes to authenticate with GIT.

 

To start using API tokens with Bitbucket Cloud - you'll need to create the API token and specify the scope - this is mentioned in our deprecation documentation:

  1. Click the gear cog icon, select Atlassian Account settings > Security tab > Create and manage API Tokens

  2. Click Create API token with scopes and select Bitbucket Cloud

  3. If you want to be able to clone/push/pull to the repository - you'll need to tick both read:repository:bitbucket and write:repository:bitbucket - clone only would just be read:repository:bitbucket.
    More information on scopes can be found in our API scopes documentation.

  4. Perform the clone using the API token by executing either of the commands below (if using the first command - you can find your username by clicking the gear cog icon and selecting Personal Bitbucket Settings - it's visible under the Bitbucket Profile Settings heading):


Please perform the above and let me know how this goes. If you are still encountering issues, I will assist you further.

Cheers!

- Ben (Bitbucket Cloud Support)

0 votes
Ajay
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 14, 2026

I am also facing the same issue. I could see the API calls to bitbucket as its showing last accessed as latest but getting authentication error. I have tried creating the API token with scopes as mentioned in the documentation.
Create an API token | Bitbucket Cloud | Atlassian Support
Apparently none of the command didn't worked out.
Using API tokens | Bitbucket Cloud | Atlassian Support

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events