Forums

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

API Key Not working properly

Tim_Savage
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 11, 2026

I had to start using an API key to push code to a repo that I have been updating for months. I use GIT from a command line (git push origin dev) to update the repo and even adding the API key in the remote url, (git remote set-url origin https://<Username>:<API Key>@bitbucket.org/<organization>/<repository>.git)

I an still getting an error that states "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."

I know that I am authenticated. I can authenticate through the website and I have full access to the repository.

What am I doing incorrectly and how can I fix it?

2 answers

0 votes
Tomislav Tobijas
Community Champion
June 11, 2026

Hey guys,

There was an active incident earlier, but as stated in the report, it should have been resolved. Incident report: https://bitbucket.status.atlassian.com/incidents/h51sr145gsmx ⚠️

Can you check and see if things are working now?

Cheers,
Tobi

Tim_Savage
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

Good Morning,

I have just tried and it continues to fail. I keep getting the error that was listed in my original question. I can see that my key was accessed (through the Security/API Tokens page from Bitbucket site).

I double checked my remote URL and it is correct and pointing to the correct repo. From Bitbucket web site, I can access the repo and I have full control. The only difference is the token.

What can I check/do now?

 

Thanks,
Tim

Like Tomislav Tobijas likes this
Tomislav Tobijas
Community Champion
June 12, 2026

Hmm @Tim_Savage ... can you check this article: Using API tokens? Does your API token (not key) use scopes? 👈

Can you also maybe try using static username, a.k.a. this:

git clone https://x-bitbucket-api-token-auth@bitbucket.org/{workspace}/{repository}.git

As for API token scope, make sure it has at least the following permissions enabled:

  • Repositories: Read (repository)

  • Repositories: Write (repository:write)

If the error persists, check your local Git credential manager if it's providing old, cached credentials:

  • Windows: Clear entries for bitbucket.org in Credential Manager.

  • macOS: Remove Bitbucket-related items from Keychain Access

Here's another article that might be helpful: Resolve authentication error - "remote: Invalid username or password" in Bitbucket Cloud 

Cheers,
Tobi

0 votes
Denise Skidmore
June 11, 2026

I'm failing to authenticate via https or ssh.

https causes a couple browser tabs to pop up saying I've authenticated, then a box asking for my password (we're on SSO, I should not have a separate Bitbucket password.)  Git console shows a bunch of html which at the core seems to say 403: CSRF verification failed. Request aborted.  At the end:  error: unable to read askpass response from ...git-askpass.exe

ssh I don't regularly use, my next step is to try generating a new key.  There's a warning about post-quantum keys that older threads indicate we can ignore until Bitbucket adds the support.  Then there's a permisison denied error.

Some details removed because the forum thinks the pasted error was bad html.

Thiago Berne
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 11, 2026

I've been experiencing the exactly same behavior here.

Denise Skidmore
June 12, 2026

Today I was able to pull and fetch fine over https.  I probably have a setup issue with ssh but that's not an issue for me if https works.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events