Bitbucket Cloud REST API v2.0 (Pipelines)

The Pipelines slice of the Bitbucket Cloud REST API v2.0. Endpoint families include /repositories/{workspace}/{repo_slug}/pipelines/, /pipelines/{pipeline_uuid}/steps/, /pipelines_config, deployments, environments, schedules, ssh keys, variables, known hosts, runners and caches. OAuth 2.0, app passwords or workspace access tokens.

OpenAPI Specification

bitbucket-pipelines-openapi.json Raw ↑
{"swagger": "2.0", "info": {"title": "Bitbucket API", "description": "Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.", "version": "2.0", "termsOfService": "https://www.atlassian.com/legal/customer-agreement", "contact": {"name": "Bitbucket Support", "url": "https://support.atlassian.com/bitbucket-cloud/", "email": "[email protected]"}}, "host": "api.bitbucket.org", "basePath": "/2.0", "schemes": ["https"], "consumes": ["application/json"], "produces": ["application/json"], "paths": {"/addon": {"delete": {"tags": ["Addon"], "description": "Deletes the application for the user.\n\nThis endpoint is intended to be used by Bitbucket Connect apps\nand only supports JWT authentication -- that is how Bitbucket\nidentifies the particular installation of the app. Developers\nwith applications registered in the \"Develop Apps\" section\nof Bitbucket Marketplace need not use this endpoint as\nupdates for those applications can be sent out via the\nUI of that section.\n\n```\n$ curl -X DELETE https://api.bitbucket.org/2.0/addon \\\n  -H \"Authorization: JWT <JWT Token>\"\n```", "summary": "Delete an app", "responses": {"204": {"description": "Request has succeeded. The application has been deleted for the user."}, "401": {"description": "No authorization.", "schema": {"$ref": "#/definitions/error"}}, "403": {"description": "Improper authentication.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}]}, "put": {"tags": ["Addon"], "description": "Updates the application installation for the user.\n\nThis endpoint is intended to be used by Bitbucket Connect apps\nand only supports JWT authentication -- that is how Bitbucket\nidentifies the particular installation of the app. Developers\nwith applications registered in the \"Develop Apps\" section\nof Bitbucket need not use this endpoint as updates for those\napplications can be sent out via the UI of that section.\n\nPassing an empty body will update the installation using the\nexisting descriptor URL.\n\n```\n$ curl -X PUT https://api.bitbucket.org/2.0/addon \\\n  -H \"Authorization: JWT <JWT Token>\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{}'\n```\n\nThe new `descriptor` for the installation can be also provided\nin the body directly.\n\n```\n$ curl -X PUT https://api.bitbucket.org/2.0/addon \\\n  -H \"Authorization: JWT <JWT Token>\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\"descriptor\": $NEW_DESCRIPTOR}'\n```\n\nIn both these modes the URL of the descriptor cannot be changed. To\nchange the descriptor location and upgrade an installation\nthe request must be made exclusively with a `descriptor_url`.\n\n ```\n$ curl -X PUT https://api.bitbucket.org/2.0/addon \\\n  -H \"Authorization: JWT <JWT Token>\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\"descriptor_url\": $NEW_URL}'\n```\n\nThe `descriptor_url` must exactly match the marketplace registration\nthat Atlassian has for the application. Contact your Atlassian\ndeveloper advocate to update this registration. Once the registration\nhas been updated you may call this resource for each installation.\n\nNote that the scopes of the application cannot be increased\nin the new descriptor nor reduced to none.", "summary": "Update an installed app", "responses": {"204": {"description": "Request has succeeded. The installation has been updated to the new descriptor."}, "400": {"description": "Scopes have increased or decreased to none.", "schema": {"$ref": "#/definitions/error"}}, "401": {"description": "No authorization.", "schema": {"$ref": "#/definitions/error"}}, "403": {"description": "Improper authentication.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}]}, "parameters": []}, "/addon/linkers": {"get": {"tags": ["Addon"], "description": "Gets a list of all [linkers](/cloud/bitbucket/modules/linker/)\nfor the authenticated application.\n\nThis endpoint is deprecated and will be removed by May 2026.", "summary": "List linkers for an app", "responses": {"200": {"description": "Successful."}, "401": {"description": "Authentication must use app JWT", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}], "deprecated": true}, "parameters": []}, "/addon/linkers/{linker_key}": {"get": {"tags": ["Addon"], "description": "Gets a [linker](/cloud/bitbucket/modules/linker/) specified by `linker_key`\nfor the authenticated application.\n\nThis endpoint is deprecated and will be removed by May 2026.", "summary": "Get a linker for an app", "responses": {"200": {"description": "Successful."}, "401": {"description": "Authentication must use app JWT", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "The linker does not exist.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}], "deprecated": true}, "parameters": [{"name": "linker_key", "in": "path", "description": "The unique key of a [linker module](/cloud/bitbucket/modules/linker/)\nas defined in an application descriptor.", "required": true, "type": "string"}]}, "/addon/linkers/{linker_key}/values": {"delete": {"tags": ["Addon"], "description": "Delete all [linker](/cloud/bitbucket/modules/linker/) values for the\nspecified linker of the authenticated application.\n\nThis endpoint is deprecated and will be removed by May 2026.", "summary": "Delete all linker values", "responses": {"204": {"description": "Successfully deleted the linker values."}, "401": {"description": "Authentication must use app JWT", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "The linker does not exist.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}], "deprecated": true}, "get": {"tags": ["Addon"], "description": "Gets a list of all [linker](/cloud/bitbucket/modules/linker/) values for the\nspecified linker of the authenticated application.\n\nA linker value lets applications supply values to modify its regular expression.\n\nThe base regular expression must use a Bitbucket-specific match group `(?K)`\nwhich will be translated to `([\\w\\-]+)`. A value must match this pattern.\n\n[Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)\n\nThis endpoint is deprecated and will be removed by May 2026.", "summary": "List linker values for a linker", "responses": {"200": {"description": "Successful."}, "401": {"description": "Authentication must use app JWT", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "The linker does not exist.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}], "deprecated": true}, "post": {"tags": ["Addon"], "description": "Creates a [linker](/cloud/bitbucket/modules/linker/) value for the specified\nlinker of authenticated application.\n\nA linker value lets applications supply values to modify its regular expression.\n\nThe base regular expression must use a Bitbucket-specific match group `(?K)`\nwhich will be translated to `([\\w\\-]+)`. A value must match this pattern.\n\n[Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)\n\nThis endpoint is deprecated and will be removed by May 2026.", "summary": "Create a linker value", "responses": {"201": {"description": "Successfully created the linker value."}, "401": {"description": "Authentication must use app JWT", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "The linker does not exist.", "schema": {"$ref": "#/definitions/error"}}, "409": {"description": "The linker already has the value being added.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}], "deprecated": true}, "put": {"tags": ["Addon"], "description": "Bulk update [linker](/cloud/bitbucket/modules/linker/) values for the specified\nlinker of the authenticated application.\n\nA linker value lets applications supply values to modify its regular expression.\n\nThe base regular expression must use a Bitbucket-specific match group `(?K)`\nwhich will be translated to `([\\w\\-]+)`. A value must match this pattern.\n\n[Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)\n\nThis endpoint is deprecated and will be removed by May 2026.", "summary": "Update a linker value", "responses": {"204": {"description": "Successfully updated the linker values."}, "400": {"description": "Invalid input.", "schema": {"$ref": "#/definitions/error"}}, "401": {"description": "Authentication must use app JWT", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "The linker does not exist.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}], "deprecated": true}, "parameters": [{"name": "linker_key", "in": "path", "description": "The unique key of a [linker module](/cloud/bitbucket/modules/linker/)\nas defined in an application descriptor.", "required": true, "type": "string"}]}, "/addon/linkers/{linker_key}/values/{value_id}": {"delete": {"tags": ["Addon"], "description": "Delete a single [linker](/cloud/bitbucket/modules/linker/) value\nof the authenticated application.\n\nThis endpoint is deprecated and will be removed by May 2026.", "summary": "Delete a linker value", "responses": {"204": {"description": "Successfully deleted the linker value."}, "401": {"description": "Authentication must use app JWT", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "The linker value does not exist.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}], "deprecated": true}, "get": {"tags": ["Addon"], "description": "Get a single [linker](/cloud/bitbucket/modules/linker/) value\nof the authenticated application.\n\nThis endpoint is deprecated and will be removed by May 2026.", "summary": "Get a linker value", "responses": {"200": {"description": "Successful."}, "401": {"description": "Authentication must use app JWT", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "The linker value does not exist.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}], "deprecated": true}, "parameters": [{"name": "linker_key", "in": "path", "description": "The unique key of a [linker module](/cloud/bitbucket/modules/linker/)\nas defined in an application descriptor.", "required": true, "type": "string"}, {"name": "value_id", "in": "path", "description": "The numeric ID of the linker value.", "required": true, "type": "integer"}]}, "/addon/{addon_key}/client-key": {"get": {"tags": ["Addon"], "description": "Get the client key of the Connect addon associated with a Forge app install via forgeAppId linkage.\n\nThis endpoint is part of the Connect -> Forge migration tooling. It is intended to be used by a Forge app\nusing `asApp().requestBitbucket()` only.\nPrerequisite: app developer needs to register the linkage between their Connect and Forge app by setting\n`forgeAppId` in the Connect addon descriptor to `app.id` from Forge app manifest, then update the installations.\nIf the request came from an installation of a registered Forge app, the client key of the linked Connect addon\ninstalled in the same workspace will be returned.\n\n```\napi.asApp().requestBitbucket(route`/2.0/addon/{addon-key}/client-key`)\n```", "summary": "Get the client key of a Connect addon", "responses": {"200": {"description": "The client key of the Connect addon linked to the Forge app installation where the request was made"}, "401": {"description": "Invalid authentication.", "schema": {"$ref": "#/definitions/error"}}, "403": {"description": "Improper authorization.", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "The Connect addon or the Forge app does not exist.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}], "x-atlassian-oauth2-scopes": [{"state": "Current", "scheme": "oauth2", "scopes": ["admin:workspace:bitbucket"]}], "x-atlassian-auth-types": ["forge-oauth2"]}, "parameters": [{"name": "addon_key", "in": "path", "description": "The Connect addon key as defined in an application descriptor.\n", "required": true, "type": "string"}]}, "/hook_events": {"get": {"tags": ["Webhooks"], "description": "Returns the webhook resource or subject types on which webhooks can\nbe registered.\n\nEach resource/subject type contains an `events` link that returns the\npaginated list of specific events each individual subject type can\nemit.\n\nThis endpoint is publicly accessible and does not require\nauthentication or scopes.", "summary": "Get a webhook resource", "responses": {"200": {"description": "A mapping of resource/subject types pointing to their individual event types.", "schema": {"$ref": "#/definitions/subject_types"}, "examples": {"application/json": {"repository": {"links": {"events": {"href": "https://api.bitbucket.org/2.0/hook_events/repository"}}}, "workspace": {"links": {"events": {"href": "https://api.bitbucket.org/2.0/hook_events/workspace"}}}}}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}]}, "parameters": []}, "/hook_events/{subject_type}": {"get": {"tags": ["Webhooks"], "description": "Returns a paginated list of all valid webhook events for the\nspecified entity.\n**The team and user webhooks are deprecated, and you should use workspace instead.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).**\n\nThis is public data that does not require any scopes or authentication.\n\nNOTE: The example response is a truncated response object for the `workspace` `subject_type`.\nWe return the same structure for the other `subject_type` objects.", "summary": "List subscribable webhook types", "responses": {"200": {"description": "A paginated list of webhook types available to subscribe on.", "schema": {"$ref": "#/definitions/paginated_hook_events"}, "examples": {"application/json": {"page": 1, "pagelen": 30, "size": 4, "values": [{"category": "Repository", "description": "Whenever a repository push occurs", "event": "repo:push", "label": "Push"}, {"category": "Repository", "description": "Whenever a repository fork occurs", "event": "repo:fork", "label": "Fork"}, {"category": "Repository", "description": "Whenever a repository import occurs", "event": "repo:imported", "label": "Import"}, {"category": "Pull Request", "label": "Approved", "description": "When someone has approved a pull request", "event": "pullrequest:approved"}]}}}, "404": {"description": "If an invalid `{subject_type}` value was specified.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": []}, {"basic": []}, {"api_key": []}]}, "parameters": [{"name": "subject_type", "in": "path", "description": "A resource or subject type.", "required": true, "type": "string", "enum": ["repository", "workspace"]}]}, "/repositories": {"get": {"tags": ["Repositories"], "description": "**This endpoint is deprecated. Please use the\n[workspace scoped alternative](/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-get).**\n\nReturns a paginated list of all public repositories.\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details.", "summary": "List public repositories", "responses": {"200": {"description": "All public repositories.", "schema": {"$ref": "#/definitions/paginated_repositories"}}}, "parameters": [{"name": "after", "in": "query", "description": "Filter the results to include only repositories created on or\nafter this [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)\n timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ`", "required": false, "type": "string"}, {"name": "role", "in": "query", "description": "Filters the result based on the authenticated user's role on each repository.\n\n* **member**: returns repositories to which the user has explicit read access\n* **contributor**: returns repositories to which the user has explicit write access\n* **admin**: returns repositories to which the user has explicit administrator access\n* **owner**: returns all repositories owned by the current user\n", "required": false, "type": "string", "enum": ["admin", "contributor", "member", "owner"]}, {"name": "q", "in": "query", "description": "Query string to narrow down the response as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n`role` parameter must also be specified.\n", "required": false, "type": "string"}, {"name": "sort", "in": "query", "description": "Field by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n", "required": false, "type": "string"}], "security": [{"oauth2": ["repository"]}, {"basic": []}, {"api_key": []}], "deprecated": true, "x-atlassian-oauth2-scopes": [{"state": "Current", "scheme": "oauth2", "scopes": ["read:repository:bitbucket"]}], "x-atlassian-auth-types": ["api-token"]}, "parameters": []}, "/repositories/{workspace}": {"get": {"tags": ["Repositories"], "description": "Returns a paginated list of all repositories owned by the specified\nworkspace.\n\nThe result can be narrowed down based on the authenticated user's role.\n\nE.g. with `?role=contributor`, only those repositories that the\nauthenticated user has write access to are returned (this includes any\nrepo the user is an admin on, as that implies write access).\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details.", "summary": "List repositories in a workspace", "responses": {"200": {"description": "The repositories owned by the specified account.", "schema": {"$ref": "#/definitions/paginated_repositories"}}, "404": {"description": "If the specified account does not exist.", "schema": {"$ref": "#/definitions/error"}}, "410": {"description": "If the specified account marked as spam.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [{"name": "role", "in": "query", "description": "\nFilters the result based on the authenticated user's role on each repository.\n\n* **member**: returns repositories to which the user has explicit read access\n* **contributor**: returns repositories to which the user has explicit write access\n* **admin**: returns repositories to which the user has explicit administrator access\n* **owner**: returns all repositories owned by the current user\n", "required": false, "type": "string", "enum": ["admin", "contributor", "member", "owner"]}, {"name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n", "required": false, "type": "string"}, {"name": "sort", "in": "query", "description": "\nField by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n        ", "required": false, "type": "string"}], "security": [{"oauth2": ["repository"]}, {"basic": []}, {"api_key": []}], "x-atlassian-oauth2-scopes": [{"state": "Current", "scheme": "oauth2", "scopes": ["read:repository:bitbucket"]}], "x-atlassian-auth-types": ["forge-oauth2", "api-token"]}, "parameters": [{"name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string"}]}, "/repositories/{workspace}/{repo_slug}": {"delete": {"tags": ["Repositories"], "description": "Deletes the repository. This is an irreversible operation.\n\nThis does not affect its forks.", "summary": "Delete a repository", "responses": {"204": {"description": "Indicates successful deletion."}, "403": {"description": "If the caller either does not have admin access to the repository, or the repository is set to read-only.", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "If the repository does not exist.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [{"name": "redirect_to", "in": "query", "description": "If a repository has been moved to a new location, use this parameter to\nshow users a friendly message in the Bitbucket UI that the repository\nhas moved to a new location. However, a GET to this endpoint will still\nreturn a 404.\n", "required": false, "type": "string"}], "security": [{"oauth2": ["repository:delete"]}, {"basic": []}, {"api_key": []}], "x-atlassian-oauth2-scopes": [{"state": "Current", "scheme": "oauth2", "scopes": ["delete:repository:bitbucket"]}], "x-atlassian-auth-types": ["forge-oauth2", "api-token"]}, "get": {"tags": ["Repositories"], "description": "Returns the object describing this repository.", "summary": "Get a repository", "responses": {"200": {"description": "The repository object.", "schema": {"$ref": "#/definitions/repository"}}, "403": {"description": "If the repository is private and the authenticated user does not have access to it.", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "If no repository exists at this location.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": ["repository"]}, {"basic": []}, {"api_key": []}], "produces": ["application/json"], "x-atlassian-oauth2-scopes": [{"state": "Current", "scheme": "oauth2", "scopes": ["read:repository:bitbucket"]}], "x-atlassian-auth-types": ["forge-oauth2", "api-token"]}, "post": {"tags": ["Repositories"], "description": "Creates a new repository.\n\nNote: In order to set the project for the newly created repository,\npass in either the project key or the project UUID as part of the\nrequest body as shown in the examples below:\n\n```\n$ curl -X POST -H \"Content-Type: application/json\" -d '{\n    \"scm\": \"git\",\n    \"project\": {\n        \"key\": \"MARS\"\n    }\n}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding\n```\n\nor\n\n```\n$ curl -X POST -H \"Content-Type: application/json\" -d '{\n    \"scm\": \"git\",\n    \"project\": {\n        \"key\": \"{ba516952-992a-4c2d-acbd-17d502922f96}\"\n    }\n}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding\n```\n\nThe project must be assigned for all repositories. If the project is not provided,\nthe repository is automatically assigned to the oldest project in the workspace.\n\nNote: In the examples above, the workspace ID `teamsinspace`,\nand/or the repository name `hablanding` can be replaced by UUIDs.", "summary": "Create a repository", "responses": {"200": {"description": "The newly created repository.", "schema": {"$ref": "#/definitions/repository"}}, "400": {"description": "If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.", "schema": {"$ref": "#/definitions/error"}}, "401": {"description": "If the request was not authenticated.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [{"name": "_body", "in": "body", "description": "The repository that is to be created. Note that most object elements are optional. Elements \"owner\" and \"full_name\" are ignored as the URL implies them.", "required": false, "schema": {"$ref": "#/definitions/repository"}}], "security": [{"oauth2": ["repository:admin"]}, {"basic": []}, {"api_key": []}], "produces": ["application/json"], "x-atlassian-oauth2-scopes": [{"state": "Current", "scheme": "oauth2", "scopes": ["admin:repository:bitbucket"]}], "x-atlassian-auth-types": ["forge-oauth2", "api-token"]}, "put": {"tags": ["Repositories"], "description": "Since this endpoint can be used to both update and to create a\nrepository, the request body depends on the intent.\n\n#### Creation\n\nSee the POST documentation for the repository endpoint for an example\nof the request body.\n\n#### Update\n\nNote: Changing the `name` of the repository will cause the location to\nbe changed. This is because the URL of the repo is derived from the\nname (a process called slugification). In such a scenario, it is\npossible for the request to fail if the newly created slug conflicts\nwith an existing repository's slug. But if there is no conflict,\nthe new location will be returned in the `Location` header of the\nresponse.", "summary": "Update a repository", "responses": {"200": {"description": "The existing repository has been updated", "schema": {"$ref": "#/definitions/repository"}, "headers": {"Location": {"type": "string", "description": "The location of the repository. This header is only\nprovided when the repository's name is changed."}}}, "201": {"description": "A new repository has been created", "schema": {"$ref": "#/definitions/repository"}, "headers": {"Location": {"type": "string", "description": "The location of the newly created repository"}}}, "400": {"description": "If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.", "schema": {"$ref": "#/definitions/error"}}, "401": {"description": "If the request was not authenticated.", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [{"name": "_body", "in": "body", "description": "The repository that is to be updated.\n\nNote that the elements \"owner\" and \"full_name\" are ignored since the\nURL implies them.\n", "required": false, "schema": {"$ref": "#/definitions/repository"}}], "security": [{"oauth2": ["repository:admin"]}, {"basic": []}, {"api_key": []}], "produces": ["application/json"], "x-atlassian-oauth2-scopes": [{"state": "Current", "scheme": "oauth2", "scopes": ["admin:repository:bitbucket"]}], "x-atlassian-auth-types": ["forge-oauth2", "api-token"]}, "parameters": [{"name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string"}, {"name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string"}]}, "/repositories/{workspace}/{repo_slug}/branch-restrictions": {"get": {"tags": ["Branch restrictions"], "description": "Returns a paginated list of all branch restrictions on the\nrepository.", "summary": "List branch restrictions", "responses": {"200": {"description": "A paginated list of branch restrictions", "schema": {"$ref": "#/definitions/paginated_branchrestrictions"}}, "401": {"description": "If the request was not authenticated", "schema": {"$ref": "#/definitions/error"}}, "403": {"description": "If the authenticated user does not have admin access to the repository", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "If the repository does not exist", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [{"name": "kind", "in": "query", "description": "Branch restrictions of this type", "required": false, "type": "string"}, {"name": "pattern", "in": "query", "description": "Branch restrictions applied to branches of this pattern", "required": false, "type": "string"}], "security": [{"oauth2": ["repository:admin"]}, {"basic": []}, {"api_key": []}], "x-atlassian-oauth2-scopes": [{"state": "Current", "scheme": "oauth2", "scopes": ["admin:repository:bitbucket"]}], "x-atlassian-auth-types": ["forge-oauth2", "api-token"]}, "post": {"tags": ["Branch restrictions"], "description": "Creates a new branch restriction rule for a repository.\n\n`kind` describes what will be restricted. Allowed values include:\n`push`, `force`, `delete`, `restrict_merges`, `require_tasks_to_be_completed`,\n`require_approvals_to_merge`, `require_default_reviewer_approvals_to_merge`,\n`require_no_changes_requested`, `require_passing_builds_to_merge`, `require_commits_behind`,\n`reset_pullrequest_approvals_on_change`, `smart_reset_pullrequest_approvals`,\n`reset_pullrequest_changes_requested_on_change`, `require_all_dependencies_merged`,\n`enforce_merge_checks`, and `allow_auto_merge_when_builds_pass`.\n\nDifferent kinds of branch restrictions have different requirements:\n\n* `push` and `restrict_merges` require `users` and `groups` to be\n  specified. Empty lists are allowed, in which case permission is\n  denied for everybody.\n\nThe restriction applies to all branches that match. There are\ntwo ways to match a branch. It is configured in `branch_match_kind`:\n\n1. `glob`: Matches a branch against the `pattern`. A `'*'` in\n   `pattern` will expand to match zero or more characters, and every\n   other character matches itself. For example, `'foo*'` will match\n   `'foo'` and `'foobar'`, but not `'barfoo'`. `'*'` will match all\n   branches.\n2. `branching_model`: Matches a branch against the repository's\n   branching model. The `branch_type` controls the type of branch\n   to match. Allowed values include: `production`, `development`,\n   `bugfix`, `release`, `feature` and `hotfix`.\n\nThe combination of `kind` and match must be unique. This means that\ntwo `glob` restrictions in a repository cannot have the same `kind` and\n`pattern`. Additionally, two `branching_model` restrictions in a\nrepository cannot have the same `kind` and `branch_type`.\n\n`users` and `groups` are lists of users and groups that are except from\nthe restriction. They can only be configured in `push` and\n`restrict_merges` restrictions. The `push` restriction stops a user\npushing to matching branches unless that user is in `users` or is a\nmember of a group in `groups`. The `restrict_merges` stops a user\nmerging pull requests to matching branches unless that user is in\n`users` or is a member of a group in `groups`. Adding new users or\ngroups to an existing restriction should be done via `PUT`.\n\nNote that branch restrictions with overlapping matchers is allowed,\nbut the resulting behavior may be surprising.", "summary": "Create a branch restriction rule", "responses": {"201": {"description": "A paginated list of branch restrictions", "schema": {"$ref": "#/definitions/branchrestriction"}}, "401": {"description": "If the request was not authenticated", "schema": {"$ref": "#/definitions/error"}}, "403": {"description": "If the authenticated user does not have admin access to the repository", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "If the repository does not exist", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [{"name": "_body", "in": "body", "description": "The new rule", "required": true, "schema": {"$ref": "#/definitions/branchrestriction"}}], "security": [{"oauth2": ["repository:admin"]}, {"basic": []}, {"api_key": []}], "x-atlassian-oauth2-scopes": [{"state": "Current", "scheme": "oauth2", "scopes": ["admin:repository:bitbucket"]}], "x-atlassian-auth-types": ["forge-oauth2", "api-token"]}, "parameters": [{"name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string"}, {"name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string"}]}, "/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}": {"delete": {"tags": ["Branch restrictions"], "description": "Deletes an existing branch restriction rule.", "summary": "Delete a branch restriction rule", "responses": {"204": {"description": ""}, "401": {"description": "If the request was not authenticated", "schema": {"$ref": "#/definitions/error"}}, "403": {"description": "If the authenticated user does not have admin access to the repository", "schema": {"$ref": "#/definitions/error"}}, "404": {"description": "If the repository or branch restriction id does not exist", "schema": {"$ref": "#/definitions/error"}}}, "parameters": [], "security": [{"oauth2": ["repository:admin"]}, {"basic": []}, {"api_key": []}], "x-atlassian-oauth2-scopes": [{

# --- truncated at 32 KB (922 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/bitbucket-pipelines/refs/heads/main/openapi/bitbucket-pipelines-openapi.json