openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 835 kB
JSON
{"openapi":"3.0.0","servers":[{"url":"https://api.bitbucket.org/2.0"}],"info":{"contact":{"email":"support@bitbucket.org","name":"Bitbucket Support","url":"https://support.atlassian.com/bitbucket-cloud/"},"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.","termsOfService":"https://www.atlassian.com/legal/customer-agreement","title":"Bitbucket API","version":"2.0","x-apisguru-categories":["developer_tools","collaboration"],"x-logo":{"url":"https://d301sr5gafysq2.cloudfront.net/0c55837759e5/img/homepage/bitbucket-logo-blue.svg"},"x-origin":[{"format":"openapi","url":"https://bitbucket.org/api/swagger.json","version":"3.0"}],"x-providerName":"bitbucket.org","x-tags":["code repository","code collaboration","git"]},"externalDocs":{"url":"https://bitbucket.org/api"},"tags":[{"description":"The addon resource is intended to use used by Bitbucket Cloud Connect\nApps, and only supports JWT authentication.\n","name":"Addon"},{"description":"Repository owners and administrators can set branch management\nrules on a repository that control what can be pushed by whom.\nThrough these rules, you can enforce a project or team\nworkflow. For example, owners or administrators can:\n\n* Limit push powers\n* Prevent branch deletion\n* Prevent history re-writes (Git only)\n","name":"Branch restrictions"},{"description":"The branching model resource is used to modify the branching model\nfor a repository.\n\nYou can use the branching model to define a branch based workflow\nfor your repositories. When you map your workflow to branch types,\nyou can ensure that branches are named consistently by configuring\nwhich branch types to make available.\n","name":"Branching model"},{"description":"Commit statuses provide a way to tag commits with meta data,\nlike automated build results.\n","name":"Commit statuses"},{"description":"These are the repository's commits. They are paginated and returned in\nreverse chronological order, similar to the output of git log.\n","name":"Commits"},{"description":"Teams are deploying code faster than ever, thanks to continuous\ndelivery practices and tools like Bitbucket Pipelines. Bitbucket\nDeployments gives teams visibility into their deployment\nenvironments and helps teams to track how far changes have\nprogressed in their deployment pipeline.\n","name":"Deployments"},{"description":"Access the list of download links associated with the repository.","name":"Downloads"},{"description":"The issue resources provide functionality for getting information on\nissues in an issue tracker, creating new issues, updating them and deleting\nthem.\n\nYou can access public issues without authentication, but you can't gain access\nto private repositories' issues. By authenticating, you will get the ability\nto create issues, as well as access to updating data or deleting issues you\nhave access to.\n","name":"Issue tracker"},{"description":"Bitbucket Pipelines brings continuous delivery to Bitbucket\nCloud, empowering teams with full branching to deployment\nvisibility and faster feedback loops.\n","name":"Pipelines"},{"description":"Bitbucket Cloud projects make it easier for teams to focus on\na goal, product, or process by organizing their repositories.\n","name":"Projects"},{"description":"Pull requests are a feature that makes it easier for developers\nto collaborate using Bitbucket. They provide a user-friendly web\ninterface for discussing proposed changes before integrating them\ninto the official project.\n","name":"Pullrequests"},{"description":"The refs resource allows you access branches and tags in a repository.\nBy default, results will be in the order the underlying source control\nsystem returns them and identical to the ordering one sees when running\n\"$ git show-ref\". Note that this follows simple lexical ordering of the\n ref names.\n","name":"Refs"},{"description":"Code insights provides reports, annotations, and metrics to help you\nand your team improve code quality in pull requests throughout the code\nreview process. Some of the available code insights are static analysis\nreports, security scan results, artifact links, unit tests, and build\nstatus.\n","name":"Reports"},{"description":"A Git repository is a virtual storage of your project. It\nallows you to save versions of your code, which you can access\nwhen needed. The repo resource allows you to access public repos,\nor repos that belong to a specific workspace.\n","name":"Repositories"},{"description":"Snippets allow you share code segments or files with yourself, members of\nyour workspace, or the world.\n\nLike pull requests, repositories and workspaces, the full set of snippets\nis defined by what the current user has access to. This includes all\nsnippets owned by any of the workspaces the user is a member of, or\nsnippets by other users that the current user is either watching or has\n collaborated on (for instance by commenting on it).\n","name":"Snippets"},{"description":"Browse the source code in the repository and\n create new commits by uploading.","name":"Source"},{"description":"The SSH resource allows you to manage SSH keys.\n","name":"Ssh"},{"description":"The teams resource has been deprecated, and the workspaces\nendpoint should be used instead.\n\nThe teams resource returns all the teams that the authenticated\nuser is associated with.\n","name":"Teams"},{"description":"The users resource allows you to access public information\nassociated with a user account. Most resources in the users\nendpoint have been deprecated in favor of workspaces.\n","name":"Users"},{"description":"Webhooks provide a way to configure Bitbucket Cloud to make requests to\nyour server (or another external service) whenever certain events occur in\nBitbucket Cloud.\n\nA webhook consists of:\n\n* A subject -- The resource that generates the events. Currently, this resource\nis the repository, user account, or team where you create the webhook.\n* One or more event -- The default event is a repository push, but you can\nselect multiple events that can trigger the webhook.\n* A URL -- The endpoint where you want Bitbucket to send the event payloads\nwhen a matching event happens.\n\nThere are two parts to getting a webhook to work: creating the webhook and\ntriggering the webhook. After you create a webhook for an event, every time\nthat event occurs, Bitbucket sends a payload request that describes the event\nto the specified URL. Thus, you can think of webhooks as a kind of\nnotification system.\n\nUse webhooks to integrate applications with Bitbucket Cloud. The following\nuse cases provides examples of when you would want to use webhooks:\n\n* Every time a user pushes commits in a repository, you may want to notify\nyour CI server to start a build.\n* Every time a user pushes commits or creates a pull request, you may want to\ndisplay a notification in your application.\n","name":"Webhooks"},{"description":"The wiki is a simple place to keep documents. Some people use it\nas their project home page. The wiki is a Git repository, so you\ncan clone it and edit it like any other source files.\n","name":"Wiki"},{"description":"A workspace is where you create repositories, collaborate on\nyour code, and organize different streams of work in your Bitbucket\nCloud account. Workspaces replace the use of teams and users in API\ncalls.\n","name":"Workspaces"}],"paths":{"/addon":{"delete":{"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```","responses":{"204":{"description":"Request has succeeded. The application has been deleted for the user."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"No authorization."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Improper authentication."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"Delete an app","tags":["Addon"]},"parameters":[],"put":{"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.","responses":{"204":{"description":"Request has succeeded. The installation has been updated to the new descriptor."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Scopes have increased or decreased to none."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"No authorization."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Improper authentication."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"Update an installed app","tags":["Addon"]}},"/addon/linkers":{"get":{"description":"Gets a list of all [linkers](/cloud/bitbucket/modules/linker/)\nfor the authenticated application.","responses":{"200":{"description":"Successful."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Authentication must use app JWT"}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"List linkers for an app","tags":["Addon"]},"parameters":[]},"/addon/linkers/{linker_key}":{"get":{"description":"Gets a [linker](/cloud/bitbucket/modules/linker/) specified by `linker_key`\nfor the authenticated application.","responses":{"200":{"description":"Successful."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Authentication must use app JWT"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"The linker does not exist."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"Get a linker for an app","tags":["Addon"]},"parameters":[{"description":"The unique key of a [linker module](/cloud/bitbucket/modules/linker/)\nas defined in an application descriptor.","in":"path","name":"linker_key","required":true,"schema":{"type":"string"}}]},"/addon/linkers/{linker_key}/values":{"delete":{"description":"Delete all [linker](/cloud/bitbucket/modules/linker/) values for the\nspecified linker of the authenticated application.","responses":{"204":{"description":"Successfully deleted the linker values."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Authentication must use app JWT"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"The linker does not exist."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"Delete all linker values","tags":["Addon"]},"get":{"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)","responses":{"200":{"description":"Successful."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Authentication must use app JWT"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"The linker does not exist."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"List linker values for a linker","tags":["Addon"]},"parameters":[{"description":"The unique key of a [linker module](/cloud/bitbucket/modules/linker/)\nas defined in an application descriptor.","in":"path","name":"linker_key","required":true,"schema":{"type":"string"}}],"post":{"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)","responses":{"201":{"description":"Successfully created the linker value."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Authentication must use app JWT"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"The linker does not exist."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"The linker already has the value being added."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"Create a linker value","tags":["Addon"]},"put":{"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)","responses":{"204":{"description":"Successfully updated the linker values."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Invalid input."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Authentication must use app JWT"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"The linker does not exist."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"Update a linker value","tags":["Addon"]}},"/addon/linkers/{linker_key}/values/{value_id}":{"delete":{"description":"Delete a single [linker](/cloud/bitbucket/modules/linker/) value\nof the authenticated application.","responses":{"204":{"description":"Successfully deleted the linker value."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Authentication must use app JWT"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"The linker value does not exist."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"Delete a linker value","tags":["Addon"]},"get":{"description":"Get a single [linker](/cloud/bitbucket/modules/linker/) value\nof the authenticated application.","responses":{"200":{"description":"Successful."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"Authentication must use app JWT"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"The linker value does not exist."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"Get a linker value","tags":["Addon"]},"parameters":[{"description":"The unique key of a [linker module](/cloud/bitbucket/modules/linker/)\nas defined in an application descriptor.","in":"path","name":"linker_key","required":true,"schema":{"type":"string"}},{"description":"The numeric ID of the linker value.","in":"path","name":"value_id","required":true,"schema":{"type":"integer"}}]},"/hook_events":{"get":{"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.\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/hook_events\n\n{\n \"repository\": {\n \"links\": {\n \"events\": {\n \"href\": \"https://api.bitbucket.org/2.0/hook_events/repository\"\n }\n }\n },\n \"workspace\": {\n \"links\": {\n \"events\": {\n \"href\": \"https://api.bitbucket.org/2.0/hook_events/workspace\"\n }\n }\n }\n}\n```","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/subject_types"}}},"description":"A mapping of resource/subject types pointing to their individual event types."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"Get a webhook resource","tags":["Webhooks"]},"parameters":[]},"/hook_events/{subject_type}":{"get":{"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\nExample:\n\nNOTE: The following example is a truncated response object for the `workspace` `subject_type`.\nWe return the same structure for the other `subject_type` objects.\n\n```\n$ curl https://api.bitbucket.org/2.0/hook_events/workspace\n{\n \"page\": 1,\n \"pagelen\": 30,\n \"size\": 21,\n \"values\": [\n {\n \"category\": \"Repository\",\n \"description\": \"Whenever a repository push occurs\",\n \"event\": \"repo:push\",\n \"label\": \"Push\"\n },\n {\n \"category\": \"Repository\",\n \"description\": \"Whenever a repository fork occurs\",\n \"event\": \"repo:fork\",\n \"label\": \"Fork\"\n },\n {\n \"category\": \"Repository\",\n \"description\": \"Whenever a repository import occurs\",\n \"event\": \"repo:imported\",\n \"label\": \"Import\"\n },\n ...\n {\n \"category\":\"Pull Request\",\n \"label\":\"Approved\",\n \"description\":\"When someone has approved a pull request\",\n \"event\":\"pullrequest:approved\"\n },\n ]\n}\n```","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/paginated_hook_events"}}},"description":"A paginated list of webhook types available to subscribe on."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If an invalid `{subject_type}` value was specified."}},"security":[{"oauth2":[]},{"basic":[]},{"api_key":[]}],"summary":"List subscribable webhook types","tags":["Webhooks"]},"parameters":[{"description":"A resource or subject type.","in":"path","name":"subject_type","required":true,"schema":{"enum":["repository","workspace"],"type":"string"}}]},"/pullrequests/{selected_user}":{"get":{"description":"Returns all pull requests authored by the specified user.\n\nBy default only open pull requests are returned. This can be controlled\nusing the `state` query parameter. To retrieve pull requests that are\nin one of multiple states, repeat the `state` parameter for each\nindividual state.\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details.","parameters":[{"description":"Only return pull requests that are in this state. This parameter can be repeated.","in":"query","name":"state","schema":{"enum":["OPEN","MERGED","DECLINED","SUPERSEDED"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/paginated_pullrequests"}}},"description":"All pull requests authored by the specified user."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the specified user does not exist."}},"security":[{"oauth2":["pullrequest"]},{"basic":[]},{"api_key":[]}],"summary":"List pull requests for a user","tags":["Pullrequests"]},"parameters":[{"description":"This can either be the username of the pull request author, the author's UUID\nsurrounded by curly-braces, for example: `{account UUID}`, or the author's Atlassian ID.\n","in":"path","name":"selected_user","required":true,"schema":{"type":"string"}}]},"/repositories":{"get":{"description":"Returns 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.","parameters":[{"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`","in":"query","name":"after","required":false,"schema":{"type":"string"}},{"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","in":"query","name":"role","required":false,"schema":{"enum":["admin","contributor","member","owner"],"type":"string"}},{"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","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Field by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n","in":"query","name":"sort","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/paginated_repositories"}}},"description":"All public repositories."}},"security":[{"oauth2":["repository"]},{"basic":[]},{"api_key":[]}],"summary":"List public repositories","tags":["Repositories"]},"parameters":[]},"/repositories/{workspace}":{"get":{"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.","parameters":[{"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","in":"query","name":"role","required":false,"schema":{"enum":["admin","contributor","member","owner"],"type":"string"}},{"description":"\nQuery string to narrow down the response as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"\nField by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n ","in":"query","name":"sort","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/paginated_repositories"}}},"description":"The repositories owned by the specified account."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the specified account does not exist."},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the specified account marked as spam."}},"security":[{"oauth2":["repository"]},{"basic":[]},{"api_key":[]}],"summary":"List repositories in a workspace","tags":["Repositories"]},"parameters":[{"description":"This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n","in":"path","name":"workspace","required":true,"schema":{"type":"string"}}]},"/repositories/{workspace}/{repo_slug}":{"delete":{"description":"Deletes the repository. This is an irreversible operation.\n\nThis does not affect its forks.","parameters":[{"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","in":"query","name":"redirect_to","required":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Indicates successful deletion."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the caller either does not have admin access to the repository, or the repository is set to read-only."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the repository does not exist."}},"security":[{"oauth2":["repository:delete"]},{"basic":[]},{"api_key":[]}],"summary":"Delete a repository","tags":["Repositories"]},"get":{"description":"Returns the object describing this repository.","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/repository"}}},"description":"The repository object."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the repository is private and the authenticated user does not have access to it."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If no repository exists at this location."}},"security":[{"oauth2":["repository"]},{"basic":[]},{"api_key":[]}],"summary":"Get a repository","tags":["Repositories"]},"parameters":[{"description":"This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n","in":"path","name":"repo_slug","required":true,"schema":{"type":"string"}},{"description":"This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n","in":"path","name":"workspace","required":true,"schema":{"type":"string"}}],"post":{"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.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/repository"}}},"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."},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/repository"}}},"description":"The newly created repository."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the request was not authenticated."}},"security":[{"oauth2":["repository:admin"]},{"basic":[]},{"api_key":[]}],"summary":"Create a repository","tags":["Repositories"]},"put":{"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.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/repository"}}},"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"},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/repository"}}},"description":"The existing repository has been updated","headers":{"Location":{"description":"The location of the repository. This header is only\nprovided when the repository's name is changed.","schema":{"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/repository"}}},"description":"A new repository has been created","headers":{"Location":{"description":"The location of the newly created repository","schema":{"type":"string"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the request was not authenticated."}},"security":[{"oauth2":["repository:admin"]},{"basic":[]},{"api_key":[]}],"summary":"Update a repository","tags":["Repositories"]}},"/repositories/{workspace}/{repo_slug}/branch-restrictions":{"get":{"description":"Returns a paginated list of all branch restrictions on the\nrepository.","parameters":[{"description":"Branch restrictions of this type","in":"query","name":"kind","required":false,"schema":{"type":"string"}},{"description":"Branch restrictions applied to branches of this pattern","in":"query","name":"pattern","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/paginated_branchrestrictions"}}},"description":"A paginated list of branch restrictions"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the request was not authenticated"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the authenticated user does not have admin access to the repository"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the repository does not exist"}},"security":[{"oauth2":["repository:admin"]},{"basic":[]},{"api_key":[]}],"summary":"List branch restrictions","tags":["Branch restrictions"]},"parameters":[{"description":"This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n","in":"path","name":"repo_slug","required":true,"schema":{"type":"string"}},{"description":"This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n","in":"path","name":"workspace","required":true,"schema":{"type":"string"}}],"post":{"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` and `restrict_merges`.\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.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/branchrestriction"}}},"description":"The new rule","required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/branchrestriction"}}},"description":"A paginated list of branch restrictions"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the request was not authenticated"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the authenticated user does not have admin access to the repository"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the repository does not exist"}},"security":[{"oauth2":["repository:admin"]},{"basic":[]},{"api_key":[]}],"summary":"Create a branch restriction rule","tags":["Branch restrictions"]}},"/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}":{"delete":{"description":"Deletes an existing branch restriction rule.","responses":{"204":{"description":""},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the request was not authenticated"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the authenticated user does not have admin access to the repository"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the repository or branch restriction id does not exist"}},"security":[{"oauth2":["repository:admin"]},{"basic":[]},{"api_key":[]}],"summary":"Delete a branch restriction rule","tags":["Branch restrictions"]},"get":{"description":"Returns a specific branch restriction rule.","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/branchrestriction"}}},"description":"The branch restriction rule"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the request was not authenticated"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the authenticated user does not have admin access to the repository"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the repository or branch restriction id does not exist"}},"security":[{"oauth2":["repository:admin"]},{"basic":[]},{"api_key":[]}],"summary":"Get a branch restriction rule","tags":["Branch restrictions"]},"parameters":[{"description":"The restriction rule's id","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n","in":"path","name":"repo_slug","required":true,"schema":{"type":"string"}},{"description":"This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n","in":"path","name":"workspace","required":true,"schema":{"type":"string"}}],"put":{"description":"Updates an existing branch restriction rule.\n\nFields not present in the request body are ignored.\n\nSee [`POST`](/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-post) for details.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/branchrestriction"}}},"description":"The new version of the existing rule","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/branchrestriction"}}},"description":"The updated branch restriction rule"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the request was not authenticated"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the authenticated user does not have admin access to the repository"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the repository or branch restriction id does not exist"}},"security":[{"oauth2":["repository:admin"]},{"basic":[]},{"api_key":[]}],"summary":"Update a branch restriction rule","tags":["Branch restrictions"]}},"/repositories/{workspace}/{repo_slug}/branching-model":{"get":{"description":"Return the branching model as applied to the repository. This view is\nread-only. The branching model settings can be changed using the\n[settings](#api-repositories-workspace-repo-slug-branching-model-settings-get) API.\n\nThe returned object:\n\n1. Always has a `development` property. `development.branch` contains\n the actual repository branch object that is considered to be the\n `development` branch. `development.branch` will not be present\n if it does not exist.\n2. Might have a `production` property. `production` will not\n be present when `production` is disabled.\n `production.branch` contains the actual branch object that is\n considered to be the `production` branch. `production.branch` will\n not be present if it does not exist.\n3. Always has a `branch_types` array which contains all enabled branch\n types.\n\nExample body:\n\n```\n{\n \"development\": {\n \"name\": \"master\",\n \"branch\": {\n \"type\": \"branch\",\n \"name\": \"master\",\n \"target\": {\n \"hash\": \"16dffcb0de1b22e249db6799532074cf32efe80f\"\n }\n },\n \"use_mainbranch\": true\n },\n \"production\": {\n \"name\": \"production\",\n \"branch\": {\n \"type\": \"branch\",\n \"name\": \"production\",\n \"target\": {\n \"hash\": \"16dffcb0de1b22e249db6799532074cf32efe80f\"\n }\n },\n \"use_mainbranch\": false\n },\n \"branch_types\": [\n {\n \"kind\": \"release\",\n \"prefix\": \"release/\"\n },\n {\n \"kind\": \"hotfix\",\n \"prefix\": \"hotfix/\"\n },\n {\n \"kind\": \"feature\",\n \"prefix\": \"feature/\"\n },\n {\n \"kind\": \"bugfix\",\n \"prefix\": \"bugfix/\"\n }\n ],\n \"type\": \"branching_model\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/.../branching-model\"\n }\n }\n}\n```","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/branching_model"}}},"description":"The branching model object"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the request was not authenticated"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the authenticated user does not have read access to the repository"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the repository does not exist"}},"security":[{"oauth2":["repository"]},{"basic":[]},{"api_key":[]}],"summary":"Get the branching model for a repository","tags":["Branching model"]},"parameters":[{"description":"This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n","in":"path","name":"repo_slug","required":true,"schema":{"type":"string"}},{"description":"This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n","in":"path","name":"workspace","required":true,"schema":{"type":"string"}}]},"/repositories/{workspace}/{repo_slug}/branching-model/settings":{"get":{"description":"Return the branching model configuration for a repository. The returned\nobject:\n\n1. Always has a `development` property for the development branch.\n2. Always a `production` property for the production branch. The\n production branch can be disabled.\n3. The `branch_types` contains all the branch types.\n\nThis is the raw configuration for the branching model. A client\nwishing to see the branching model with its actual current branches may\nfind the [active model API](/cloud/bitbucket/rest/api-group-branching-model/#api-repositories-workspace-repo-slug-branching-model-get) more useful.\n\nExample body:\n\n```\n{\n \"development\": {\n \"is_valid\": true,\n \"name\": null,\n \"use_mainbranch\": true\n },\n \"production\": {\n \"is_valid\": true,\n \"name\": \"production\",\n \"use_mainbranch\": false,\n \"enabled\": false\n },\n \"branch_types\": [\n {\n \"kind\": \"release\",\n \"enabled\": true,\n \"prefix\": \"release/\"\n },\n {\n \"kind\": \"hotfix\",\n \"enabled\": true,\n \"prefix\": \"hotfix/\"\n },\n {\n \"kind\": \"feature\",\n \"enabled\": true,\n \"prefix\": \"feature/\"\n },\n {\n \"kind\": \"bugfix\",\n \"enabled\": false,\n \"prefix\": \"bugfix/\"\n }\n ],\n \"type\": \"branching_model_settings\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/.../branching-model/settings\"\n }\n }\n}\n```","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/branching_model_settings"}}},"description":"The branching model configuration"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the request was not authenticated"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the authenticated user does not have admin access to the repository"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}},"description":"If the repository does not exist"}},"security":[{"oauth2":["repository:admin"]},{"basic":[]},{"api_key":[]}],"summary":"Get the branching model config for a repository","tags":["Branching model"]},"parameters":[{"description":"This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n","in":"path","name":"repo_slug","required":true,"schema":{"type":"string"}},{"description":"This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n","in":"path","name":"workspace","required":true,"schema":{"type":"string"}}],"put":{"description":"Update the branching model configuration for a repository.\n\nThe `development` branch can be configured to a specific branch or to\ntrack the main branch. When set to a specific branch it must\ncurrently exist. Only the passed properties will be updated. The\nproperties not passed will be left unchanged. A request without a\n`development` property will leave the development branch unchanged.\n\nIt is possible for the `development` branch to be invalid. This\nhappens when it points at a specific branch that has been\ndeleted. This is indicated in the `is_valid` field for the branch. It is\nnot possible to update the settings for `development` if that\nwould leave the branch in an invalid state. Such a request will be\nrejected.\n\nThe `production` branch can be a specific branch, the main\nbranch or disabled. When set to a specific branch it must currently\nexist. The `enabled` property can be used to enable (`true`) or\ndisable (`false`) it. Only the passed properties will be updated. The\nproperties not passed will be left unchanged. A request without a\n`production` property will leave the production branch unchanged.\n\nIt is possible for the `production` branch to be invalid. This\nhappens when it points at a specific branch that has been\ndeleted. This is indicated in the `is_valid` field for the branch. A\nrequest that would leave `production` enabled and invalid will be\nrejected. It is possible to update `production` and make it invalid if\nit would also be left disabled.\n\nThe `branch_types` property contains the branch types to be updated.\nOnly the branch types passed will be updated. All updates will be\nrejected if it would leave the branching model in an invalid state.\nFor branch types this means that:\n\n1. The prefixes for all enabled branch types are valid. For example,\n it is not possible to use '*' inside a Git prefix.\n2. A prefix of an enabled branch type must not be a prefix of another\n enabled branch type. This is to ensure that a branch can be easily\n classified by its prefix unambiguously.\n\nIt is possible to store an invalid prefix if that branch type would be\nleft disabled. Only the passed properties will be updated. The\nproperties not passed will be left unchanged. Each branch type must\nhave a `kind` property to identify it.\n\nExample Body:\n\n```\n {\n \"development\": {\n \"use_mainbranch\": true\n },\n \"production\": {\n \"enabled\": true,\n \"use_mainbranch\": false,\n \"name\": \"production\"\n },\n \"branch_types\": [\n {\n \"kind\": \"bugfix\",\n \"enabled\": true,\n \"prefix\": \"bugfix/\"\n },\n {\n \"kind\": \"feature\",\n \"enabled\": true,\n \"prefix\": \"feature/\"\n },\n {\n \"kind\": \"hotfi