Owarning: failed to create the file main-win....permission denied (23) failed writing body (0 ! = 16347)

To access my repo:

$  `curl -u "Tysondogerz:PASS" https://api.bitbucket.org/2.0/repositories/Tysondogerz/SSH/downloads                                                                                     

I seem to be able to access my repo fine with the above, why is it when I try and download a file with curl it does not work?

Now for download:

$  curl -u "Tysondogerz:PASS" https://api.bitbucket.org/2.0/repositories/Tysondogerz/SSH/downloads/main-win-1.3.zip    

Or:

    $  curl -u "Tysondogerz:PASS" -L -O https://api.bitbucket.org/2.0/repositories/Tysondogerz/SSH/downloads/main-win-1.3.zip    

Error:

Owarning: failed to create the file main-win....permission denied (23) failed writing body (0 ! = 16347)