Cloud
Bitbucket Cloud / Reference / REST APIs

Pipelines

Postman Collection
OpenAPI

Bitbucket Pipelines brings continuous delivery to Bitbucket Cloud, empowering teams with full branching to deployment visibility and faster feedback loops.

Operations
GET/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variablesPOST/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variablesPUT/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}DEL/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}GET/repositories/{workspace}/{repo_slug}/pipelinesPOST/repositories/{workspace}/{repo_slug}/pipelinesGET/repositories/{workspace}/{repo_slug}/pipelines-config/cachesDEL/repositories/{workspace}/{repo_slug}/pipelines-config/cachesDEL/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}GET/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uriGET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/stepsGET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logGET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reportsGET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_casesGET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasonsPOST/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/stopPipelineGET/repositories/{workspace}/{repo_slug}/pipelines_configPUT/repositories/{workspace}/{repo_slug}/pipelines_configPUT/repositories/{workspace}/{repo_slug}/pipelines_config/build_numberGET/repositories/{workspace}/{repo_slug}/pipelines_config/schedulesPOST/repositories/{workspace}/{repo_slug}/pipelines_config/schedulesGET/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}PUT/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}DEL/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}GET/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executionsGET/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pairPUT/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pairDEL/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pairGET/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hostsPOST/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hostsGET/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}PUT/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}DEL/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}GET/repositories/{workspace}/{repo_slug}/pipelines_config/variablesPOST/repositories/{workspace}/{repo_slug}/pipelines_config/variablesGET/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}PUT/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}DEL/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}GET/teams/{username}/pipelines_config/variablesPOST/teams/{username}/pipelines_config/variablesGET/teams/{username}/pipelines_config/variables/{variable_uuid}PUT/teams/{username}/pipelines_config/variables/{variable_uuid}DEL/teams/{username}/pipelines_config/variables/{variable_uuid}GET/users/{selected_user}/pipelines_config/variablesPOST/users/{selected_user}/pipelines_config/variablesGET/users/{selected_user}/pipelines_config/variables/{variable_uuid}PUT/users/{selected_user}/pipelines_config/variables/{variable_uuid}DEL/users/{selected_user}/pipelines_config/variables/{variable_uuid}GET/workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configurationGET/workspaces/{workspace}/pipelines-config/identity/oidc/keys.jsonGET/workspaces/{workspace}/pipelines-config/variablesPOST/workspaces/{workspace}/pipelines-config/variablesGET/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}PUT/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}DEL/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
GET

List variables for an environment

Find deployment environment level variables.

pipeline

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
environment_uuid

string

Required

Responses

The retrieved deployment variables.

application/json

Paginated Deployment Variables

A paged list of deployment variables.

GET/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "page": 102, "values": [ { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
POST

Create a variable for an environment

Create a deployment environment level variable.

pipeline:variable

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
environment_uuid

string

Required

Request bodyapplication/json

The variable to create

allOf [object, Deployment Variable]

object

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.

Deployment Variable

A Pipelines deployment variable.

Responses

The variable was created.

Headers

Location

string

application/json

allOf [object, Deployment Variable]

object

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.

Deployment Variable

A Pipelines deployment variable.

POST/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables
1 2 3 4 5 6 7 8 9 10 11 12 curl --request POST \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }'
201Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
PUT

Update a variable for an environment

Update a deployment environment level variable.

pipeline:variable

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
environment_uuid

string

Required
variable_uuid

string

Required

Request bodyapplication/json

The updated deployment variable.

allOf [object, Deployment Variable]

object

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.

Deployment Variable

A Pipelines deployment variable.

Responses

The deployment variable was updated.

application/json

allOf [object, Deployment Variable]

object

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.

Deployment Variable

A Pipelines deployment variable.

PUT/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
DEL

Delete a variable for an environment

Delete a deployment environment level variable.

pipeline:variable

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
environment_uuid

string

Required
variable_uuid

string

Required

Responses

The variable was deleted.

DEL/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}
1 2 3 curl --request DELETE \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>'
GET

List pipelines

Find pipelines

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Responses

The matching pipelines.

application/json

Paginated Pipelines

A paged list of pipelines

GET/repositories/{workspace}/{repo_slug}/pipelines
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 { "page": 102, "values": [ { "type": "<string>", "uuid": "<string>", "build_number": 33, "creator": { "type": "<string>" }, "repository": { "type": "<string>" }, "target": { "type": "<string>" }, "trigger": { "type": "<string>" }, "state": { "type": "<string>" }, "variables": [ { "type": "<string>" } ], "created_on": "<string>", "completed_on": "<string>", "build_seconds_used": 50, "configuration_sources": [ { "source": "<string>", "uri": "<string>" } ] } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
POST

Run a pipeline

Endpoint to create and initiate a pipeline. There are a couple of different options to initiate a pipeline, where the payload of the request will determine which type of pipeline will be instantiated.

Trigger a Pipeline for a branch

One way to trigger pipelines is by specifying the branch for which you want to trigger a pipeline. The specified branch will be used to determine which pipeline definition from the bitbucket-pipelines.yml file will be applied to initiate the pipeline. The pipeline will then do a clone of the repository and checkout the latest revision of the specified branch.

Example

1 2 3 4 5 6 7 8 9 10 11 $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "ref_type": "branch", "type": "pipeline_ref_target", "ref_name": "master" } }'

Trigger a Pipeline for a commit on a branch or tag

You can initiate a pipeline for a specific commit and in the context of a specified reference (e.g. a branch, tag or bookmark). The specified reference will be used to determine which pipeline definition from the bitbucket-pipelines.yml file will be applied to initiate the pipeline. The pipeline will clone the repository and then do a checkout the specified reference.

The following reference types are supported:

  • branch
  • named_branch
  • bookmark
  • tag

Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "commit": { "type": "commit", "hash": "ce5b7431602f7cbba007062eeb55225c6e18e956" }, "ref_type": "branch", "type": "pipeline_ref_target", "ref_name": "master" } }'

Trigger a specific pipeline definition for a commit

You can trigger a specific pipeline that is defined in your bitbucket-pipelines.yml file for a specific commit. In addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition. The resulting pipeline will then clone the repository and checkout the specified revision.

Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "commit": { "hash":"a3c4e02c9a3755eccdc3764e6ea13facdf30f923", "type":"commit" }, "selector": { "type":"custom", "pattern":"Deploy to production" }, "type":"pipeline_commit_target" } }'

Trigger a specific pipeline definition for a commit on a branch or tag

You can trigger a specific pipeline that is defined in your bitbucket-pipelines.yml file for a specific commit in the context of a specified reference. In addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition, as well as the reference information. The resulting pipeline will then clone the repository a checkout the specified reference.

Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "commit": { "hash":"a3c4e02c9a3755eccdc3764e6ea13facdf30f923", "type":"commit" }, "selector": { "type": "custom", "pattern": "Deploy to production" }, "type": "pipeline_ref_target", "ref_name": "master", "ref_type": "branch" } }'

Trigger a custom pipeline with variables

In addition to triggering a custom pipeline that is defined in your bitbucket-pipelines.yml file as shown in the examples above, you can specify variables that will be available for your build. In the request, provide a list of variables, specifying the following for each variable: key, value, and whether it should be secured or not (this field is optional and defaults to not secured).

Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \ -d ' { "target": { "type": "pipeline_ref_target", "ref_type": "branch", "ref_name": "master", "selector": { "type": "custom", "pattern": "Deploy to production" } }, "variables": [ { "key": "var1key", "value": "var1value", "secured": true }, { "key": "var2key", "value": "var2value" } ] }'

Trigger a pull request pipeline

You can also initiate a pipeline for a specific pull request.

Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \ -d ' { "target": { "type": "pipeline_pullrequest_target", "source": "pull-request-branch", "destination": "master", "destination_commit": { "hash": "9f848b7" }, "commit": { "hash": "1a372fc" }, "pullrequest": { "id": "3" }, "selector": { "type": "pull-requests", "pattern": "**" } } }'
Scopes
pipeline
read:pipeline:bitbucket, write:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Request bodyapplication/json

The pipeline to initiate.

allOf [object, Pipeline]

object

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.

Pipeline

A Bitbucket Pipeline. This represents an actual pipeline result.

Responses

The initiated pipeline.

Headers

Location

string

application/json

allOf [object, Pipeline]

object

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.

Pipeline

A Bitbucket Pipeline. This represents an actual pipeline result.

POST/repositories/{workspace}/{repo_slug}/pipelines
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 curl --request POST \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "build_number": 33, "creator": { "type": "<string>" }, "repository": { "type": "<string>" }, "target": { "type": "<string>" }, "trigger": { "type": "<string>" }, "state": { "type": "<string>" }, "variables": [ { "type": "<string>" } ], "created_on": "<string>", "completed_on": "<string>", "build_seconds_used": 50, "configuration_sources": [ { "source": "<string>", "uri": "<string>" } ] }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 { "type": "<string>", "uuid": "<string>", "build_number": 33, "creator": { "type": "<string>" }, "repository": { "type": "<string>" }, "target": { "type": "<string>" }, "trigger": { "type": "<string>" }, "state": { "type": "<string>" }, "variables": [ { "type": "<string>" } ], "created_on": "<string>", "completed_on": "<string>", "build_seconds_used": 50, "configuration_sources": [ { "source": "<string>", "uri": "<string>" } ] }
GET

List caches

Retrieve the repository pipelines caches.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Responses

The list of caches for the given repository.

application/json

Paginated Pipeline Cache

A paged list of pipeline caches

GET/repositories/{workspace}/{repo_slug}/pipelines-config/caches
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines-config/caches' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "page": 102, "values": [ { "type": "<string>", "uuid": "<string>", "pipeline_uuid": "<string>", "step_uuid": "<string>", "name": "<string>", "key_hash": "<string>", "path": "<string>", "file_size_bytes": 57, "created_on": "<string>" } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
DEL

Delete caches

Delete repository cache versions by name.

Scopes
pipeline:write
write:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Query parameters

name

string

Required

Responses

The caches were deleted.

DEL/repositories/{workspace}/{repo_slug}/pipelines-config/caches
1 2 3 curl --request DELETE \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines-config/caches?name={name}' \ --header 'Authorization: Bearer <access_token>'
DEL

Delete a cache

Delete a repository cache.

Scopes
pipeline:write
write:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
cache_uuid

string

Required

Responses

The cache was deleted.

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

Get cache content URI

Retrieve the URI of the content of the specified cache.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
cache_uuid

string

Required

Responses

The cache content uri.

application/json

Pipeline Cache Content URI

A representation of the location of pipeline cache content.

GET/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uri
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uri' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 { "uri": "<string>" }
GET

Get a pipeline

Retrieve a specified pipeline

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
pipeline_uuid

string

Required

Responses

The pipeline.

application/json

allOf [object, Pipeline]

object

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.

Pipeline

A Bitbucket Pipeline. This represents an actual pipeline result.

GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 { "type": "<string>", "uuid": "<string>", "build_number": 33, "creator": { "type": "<string>" }, "repository": { "type": "<string>" }, "target": { "type": "<string>" }, "trigger": { "type": "<string>" }, "state": { "type": "<string>" }, "variables": [ { "type": "<string>" } ], "created_on": "<string>", "completed_on": "<string>", "build_seconds_used": 50, "configuration_sources": [ { "source": "<string>", "uri": "<string>" } ] }
GET

List steps for a pipeline

Find steps for the given pipeline.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
pipeline_uuid

string

Required

Responses

The steps.

application/json

Paginated Pipeline Steps

A paged list of pipeline steps.

GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 { "page": 102, "values": [ { "type": "<string>", "uuid": "<string>", "started_on": "<string>", "completed_on": "<string>", "state": { "type": "<string>" }, "image": {}, "setup_commands": [ {} ], "script_commands": [ {} ] } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
GET

Get a step of a pipeline

Retrieve a given step of a pipeline.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
pipeline_uuid

string

Required
step_uuid

string

Required

Responses

The step.

application/json

allOf [object, Pipeline Step]

object

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.

Pipeline Step

A step of a Bitbucket pipeline. This represents the actual result of the step execution.

GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 { "type": "<string>", "uuid": "<string>", "started_on": "<string>", "completed_on": "<string>", "state": { "type": "<string>" }, "image": { "name": "<string>", "username": "<string>", "password": "<string>", "email": "<string>" }, "setup_commands": [ { "name": "<string>", "command": "<string>" } ], "script_commands": [ { "name": "<string>", "command": "<string>" } ] }
GET

Get log file for a step

Retrieve the log file for a given step of a pipeline.

This endpoint supports (and encourages!) the use of HTTP Range requests to deal with potentially very large log files.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
pipeline_uuid

string

Required
step_uuid

string

Required

Responses

The raw log file for this pipeline step.

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

Get the logs for the build container or a service container for a given step of a pipeline.

Retrieve the log file for a build container or service container.

This endpoint supports (and encourages!) the use of HTTP Range requests to deal with potentially very large log files.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
pipeline_uuid

string

Required
step_uuid

string

Required
log_uuid

string

Required

Responses

The raw log file for the build container or service container.

GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}
1 2 3 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}' \ --header 'Authorization: Bearer <access_token>'
GET

Get a summary of test reports for a given step of a pipeline.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
pipeline_uuid

string

Required
step_uuid

string

Required

Responses

A summary of test reports for this pipeline step.

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

Get test cases for a given step of a pipeline.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
pipeline_uuid

string

Required
step_uuid

string

Required

Responses

Test cases for this pipeline step.

GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases
1 2 3 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases' \ --header 'Authorization: Bearer <access_token>'
GET

Get test case reasons (output) for a given test case in a step of a pipeline.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
pipeline_uuid

string

Required
step_uuid

string

Required
test_case_uuid

string

Required

Responses

Test case reasons (output).

GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasons
1 2 3 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasons' \ --header 'Authorization: Bearer <access_token>'
POST

Stop a pipeline

Signal the stop of a pipeline and all of its steps that not have completed yet.

Scopes
pipeline:write
write:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
pipeline_uuid

string

Required

Responses

The pipeline has been signaled to stop.

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

Get configuration

Retrieve the repository pipelines configuration.

Scopes
repository:admin
admin:repository:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Responses

The repository pipelines configuration.

application/json

allOf [object, Pipelines Configuration]

object

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.

Pipelines Configuration

The Pipelines configuration for a repository.

GET/repositories/{workspace}/{repo_slug}/pipelines_config
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "enabled": true, "repository": { "type": "<string>" } }
PUT

Update configuration

Update the pipelines configuration for a repository.

Scopes
repository:admin
admin:repository:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Request bodyapplication/json

The updated repository pipelines configuration.

allOf [object, Pipelines Configuration]

object

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.

Pipelines Configuration

The Pipelines configuration for a repository.

Responses

The repository pipelines configuration was updated.

application/json

allOf [object, Pipelines Configuration]

object

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.

Pipelines Configuration

The Pipelines configuration for a repository.

PUT/repositories/{workspace}/{repo_slug}/pipelines_config
1 2 3 4 5 6 7 8 9 10 11 12 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "enabled": true, "repository": { "type": "<string>" } }'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "enabled": true, "repository": { "type": "<string>" } }
PUT

Update the next build number

Update the next build number that should be assigned to a pipeline. The next build number that will be configured has to be strictly higher than the current latest build number for this repository.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Request bodyapplication/json

The build number to update.

allOf [object, Pipeline Build Number]

object

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.

Pipeline Build Number

A Pipelines build number.

Responses

The build number has been configured.

application/json

allOf [object, Pipeline Build Number]

object

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.

Pipeline Build Number

A Pipelines build number.

PUT/repositories/{workspace}/{repo_slug}/pipelines_config/build_number
1 2 3 4 5 6 7 8 9 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/build_number' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "next": 50 }'
200Response
1 2 3 4 { "type": "<string>", "next": 50 }
GET

List schedules

Retrieve the configured schedules for the given repository.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Responses

The list of schedules.

application/json

Paginated Pipeline Schedule

A paged list of schedules

GET/repositories/{workspace}/{repo_slug}/pipelines_config/schedules
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/schedules' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "page": 102, "values": [ { "type": "<string>", "uuid": "<string>", "enabled": true, "target": { "type": "<string>" }, "cron_pattern": "<string>", "created_on": "<string>", "updated_on": "<string>" } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
POST

Create a schedule

Create a schedule for the given repository.

Scopes
pipeline:write
read:pipeline:bitbucket, write:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Request bodyapplication/json

The schedule to create.

allOf [object, Request body for Pipeline Schedule POST request]

object

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.

Request body for Pipeline Schedule POST request

Responses

The created schedule.

application/json

allOf [object, Pipeline Schedule]

object

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.

Pipeline Schedule

A Pipelines schedule.

POST/repositories/{workspace}/{repo_slug}/pipelines_config/schedules
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 curl --request POST \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/schedules' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "target": { "selector": { "type": "<string>" }, "ref_name": "<string>", "ref_type": "branch" }, "enabled": true, "cron_pattern": "<string>" }'
201Response
1 2 3 4 5 6 7 8 9 10 11 { "type": "<string>", "uuid": "<string>", "enabled": true, "target": { "type": "<string>" }, "cron_pattern": "<string>", "created_on": "<string>", "updated_on": "<string>" }
GET

Get a schedule

Retrieve a schedule by its UUID.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
schedule_uuid

string

Required

Responses

The requested schedule.

application/json

allOf [object, Pipeline Schedule]

object

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.

Pipeline Schedule

A Pipelines schedule.

GET/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "type": "<string>", "uuid": "<string>", "enabled": true, "target": { "type": "<string>" }, "cron_pattern": "<string>", "created_on": "<string>", "updated_on": "<string>" }
PUT

Update a schedule

Update a schedule.

Scopes
pipeline:write
read:pipeline:bitbucket, write:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
schedule_uuid

string

Required

Request bodyapplication/json

The schedule to update.

allOf [object, Request body for Pipeline Schedule PUT request]

object

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.

Request body for Pipeline Schedule PUT request

Responses

The schedule is updated.

application/json

allOf [object, Pipeline Schedule]

object

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.

Pipeline Schedule

A Pipelines schedule.

PUT/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
1 2 3 4 5 6 7 8 9 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "enabled": true }'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "type": "<string>", "uuid": "<string>", "enabled": true, "target": { "type": "<string>" }, "cron_pattern": "<string>", "created_on": "<string>", "updated_on": "<string>" }
DEL

Delete a schedule

Delete a schedule.

Scopes
pipeline:write
write:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
schedule_uuid

string

Required

Responses

The schedule was deleted.

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

List executions of a schedule

Retrieve the executions of a given schedule.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
schedule_uuid

string

Required

Responses

The list of executions of a schedule.

application/json

Paginated Pipeline Schedule Executions

A paged list of the executions of a schedule.

GET/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executions
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executions' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 { "page": 102, "values": [ { "type": "<string>" } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
GET

Get SSH key pair

Retrieve the repository SSH key pair excluding the SSH private key. The private key is a write only field and will never be exposed in the logs or the REST API.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Responses

The SSH key pair.

application/json

allOf [object, Pipeline SSH Key Pair]

object

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.

Pipeline SSH Key Pair

A Pipelines SSH key pair.

GET/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "type": "<string>", "private_key": "<string>", "public_key": "<string>" }
PUT

Update SSH key pair

Create or update the repository SSH key pair. The private key will be set as a default SSH identity in your build container.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Request bodyapplication/json

The created or updated SSH key pair.

allOf [object, Pipeline SSH Key Pair]

object

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.

Pipeline SSH Key Pair

A Pipelines SSH key pair.

Responses

The SSH key pair was created or updated.

application/json

allOf [object, Pipeline SSH Key Pair]

object

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.

Pipeline SSH Key Pair

A Pipelines SSH key pair.

PUT/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
1 2 3 4 5 6 7 8 9 10 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "private_key": "<string>", "public_key": "<string>" }'
200Response
1 2 3 4 5 { "type": "<string>", "private_key": "<string>", "public_key": "<string>" }
DEL

Delete SSH key pair

Delete the repository SSH key pair.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Responses

The SSH key pair was deleted.

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

List known hosts

Find repository level known hosts.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Responses

The retrieved known hosts.

application/json

Paginated Pipeline Known Hosts

A paged list of known hosts.

GET/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 { "page": 102, "values": [ { "type": "<string>", "uuid": "<string>", "hostname": "<string>", "public_key": { "type": "<string>" } } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
POST

Create a known host

Create a repository level known host.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Request bodyapplication/json

The known host to create.

allOf [object, Pipeline Known Host]

object

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.

Pipeline Known Host

A Pipelines known host.

Responses

The known host was created.

Headers

Location

string

application/json

allOf [object, Pipeline Known Host]

object

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.

Pipeline Known Host

A Pipelines known host.

POST/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
1 2 3 4 5 6 7 8 9 10 11 12 13 curl --request POST \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "hostname": "<string>", "public_key": { "type": "<string>" } }'
201Response
1 2 3 4 5 6 7 8 { "type": "<string>", "uuid": "<string>", "hostname": "<string>", "public_key": { "type": "<string>" } }
GET

Get a known host

Retrieve a repository level known host.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
known_host_uuid

string

Required

Responses

The known host.

application/json

allOf [object, Pipeline Known Host]

object

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.

Pipeline Known Host

A Pipelines known host.

GET/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 { "type": "<string>", "uuid": "<string>", "hostname": "<string>", "public_key": { "type": "<string>" } }
PUT

Update a known host

Update a repository level known host.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
known_host_uuid

string

Required

Request bodyapplication/json

The updated known host.

allOf [object, Pipeline Known Host]

object

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.

Pipeline Known Host

A Pipelines known host.

Responses

The known host was updated.

application/json

allOf [object, Pipeline Known Host]

object

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.

Pipeline Known Host

A Pipelines known host.

PUT/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
1 2 3 4 5 6 7 8 9 10 11 12 13 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "hostname": "<string>", "public_key": { "type": "<string>" } }'
200Response
1 2 3 4 5 6 7 8 { "type": "<string>", "uuid": "<string>", "hostname": "<string>", "public_key": { "type": "<string>" } }
DEL

Delete a known host

Delete a repository level known host.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
known_host_uuid

string

Required

Responses

The known host was deleted.

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

List variables for a repository

Find repository level variables.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Responses

The retrieved variables.

application/json

Paginated Pipeline Variables

A paged list of variables.

GET/repositories/{workspace}/{repo_slug}/pipelines_config/variables
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/variables' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "page": 102, "values": [ { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
POST

Create a variable for a repository

Create a repository level variable.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required

Request bodyapplication/json

The variable to create.

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

Responses

The variable was created.

Headers

Location

string

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

POST/repositories/{workspace}/{repo_slug}/pipelines_config/variables
1 2 3 4 5 6 7 8 9 10 11 12 curl --request POST \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/variables' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }'
201Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
GET

Get a variable for a repository

Retrieve a repository level variable.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
variable_uuid

string

Required

Responses

The variable.

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

GET/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
PUT

Update a variable for a repository

Update a repository level variable.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
variable_uuid

string

Required

Request bodyapplication/json

The updated variable

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

Responses

The variable was updated.

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

PUT/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
DEL

Delete a variable for a repository

Delete a repository level variable.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
repo_slug

string

Required
variable_uuid

string

Required

Responses

The variable was deleted.

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

List variables for an accountDeprecated

Find account level variables. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement.

pipeline

Request

Path parameters

username

string

Required

Responses

The found account level variables.

application/json

Paginated Pipeline Variables

A paged list of variables.

GET/teams/{username}/pipelines_config/variables
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/teams/{username}/pipelines_config/variables' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "page": 102, "values": [ { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
POST

Create a variable for a userDeprecated

Create an account level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement.

pipeline:variable

Request

Path parameters

username

string

Required

Request bodyapplication/json

The variable to create.

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

Responses

The created variable.

Headers

Location

string

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

POST/teams/{username}/pipelines_config/variables
1 2 3 4 5 6 7 8 9 10 11 12 curl --request POST \ --url 'https://api.bitbucket.org/2.0/teams/{username}/pipelines_config/variables' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }'
201Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
GET

Get a variable for a teamDeprecated

Retrieve a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement.

pipeline

Request

Path parameters

username

string

Required
variable_uuid

string

Required

Responses

The variable.

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

GET/teams/{username}/pipelines_config/variables/{variable_uuid}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/teams/{username}/pipelines_config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
PUT

Update a variable for a teamDeprecated

Update a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement.

pipeline:variable

Request

Path parameters

username

string

Required
variable_uuid

string

Required

Request bodyapplication/json

The updated variable.

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

Responses

The variable was updated.

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

PUT/teams/{username}/pipelines_config/variables/{variable_uuid}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/teams/{username}/pipelines_config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
DEL

Delete a variable for a teamDeprecated

Delete a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement.

pipeline:variable

Request

Path parameters

username

string

Required
variable_uuid

string

Required

Responses

The variable was deleted

DEL/teams/{username}/pipelines_config/variables/{variable_uuid}
1 2 3 curl --request DELETE \ --url 'https://api.bitbucket.org/2.0/teams/{username}/pipelines_config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>'
GET

List variables for a userDeprecated

Find user level variables. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement.

pipeline

Request

Path parameters

selected_user

string

Required

Responses

The found user level variables.

application/json

Paginated Pipeline Variables

A paged list of variables.

GET/users/{selected_user}/pipelines_config/variables
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/users/{selected_user}/pipelines_config/variables' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "page": 102, "values": [ { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
POST

Create a variable for a userDeprecated

Create a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement.

pipeline:variable

Request

Path parameters

selected_user

string

Required

Request bodyapplication/json

The variable to create.

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

Responses

The created variable.

Headers

Location

string

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

POST/users/{selected_user}/pipelines_config/variables
1 2 3 4 5 6 7 8 9 10 11 12 curl --request POST \ --url 'https://api.bitbucket.org/2.0/users/{selected_user}/pipelines_config/variables' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }'
201Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
GET

Get a variable for a userDeprecated

Retrieve a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement.

pipeline

Request

Path parameters

selected_user

string

Required
variable_uuid

string

Required

Responses

The variable.

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

GET/users/{selected_user}/pipelines_config/variables/{variable_uuid}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/users/{selected_user}/pipelines_config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
PUT

Update a variable for a userDeprecated

Update a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement.

pipeline:variable

Request

Path parameters

selected_user

string

Required
variable_uuid

string

Required

Request bodyapplication/json

The updated variable.

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

Responses

The variable was updated.

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

PUT/users/{selected_user}/pipelines_config/variables/{variable_uuid}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/users/{selected_user}/pipelines_config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
DEL

Delete a variable for a userDeprecated

Delete an account level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement.

pipeline:variable

Request

Path parameters

selected_user

string

Required
variable_uuid

string

Required

Responses

The variable was deleted

DEL/users/{selected_user}/pipelines_config/variables/{variable_uuid}
1 2 3 curl --request DELETE \ --url 'https://api.bitbucket.org/2.0/users/{selected_user}/pipelines_config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>'
GET

Get OpenID configuration for OIDC in Pipelines

This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/

Request

Path parameters

workspace

string

Required

Responses

The OpenID configuration

GET/workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configuration
1 2 3 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configuration' \ --header 'Authorization: Bearer <access_token>'
GET

Get keys for OIDC in Pipelines

This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/

Request

Path parameters

workspace

string

Required

Responses

The keys in JSON web key format

GET/workspaces/{workspace}/pipelines-config/identity/oidc/keys.json
1 2 3 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/pipelines-config/identity/oidc/keys.json' \ --header 'Authorization: Bearer <access_token>'
GET

List variables for a workspace

Find workspace level variables.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required

Responses

The found workspace level variables.

application/json

Paginated Pipeline Variables

A paged list of variables.

GET/workspaces/{workspace}/pipelines-config/variables
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/pipelines-config/variables' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "page": 102, "values": [ { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true } ], "size": 142, "pagelen": 159, "next": "<string>", "previous": "<string>" }
POST

Create a variable for a workspace

Create a workspace level variable.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required

Request bodyapplication/json

The variable to create.

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

Responses

The created variable.

Headers

Location

string

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

POST/workspaces/{workspace}/pipelines-config/variables
1 2 3 4 5 6 7 8 9 10 11 12 curl --request POST \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/pipelines-config/variables' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }'
201Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
GET

Get variable for a workspace

Retrieve a workspace level variable.

Scopes
pipeline
read:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
variable_uuid

string

Required

Responses

The variable.

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

GET/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
PUT

Update variable for a workspace

Update a workspace level variable.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
variable_uuid

string

Required

Request bodyapplication/json

The updated variable.

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

Responses

The variable was updated.

application/json

allOf [object, Pipeline Variable]

object

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.

Pipeline Variable

A Pipelines variable.

PUT/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }'
200Response
1 2 3 4 5 6 7 { "type": "<string>", "uuid": "<string>", "key": "<string>", "value": "<string>", "secured": true }
DEL

Delete a variable for a workspace

Delete a workspace level variable.

Scopes
pipeline:variable
admin:pipeline:bitbucket

Request

Path parameters

workspace

string

Required
variable_uuid

string

Required

Responses

The variable was deleted

DEL/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
1 2 3 curl --request DELETE \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}' \ --header 'Authorization: Bearer <access_token>'

Rate this page: