Forums

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

Git Access with API Token

Mundo
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!
July 6, 2025

I just created an API Token for BitBucket in order to use it for Push/Pulls from my repository.

I followed the steps in the following question to create a token with scopes defined.

https://community.atlassian.com/forums/Bitbucket-questions/Git-Access-with-API-Token/qaq-p/3057268

And I selected the following scopes:

  1. admin:repository:bitbucket
  2. read:repository:bitbucket
  3. write:repository:bitbucket

 

My .git/config file has my remote origin url appropriately defined as:
https://{bitbucket_username}@bitbucket.org/{workspace}/{repository}.git

However, when I do a 'git pull' and when prompted, enter the API Token password, it says that Authentication failed.

Am I missing something?

Thanks in advance!

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 7, 2025

Hi @Mundo 

Welcome to the community!

As a start, are you able to clone the repository using the API token? You can try using this format when cloning

git clone https://<username>:<APIToken>@bitbucket.org/workspaceID/reposlug.git

This is to test and see if your token scopes are sufficient for cloning, as it also applies to pull or push.

Let me know how it goes.

Regards,
Syahrul

Mundo
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!
July 8, 2025

Hello @Syahrul 

Thank you for your response!

I just tried again this morning after updating my .git/config file to have my remote origin url to include my new APIToken in the url itself, and this worked!

It wasn't working a couple of days ago, so I think it must've just taken a little time to activate (or something :-) ).

One follow-up question for you if you don't mind...should it work for me to provide the APIToken as a password when prompted?

If, for example, I performed the following request (without the APIToken in the URL):

git clone https://<username>@bitbucket.org/workspaceID/reposlug.git

Because this still doesn't work for me.  But perhaps that's as designed?

Thanks!

Suggest an answer

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

Atlassian Community Events