---
title: "Upload a download artifact"
method: POST
path: "/repositories/{workspace}/{repo_slug}/downloads"
tags: ["Downloads"]
---

# Upload a download artifact

`POST /repositories/{workspace}/{repo_slug}/downloads`

## Request

- Base URL: `https://api.bitbucket.org/2.0`
- URL: `https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/downloads`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://bitbucket.org/site/oauth2/authorize`
    - Token URL: `https://bitbucket.org/site/oauth2/access_token` scopes: `repository:write`
  - HTTP basic
  - API key in header `Authorization`

Upload new download artifacts.

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

    $ 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.

## Response `201`

The artifact was uploaded sucessfully.

## Other responses

- `400`: Bad Request.
- `403`: User is not authorized to write to the repository.
- `406`: Unsupported Content-Type. Use multiplart/form-data.

---

[API](https://skmtc.dev/atlassian/apis/bitbucket-api.md) - [All operations](https://skmtc.dev/atlassian/apis/bitbucket-api/llms.txt) - [OpenAPI document](https://skmtc.dev/atlassian/apis/bitbucket-api/revisions/6ae783fa75da?raw)
