It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to download repository as zip file using the API Edited

I've been able to successfully authenticate and use other areas of the 2.0 API and now I need to use the API do the equivalent of the "Download repository" link on the "Downloads" section in the UI.  I just need a copy of the files, not a clone of the complete repository.

Using the 2.0 API I have the following:{username}/{repository}/downloads

I can successfully use the call above but it returns the data below, implying there aren't any downloads.

{"pagelen": 10, "values": [], "page": 1, "size": 0}

  What do I need to do to get a zip of all of the files in the repository?  Thanks.

2 answers

1 accepted

2 votes
Answer accepted
Ana_Retamal Atlassian Team Aug 21, 2018

Hi Brian, welcome to the Community!

That string will return a list of download links associated with the repository, that means any other files you have uploaded to that section but not the source of the repo itself. As a picture is worth a thousand words:

- No downloads to show (although the link to download the repo is there)

Screen Shot 2018-08-21 at 14.52.20.png

- Downloads to be shown (I added a few files to the list)Screen Shot 2018-08-21 at 14.53.29.png


To download the zip with a copy of the files from your repo, you can use the following:<username>/<repo-name>/get/

Hope that helps!


Inside a zip file with source of branch we have additional top level. How i can get zip file with same stricture as repository? Or probably i can provide a start path as a parameter(--prefix in git archive)?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Bitbucket Server 7.0 is here!

Hello Community, I’m Anton Genkin, a product manager on the Bitbucket Server and Data Center team and am excited to share that Bitbucket Server 7.0 is now available! It's a platform release, one th...

989 views 6 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you