/repositories/{workspace}/{repo_slug}/pipelines
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.
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.
$ 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"
}
}'
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:
branchnamed_branchbookmarktag$ 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"
}
}'
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.
$ 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"
}
}'
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.
$ 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"
}
}'
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).
$ 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"
}
]
}'
You can also initiate a pipeline for a specific pull request.
$ 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": "**"
}
}
}'
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The pipeline to initiate.
application/json
pipeline
| Property | Type | Required |
|---|---|---|
| type | string | required |
| uuid | string | optional |
| state | object | optional |
| └ type | string | required |
| target | object | optional |
| └ type | string | required |
| creator | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| trigger | object | optional |
| └ type | string | required |
| variables | array | optional |
| └ type | string | required |
| └ key | string | optional |
| └ uuid | string | optional |
| └ value | string | optional |
| └ secured | boolean | optional |
| created_on | string | optional |
| repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ clone | array | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ forks | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ hooks | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ watchers | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ downloads | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ pullrequests | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ name | string | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ avatar | object | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ created_on | string | optional |
| └ is_private | boolean | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ has_publicly_visible_repos | boolean | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ name | string | optional |
| └ type | string | required |
| └ links | object | optional |
| └ html | object | optional |
| └ self | object | optional |
| └ commits | object | optional |
| └ target | object | optional |
| └ type | string | required |
| └ date | string | optional |
| └ hash | string | optional |
| └ author | object | optional |
| └ message | string | optional |
| └ parents | array | optional |
| └ summary | object | optional |
| └ repository | object | optional |
| └ participants | array | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
| build_number | integer | optional |
| completed_on | string | optional |
| build_seconds_used | integer | optional |
| configuration_sources | array | optional |
| └ uri | string | required |
| └ source | string | required |
The initiated pipeline.
The account or repository is not enabled, the yml file does not exist in the repository for the given revision, or the request body contained invalid properties.
The account or repository was not found.
POST /repositories/{workspace}/{repo_slug}/pipelines
/repositories/{workspace}/{repo_slug}/pipelines-config/caches
Delete repository cache versions by name.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The account. |
| repo_slug | path | required | string | The repository. |
| name | query | required | string | The cache name. |
The caches were deleted.
The workspace, repository or cache name was not found.
DELETE /repositories/{workspace}/{repo_slug}/pipelines-config/caches
/repositories/{workspace}/{repo_slug}/pipelines-config/caches
Retrieve the repository pipelines caches.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The account. |
| repo_slug | path | required | string | The repository. |
The list of caches for the given repository.
The account or repository was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines-config/caches
/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}
Delete a repository cache.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The account. |
| repo_slug | path | required | string | The repository. |
| cache_uuid | path | required | string | The UUID of the cache to delete. |
The cache was deleted.
The workspace, repository or cache_uuid with given UUID was not found.
DELETE /repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}
/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uri
Retrieve the URI of the content of the specified cache.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The account. |
| repo_slug | path | required | string | The repository. |
| cache_uuid | path | required | string | The UUID of the cache. |
The cache content uri.
The workspace, repository or cache_uuid with given UUID was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uri
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}
Retrieve a specified pipeline
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| pipeline_uuid | path | required | string | The pipeline UUID. |
The pipeline.
No account, repository or pipeline with the UUID provided exists.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps
Find steps for the given pipeline.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
The steps.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}
Retrieve a given step of a pipeline.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
The step.
No account, repository, pipeline or step with the UUID provided exists for the pipeline with the UUID provided.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/log
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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
The raw log file for this pipeline step.
The log has the same etag as the provided If-None-Match header.
A pipeline with the given UUID does not exist, a step with the given UUID does not exist in the pipeline or a log file does not exist for the given step.
The requested range does not exist for requests that specified the HTTP Range header.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/log
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}
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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
| log_uuid | path | required | string | For the main build container specify the step UUID; for a service container specify the service container UUID |
The raw log file for the build container or service container.
No account, repository, pipeline, step or log exist for the provided path.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
A summary of test reports for this pipeline step.
No account, repository, pipeline, step or test reports exist for the provided path.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
Test cases for this pipeline step.
No account, repository, pipeline, step or test reports exist for the provided path.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasons
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
| step_uuid | path | required | string | The UUID of the step. |
| test_case_uuid | path | required | string | The UUID of the test case. |
Test case reasons (output).
No account, repository, pipeline, step or test case with the UUID provided exists for the pipeline with the UUID provided.
GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasons
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/stopPipeline
Signal the stop of a pipeline and all of its steps that not have completed yet.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| pipeline_uuid | path | required | string | The UUID of the pipeline. |
The pipeline has been signaled to stop.
The specified pipeline has already completed.
Either the account, repository or pipeline with the given UUID does not exist.
POST /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/stopPipeline
/repositories/{workspace}/{repo_slug}/pipelines_config
Retrieve the repository pipelines configuration.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | The account. |
| repo_slug | path | required | string | The repository. |
The repository pipelines configuration.
GET /repositories/{workspace}/{repo_slug}/pipelines_config
/repositories/{workspace}/{repo_slug}/pipelines_config
Update the pipelines configuration for a repository.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The updated repository pipelines configuration.
application/json
pipelines_config
| Property | Type | Required |
|---|---|---|
| type | string | required |
| enabled | boolean | optional |
| repository | object | optional |
| └ type | string | required |
| └ scm | string | optional |
| └ name | string | optional |
| └ size | integer | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ clone | array | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ forks | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ hooks | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ commits | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ watchers | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ downloads | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ pullrequests | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ parent | object | optional |
| └ project | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ name | string | optional |
| └ uuid | string | optional |
| └ links | object | optional |
| └ html | object | optional |
| └ avatar | object | optional |
| └ owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| └ created_on | string | optional |
| └ is_private | boolean | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ has_publicly_visible_repos | boolean | optional |
| └ has_wiki | boolean | optional |
| └ language | string | optional |
| └ full_name | string | optional |
| └ created_on | string | optional |
| └ has_issues | boolean | optional |
| └ is_private | boolean | optional |
| └ mainbranch | object | optional |
| └ name | string | optional |
| └ type | string | required |
| └ links | object | optional |
| └ html | object | optional |
| └ self | object | optional |
| └ commits | object | optional |
| └ target | object | optional |
| └ type | string | required |
| └ date | string | optional |
| └ hash | string | optional |
| └ author | object | optional |
| └ message | string | optional |
| └ parents | array | optional |
| └ summary | object | optional |
| └ repository | object | optional |
| └ participants | array | optional |
| └ merge_strategies | array | optional |
| └ default_merge_strategy | string | optional |
| └ updated_on | string | optional |
| └ description | string | optional |
| └ fork_policy | string | optional |
The repository pipelines configuration was updated.
PUT /repositories/{workspace}/{repo_slug}/pipelines_config
/repositories/{workspace}/{repo_slug}/pipelines_config/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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The build number to update.
application/json
pipeline_build_number
| Property | Type | Required |
|---|---|---|
| type | string | required |
| next | integer | optional |
The build number has been configured.
The update failed because the next number was invalid (it should be higher than the current number).
The account or repository was not found.
PUT /repositories/{workspace}/{repo_slug}/pipelines_config/build_number
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules
Retrieve the configured schedules for the given repository.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The list of schedules.
The account or repository was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/schedules
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules
Create a schedule for the given repository.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The schedule to create.
application/json
pipeline_schedule_post_request_body
| Property | Type | Required |
|---|---|---|
| type | string | required |
| target | object | required |
| └ ref_name | string | required |
| └ ref_type | string | required |
| └ selector | object | required |
| └ type | string | required |
| └ pattern | string | optional |
| enabled | boolean | optional |
| cron_pattern | string | required |
The created schedule.
There were errors validating the request.
The maximum limit of schedules for this repository was reached.
The account or repository was not found.
POST /repositories/{workspace}/{repo_slug}/pipelines_config/schedules
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
Delete a schedule.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| schedule_uuid | path | required | string | The uuid of the schedule. |
The schedule was deleted.
The account, repository or schedule was not found.
DELETE /repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
Retrieve a schedule by its UUID.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| schedule_uuid | path | required | string | The uuid of the schedule. |
The requested schedule.
The account, repository or schedule was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
Update a schedule.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| schedule_uuid | path | required | string | The uuid of the schedule. |
The schedule to update.
application/json
pipeline_schedule_put_request_body
| Property | Type | Required |
|---|---|---|
| type | string | required |
| enabled | boolean | optional |
The schedule is updated.
The account, repository or schedule was not found.
PUT /repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executions
Retrieve the executions of a given schedule.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| schedule_uuid | path | required | string | The uuid of the schedule. |
The list of executions of a schedule.
The account or repository was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executions
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
Delete the repository SSH key pair.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The SSH key pair was deleted.
The account, repository or SSH key pair was not found.
DELETE /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
/repositories/{workspace}/{repo_slug}/pipelines_config/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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The SSH key pair.
The account, repository or SSH key pair was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
/repositories/{workspace}/{repo_slug}/pipelines_config/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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The created or updated SSH key pair.
application/json
pipeline_ssh_key_pair
| Property | Type | Required |
|---|---|---|
| type | string | required |
| public_key | string | optional |
| private_key | string | optional |
The SSH key pair was created or updated.
The account, repository or SSH key pair was not found.
PUT /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
Find repository level known hosts.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The retrieved known hosts.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
Create a repository level known host.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The known host to create.
application/json
pipeline_known_host
| Property | Type | Required |
|---|---|---|
| type | string | required |
| uuid | string | optional |
| hostname | string | optional |
| public_key | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ key_type | string | optional |
| └ md5_fingerprint | string | optional |
| └ sha256_fingerprint | string | optional |
The known host was created.
The account or repository does not exist.
A known host with the provided hostname already exists.
POST /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
Delete a repository level known host.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| known_host_uuid | path | required | string | The UUID of the known host to delete. |
The known host was deleted.
The account, repository or known host with given UUID was not found.
DELETE /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
Retrieve a repository level known host.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| known_host_uuid | path | required | string | The UUID of the known host to retrieve. |
The known host.
The account, repository or known host with the specified UUID was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
Update a repository level known host.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| known_host_uuid | path | required | string | The UUID of the known host to update. |
The updated known host.
application/json
pipeline_known_host
| Property | Type | Required |
|---|---|---|
| type | string | required |
| uuid | string | optional |
| hostname | string | optional |
| public_key | object | optional |
| └ type | string | required |
| └ key | string | optional |
| └ key_type | string | optional |
| └ md5_fingerprint | string | optional |
| └ sha256_fingerprint | string | optional |
The known host was updated.
The account, repository or known host with the given UUID was not found.
PUT /repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
/repositories/{workspace}/{repo_slug}/pipelines_config/variables
Find repository level variables.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The retrieved variables.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/variables
/repositories/{workspace}/{repo_slug}/pipelines_config/variables
Create a repository level variable.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
The variable to create.
application/json
pipeline_variable
| Property | Type | Required |
|---|---|---|
| type | string | required |
| key | string | optional |
| uuid | string | optional |
| value | string | optional |
| secured | boolean | optional |
The variable was created.
The account or repository does not exist.
A variable with the provided key already exists.
POST /repositories/{workspace}/{repo_slug}/pipelines_config/variables
/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
Delete a repository level variable.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| variable_uuid | path | required | string | The UUID of the variable to delete. |
The variable was deleted.
The account, repository or variable with given UUID was not found.
DELETE /repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
Retrieve a repository level variable.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| variable_uuid | path | required | string | The UUID of the variable to retrieve. |
The variable.
The account, repository or variable with the specified UUID was not found.
GET /repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
Update a repository level variable.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| repo_slug | path | required | string | The repository. |
| variable_uuid | path | required | string | The UUID of the variable to update. |
The updated variable
application/json
pipeline_variable
| Property | Type | Required |
|---|---|---|
| type | string | required |
| key | string | optional |
| uuid | string | optional |
| value | string | optional |
| secured | boolean | optional |
The variable was updated.
The account, repository or variable with the given UUID was not found.
PUT /repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
/workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configuration
This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
The OpenID configuration
The workspace was not found.
GET /workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configuration
/workspaces/{workspace}/pipelines-config/identity/oidc/keys.json
This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
The keys in JSON web key format
The workspace was not found.
GET /workspaces/{workspace}/pipelines-config/identity/oidc/keys.json
/workspaces/{workspace}/pipelines-config/variables
Find workspace level variables.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
The found workspace level variables.
GET /workspaces/{workspace}/pipelines-config/variables
/workspaces/{workspace}/pipelines-config/variables
Create a workspace level variable.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
The variable to create.
application/json
pipeline_variable
| Property | Type | Required |
|---|---|---|
| type | string | required |
| key | string | optional |
| uuid | string | optional |
| value | string | optional |
| secured | boolean | optional |
The created variable.
The workspace does not exist.
A variable with the provided key already exists.
POST /workspaces/{workspace}/pipelines-config/variables
/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
Delete a workspace level variable.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| variable_uuid | path | required | string | The UUID of the variable to delete. |
The variable was deleted
The workspace or the variable with the provided UUID does not exist.
DELETE /workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
Retrieve a workspace level variable.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| variable_uuid | path | required | string | The UUID of the variable to retrieve. |
The variable.
The workspace or variable with the given UUID was not found.
GET /workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
Update a workspace level variable.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example |
| variable_uuid | path | required | string | The UUID of the variable. |
The updated variable.
application/json
pipeline_variable
| Property | Type | Required |
|---|---|---|
| type | string | required |
| key | string | optional |
| uuid | string | optional |
| value | string | optional |
| secured | boolean | optional |
The variable was updated.
The workspace or the variable was not found.
PUT /workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
/workspaces/{workspace}/projects
Creates a new project.
Note that the avatar has to be embedded as either a data-url
or a URL to an external image as shown in the examples below:
$ body=$(cat << EOF
{
"name": "Mars Project",
"key": "MARS",
"description": "Software for colonizing mars.",
"links": {
"avatar": {
"href": "data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/..."
}
},
"is_private": false
}
EOF
)
$ curl -H "Content-Type: application/json" \
-X POST \
-d "$body" \
https://api.bitbucket.org/2.0/workspaces/teams-in-space/projects/ | jq .
{
// Serialized project document
}
or even:
$ body=$(cat << EOF
{
"name": "Mars Project",
"key": "MARS",
"description": "Software for colonizing mars.",
"links": {
"avatar": {
"href": "http://i.imgur.com/72tRx4w.gif"
}
},
"is_private": false
}
EOF
)
$ curl -H "Content-Type: application/json" \
-X POST \
-d "$body" \
https://api.bitbucket.org/2.0/workspaces/teams-in-space/projects/ | jq .
{
// Serialized project document
}
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
application/json
project
| Property | Type | Required |
|---|---|---|
| type | string | required |
| key | string | optional |
| name | string | optional |
| uuid | string | optional |
| links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ members | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ projects | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ repositories | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| created_on | string | optional |
| is_private | boolean | optional |
| updated_on | string | optional |
| description | string | optional |
| has_publicly_visible_repos | boolean | optional |
A new project has been created.
The requesting user isn’t authorized to create the project.
A workspace doesn’t exist at this location.
POST /workspaces/{workspace}/projects
/workspaces/{workspace}/projects/{project_key}
Deletes this project. This is an irreversible operation.
You cannot delete a project that still contains repositories.
To delete the project, delete
or transfer the repositories first.
Example:
$ curl -X DELETE https://api.bitbucket.org/2.0/workspaces/bbworkspace1/projects/PROJ
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This is the actual |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
Successful deletion.
The requesting user isn’t authorized to delete the project or the project isn’t empty.
A project isn’t hosted at this location.
DELETE /workspaces/{workspace}/projects/{project_key}
/workspaces/{workspace}/projects/{project_key}
Returns the requested project.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This is the actual |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The project that is part of a workspace.
The request wasn’t authenticated.
The requesting user isn’t authorized to access the project.
A project isn’t hosted at this location.
GET /workspaces/{workspace}/projects/{project_key}
/workspaces/{workspace}/projects/{project_key}
Since this endpoint can be used to both update and to create a
project, the request body depends on the intent.
See the POST documentation for the project collection for an
example of the request body.
Note: The key should not be specified in the body of request
(since it is already present in the URL). The name is required,
everything else is optional.
See the POST documentation for the project collection for an
example of the request body.
Note: The key is not required in the body (since it is already in
the URL). The key may be specified in the body, if the intent is
to change the key itself. In such a scenario, the location of the
project is changed and is returned in the Location header of the
response.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This is the actual |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
application/json
project
| Property | Type | Required |
|---|---|---|
| type | string | required |
| key | string | optional |
| name | string | optional |
| uuid | string | optional |
| links | object | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| owner | object | optional |
| └ type | string | required |
| └ uuid | string | optional |
| └ links | object | optional |
| └ avatar | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ html | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ self | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ members | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ projects | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ repositories | object | optional |
| └ href | string | optional |
| └ name | string | optional |
| └ username | string | optional |
| └ created_on | string | optional |
| └ display_name | string | optional |
| created_on | string | optional |
| is_private | boolean | optional |
| updated_on | string | optional |
| description | string | optional |
| has_publicly_visible_repos | boolean | optional |
The existing project is has been updated.
A new project has been created.
The requesting user isn’t authorized to update or create the project.
A workspace doesn’t exist at the location. Note that the project’s absence from this location doesn’t raise a 404, since a PUT at a non-existent location can be used to create a new project.
PUT /workspaces/{workspace}/projects/{project_key}
/workspaces/{workspace}/projects/{project_key}/default-reviewers
Return a list of all default reviewers for a project. This is a list of users that will be added as default
reviewers to pull requests for any repository within the project.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This is the actual |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The list of project default reviewers
If the authenticated user does not have admin access to the project
If the workspace or project does not exist at this location
GET /workspaces/{workspace}/projects/{project_key}/default-reviewers
/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
Removes a default reviewer from the project.
Example:
$ curl https://api.bitbucket.org/2.0/.../default-reviewers/%7Bf0e0e8e9-66c1-4b85-a784-44a9eb9ef1a6%7D
HTTP/1.1 204
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This can either be the actual |
| selected_user | path | required | string | This can either be the username or the UUID of the default reviewer, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The specified user was removed from the list of project default reviewers
If the specified user is not a default reviewer for the project
If the authenticated user does not have admin access to the project
If the specified user, project, or workspace does not exist
DELETE /workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
Returns the specified default reviewer.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| project_key | path | required | string | The project in question. This can either be the actual |
| selected_user | path | required | string | This can either be the username or the UUID of the default reviewer, |
| workspace | path | required | string | This can either be the workspace ID (slug) or the workspace UUID |
The specified user that is a default reviewer
If the specified user is not a default reviewer for the project
If the authenticated user does not have admin access to the project
If the specified user, project, or workspace does not exist
GET /workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}