Forums

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

Fetching repository archive using API Tokens

axotte
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 30, 2025

Hello everyone, I'm currently in the process of migrating from App Passwords to API Tokens and have encountered an issue that I cannot resolve.

In our current implementation, we download repository archives using https://bitbucket.org/<workspace_slug>/<repo_slug>/get/<ref>.tar.gz with username:app_password as basic authentication. When I switched the basic auth to email:api_token, I get a 401 error (though other API endpoints work fine with this authentication method).

```
curl --request GET --url https://bitbucket.org/<workspace_slug>/<repo_slug>/get/<ref>.tar.gz -u "email:api_token" -f
curl: (56) The requested URL returned error: 401
```

Is there a way to make this endpoint work with API tokens, or are there alternative endpoints that can return repository archives and work with API tokens?

Note: I'm aware that it's possible to clone repositories using git clone with API tokens, but I would prefer to avoid changing our entire implementation and stick with fetching archives.

0 answers

Suggest an answer

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

Atlassian Community Events