• Addon
  • Branch restrictions
  • Branching model
  • Commit statuses
  • Commits
  • Deployments
  • Downloads
  • GPG
  • Issue tracker
  • Pipelines
  • Projects
  • Pullrequests
  • Refs
  • Reports
  • Repositories
  • SSH
  • Snippets
  • Source
  • Users
  • Webhooks
  • Workspaces
  • Other operations
Cloud
Bitbucket Cloud / Reference / REST APIs

Downloads

Postman Collection
OpenAPI
GET

List download artifacts

Returns a list of download links associated with the repository.

Scopes
repository
read:repository:bitbucket

Request

Path parameters

repo_slug

string

Required
workspace

string

Required

Responses

Returns a paginated list of the downloads associated with the repository.

GET/repositories/{workspace}/{repo_slug}/downloads
1 2 3 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/downloads' \ --header 'Authorization: Bearer <access_token>'
POST

Upload a download artifact

Upload new download artifacts.

To upload files, perform a multipart/form-data POST containing one or more files fields:

1 2 $ echo Hello World > hello.txt $ curl -s -u evzijst -X POST https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads -F files=@hello.txt

When a file is uploaded with the same name as an existing artifact, then the existing file will be replaced.

repository:write

Request

Path parameters

repo_slug

string

Required
workspace

string

Required

Responses

The artifact was uploaded sucessfully.

POST/repositories/{workspace}/{repo_slug}/downloads
1 2 3 curl --request POST \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/downloads' \ --header 'Authorization: Bearer <access_token>'
GET

Get a download artifact link

Return a redirect to the contents of a download artifact.

This endpoint returns the actual file contents and not the artifact's metadata.

1 2 $ curl -s -L https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads/hello.txt Hello World
repository

Request

Path parameters

filename

string

Required
repo_slug

string

Required
workspace

string

Required

Responses

Redirects to the url of the specified download artifact.

GET/repositories/{workspace}/{repo_slug}/downloads/{filename}
1 2 3 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/downloads/{filename}' \ --header 'Authorization: Bearer <access_token>'
DEL

Delete a download artifact

Deletes the specified download artifact from the repository.

Scopes
repository:write
write:repository:bitbucket

Request

Path parameters

filename

string

Required
repo_slug

string

Required
workspace

string

Required

Responses

The specified download artifact was deleted.

DEL/repositories/{workspace}/{repo_slug}/downloads/{filename}
1 2 3 curl --request DELETE \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/downloads/{filename}' \ --header 'Authorization: Bearer <access_token>'

Rate this page: