Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Bitbucket Downloads API
description: Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.
version: '2.0'
termsOfService: https://www.atlassian.com/legal/customer-agreement
contact:
name: Bitbucket Support
url: https://support.atlassian.com/bitbucket-cloud/
email: support@bitbucket.org
servers:
- url: https://api.bitbucket.org/2.0
tags:
- name: Downloads
description: Access the list of download links associated with the repository.
paths:
/repositories/{workspace}/{repo_slug}/downloads:
parameters:
- name: repo_slug
in: path
description: 'This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: `{repository UUID}`.
'
required: true
schema:
type: string
- name: workspace
in: path
description: 'This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: `{workspace UUID}`.
'
required: true
schema:
type: string
get:
tags:
- Downloads
description: Returns a list of download links associated with the repository.
summary: List download artifacts
responses:
'200':
description: Returns a paginated list of the downloads associated with the repository.
'403':
description: User is not authorized to read from the repository.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2:
- repository
- basic: []
- api_key: []
x-atlassian-oauth2-scopes:
- state: Current
scheme: oauth2
scopes:
- read:repository:bitbucket
x-atlassian-auth-types:
- forge-oauth2
- api-token
operationId: getRepositoriesByWorkspaceByRepoSlugDownloads
x-operation-id-source: derived
post:
tags:
- Downloads
description: '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.'
summary: Upload a download artifact
responses:
'201':
description: The artifact was uploaded sucessfully.
'400':
description: Bad Request.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'403':
description: User is not authorized to write to the repository.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'406':
description: Unsupported Content-Type. Use multiplart/form-data.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2:
- repository:write
- basic: []
- api_key: []
x-atlassian-oauth2-scopes:
- state: Current
scheme: oauth2
scopes:
- write:repository:bitbucket
x-atlassian-auth-types:
- forge-oauth2
- api-token
operationId: postRepositoriesByWorkspaceByRepoSlugDownloads
x-operation-id-source: derived
/repositories/{workspace}/{repo_slug}/downloads/{filename}:
parameters:
- name: filename
in: path
description: Name of the file.
required: true
schema:
type: string
- name: repo_slug
in: path
description: 'This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: `{repository UUID}`.
'
required: true
schema:
type: string
- name: workspace
in: path
description: 'This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: `{workspace UUID}`.
'
required: true
schema:
type: string
delete:
tags:
- Downloads
description: Deletes the specified download artifact from the repository.
summary: Delete a download artifact
responses:
'204':
description: The specified download artifact was deleted.
'403':
description: User is not authorized to write to the repository.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'404':
description: The specified download does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2:
- repository:write
- basic: []
- api_key: []
x-atlassian-oauth2-scopes:
- state: Current
scheme: oauth2
scopes:
- write:repository:bitbucket
x-atlassian-auth-types:
- forge-oauth2
- api-token
operationId: deleteRepositoriesByWorkspaceByRepoSlugDownloadsByFilename
x-operation-id-source: derived
get:
tags:
- Downloads
description: 'Return a redirect to the contents of a download artifact.
This endpoint returns the actual file contents and not the artifact''s
metadata.
$ curl -s -L https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads/hello.txt
Hello World'
summary: Get a download artifact link
responses:
'302':
description: Redirects to the url of the specified download artifact.
'403':
description: User is not authorized to read from the repository.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'404':
description: The specified download artifact does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2:
- repository
- basic: []
- api_key: []
x-atlassian-oauth2-scopes:
- state: Current
scheme: oauth2
scopes:
- read:repository:bitbucket
x-atlassian-auth-types:
- forge-oauth2
- api-token
operationId: getRepositoriesByWorkspaceByRepoSlugDownloadsByFilename
x-operation-id-source: derived
components:
schemas:
error:
type: object
title: Error
description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
properties:
type:
type: string
error:
type: object
properties:
message:
type: string
detail:
type: string
data:
type: object
description: Optional structured data that is endpoint-specific.
properties: {}
additionalProperties: true
required:
- message
additionalProperties: false
required:
- type
additionalProperties: true
securitySchemes:
basic:
type: http
scheme: basic
description: Basic HTTP Authentication as per [RFC-2617](https://tools.ietf.org/html/rfc2617) (Digest not supported). Note that Basic Auth is available only with username and app password as credentials.
oauth2:
type: oauth2
flows:
authorizationCode:
scopes:
repository: Read your repositories
repository:write: Read and modify your repositories
repository:admin: Administer your repositories
repository:delete: Delete your repositories
project: Read your workspace's project settings and read repositories contained within your workspace's projects
project:admin: Read and modify settings for projects in your workspace
email: Read your account's primary email address
account: Read your account information
account:write: Read and modify your account information
team: Read your team membership information
team:write: Read and modify your team membership information
pipeline: Access your repositories' build pipelines
pipeline:write: Access and rerun your repositories' build pipelines
pipeline:variable: Access your repositories' build pipelines and configure their variables
runner: Access your workspaces/repositories' runners
runner:write: Access and edit your workspaces/repositories' runners
test: Access your workspaces/repositories' test
test:write: Access and edit your workspaces/repositories' test
pullrequest: Read your repositories and their pull requests
pullrequest:write: Read and modify your repositories and their pull requests
webhook: Read and modify your repositories' webhooks
issue: Read your repositories' issues
issue:write: Read and modify your repositories' issues
snippet: Read your snippets
snippet:write: Read and modify your snippets
wiki: Read and modify your repositories' wikis
authorizationUrl: https://bitbucket.org/site/oauth2/authorize
tokenUrl: https://bitbucket.org/site/oauth2/access_token
description: OAuth 2 as per [RFC-6749](https://tools.ietf.org/html/rfc6749).
api_key:
name: Authorization
type: apiKey
description: API Keys can be used as Basic HTTP Authentication credentials and provide a substitute for the account's actual username and password. API Keys are only available to team accounts and there is only 1 key per account. API Keys do not support scopes and have therefore access to all contents of the account.
in: header
x-revision: 1e0692ed4864
x-atlassian-narrative:
documents:
# --- truncated at 32 KB (120 KB total) ---
# Full source: https://artifacts.apis.io/bitbucket-pipelines/openapi/bitbucket-pipelines-downloads-api-openapi.yml