Forums

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

Cannot connect with API token

kernoweb
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!
June 12, 2026

Created an API token "with scopes" here https://id.atlassian.com/manage-profile/security/api-tokens including all 42 Bitbucket permissions.

Set the token like this:

git remote set-url origin https://{bitbucket_username}:{api_token}@bitbucket.org/{workspace}/{repository}.git

Now when I push I get:

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

Please advise.  I have tried repeating the steps and looking through the docs, and looking at responses to other people who have had issues with this and cannot find a solution.  

1 answer

0 votes
Arkadiusz Wroblewski
Community Champion
June 12, 2026

Hello @kernoweb 

Can you list what you already tried?

Best,

Arkadiusz 🤠 

Arkadiusz Wroblewski
Community Champion
June 14, 2026

@kernoweb 

Also Avoid embedding the token directly in the remote URL. Use Bitbucket's static token username so Git prompts you for the password securely:

git remote set-url origin https://x-bitbucket-api-token-auth@bitbucket.org/{workspace}/{repository}.git

git push

When prompted for the password, paste your API token.

Try that and let know how it goes.

Best,

Arkadiusz🤠

Praveena Bodanki
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!
June 14, 2026

I was getting the same error as kernoweb when embedding the token, so I tried your suggestion of using Bitbucket's static token username. I was prompted for the password, but after entering the API token, I still received the same error.

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.

Suggest an answer

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

Atlassian Community Events