rapipdf
Version:
RapiPdf - Generate PDF from Open API spec
1,560 lines (1,559 loc) • 544 kB
JSON
{
"swagger": "2.0",
"schemes": [
"https"
],
"host": "api.bitbucket.org",
"basePath": "/2.0",
"info": {
"contact": {
"email": "support@bitbucket.org",
"name": "Bitbucket Support",
"url": "https://support.atlassian.com/bitbucket"
},
"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",
"version": "2.0",
"x-apisguru-categories": [
"developer_tools",
"collaboration"
],
"x-logo": {
"url": "https://api.apis.guru/v2/cache/logo/https_d301sr5gafysq2.cloudfront.net_0c55837759e5_img_homepage_bitbucket-logo-blue.svg"
},
"x-origin": [
{
"format": "swagger",
"url": "https://bitbucket.org/api/swagger.json",
"version": "2.0"
}
],
"x-preferred": true,
"x-providerName": "bitbucket.org",
"x-tags": [
"code repository",
"code collaboration",
"git"
]
},
"externalDocs": {
"url": "https://bitbucket.org/api"
},
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"securityDefinitions": {
"api_key": {
"description": "API Keys can be used as Basic HTTP Authentication credentials and provide a substitute for the account's actual username and password. API Keys are only available to team accounts and there is only 1 key per account. API Keys do not support scopes and have therefore access to all contents of the account.",
"in": "header",
"name": "Authorization",
"type": "apiKey"
},
"basic": {
"description": "Basic HTTP Authentication as per [RFC-2617](https://tools.ietf.org/html/rfc2617) (Digest not supported). Note that Basic Auth with username and password as credentials is only available on accounts that have 2-factor-auth / 2-step-verification disabled. If you use 2fa, you should authenticate using OAuth2 instead.",
"type": "basic"
},
"oauth2": {
"authorizationUrl": "https://bitbucket.org/site/oauth2/authorize",
"description": "OAuth 2 as per [RFC-6749](https://tools.ietf.org/html/rfc6749).",
"flow": "accessCode",
"scopes": {
"account": "Read your account information",
"account:write": "Read and modify your account information",
"email": "Read your account's primary email address",
"issue": "Read your repositories' issues",
"issue:write": "Read and modify your repositories' issues",
"pipeline": "Access your repositories' build pipelines",
"pipeline:variable": "Access your repositories' build pipelines and configure their variables",
"pipeline:write": "Access and rerun your repositories' build pipelines",
"project": "Read your team's project settings and read repositories contained within your team's projects",
"project:write": "Read and modify your team's project settings, and read and transfer repositories within your team's projects",
"pullrequest": "Read your repositories and their pull requests",
"pullrequest:write": "Read and modify your repositories and their pull requests",
"repository": "Read your repositories",
"repository:admin": "Administer your repositories",
"repository:delete": "Delete your repositories",
"repository:write": "Read and modify your repositories",
"snippet": "Read your snippets",
"snippet:write": "Read and modify your snippets",
"team": "Read your team membership information",
"team:write": "Read and modify your team membership information",
"webhook": "Read and modify your repositories' webhooks",
"wiki": "Read and modify your repositories' wikis"
},
"tokenUrl": "https://bitbucket.org/site/oauth2/access_token",
"type": "oauth2"
}
},
"tags": [
{
"description": "",
"name": "users"
},
{
"description": "",
"name": "teams"
},
{
"description": "",
"name": "repositories"
},
{
"description": "Browse the source code in the repository and\n create new commits by uploading.",
"name": "source"
},
{
"description": "",
"name": "refs"
},
{
"description": "",
"name": "commits"
},
{
"description": "",
"name": "pullrequests"
},
{
"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.",
"name": "issue_tracker"
},
{
"description": "",
"name": "wiki"
},
{
"description": "",
"name": "downloads"
},
{
"description": "",
"name": "snippets"
},
{
"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\n is 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\n select multiple events that can trigger the webhook.\n* A URL -- The endpoint where you want Bitbucket to send the event payloads\n when 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\n your CI server to start a build.\n* Every time a user pushes commits or creates a pull request, you may want to\n display a notification in your application.\n",
"name": "webhooks"
},
{
"description": "Commit statuses provide a way to tag commits with meta data,\nlike automated build results.\n",
"name": "commitstatuses"
},
{
"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 (bookmark) deletion\n* Prevent history re-writes (Git only)\n",
"name": "branchrestrictions"
},
{
"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": "Bitbucket Pipelines brings continuous delivery to Bitbucket\nCloud, empowering teams with full branching to deployment\nvisibility and faster feedback loops.\n",
"name": "pipelines"
}
],
"paths": {
"/addon": {
"delete": {
"description": "",
"parameters": [],
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"addon"
]
},
"parameters": [],
"put": {
"description": "",
"parameters": [],
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"addon"
]
}
},
"/addon/linkers": {
"get": {
"description": "",
"parameters": [],
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"addon"
]
},
"parameters": []
},
"/addon/linkers/{linker_key}": {
"get": {
"description": "",
"parameters": [],
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"addon"
]
},
"parameters": [
{
"in": "path",
"name": "linker_key",
"required": true,
"type": "string"
}
]
},
"/addon/linkers/{linker_key}/values": {
"delete": {
"description": "",
"parameters": [],
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"addon"
]
},
"get": {
"description": "",
"parameters": [],
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"addon"
]
},
"parameters": [
{
"in": "path",
"name": "linker_key",
"required": true,
"type": "string"
}
],
"post": {
"description": "",
"parameters": [],
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"addon"
]
},
"put": {
"description": "",
"parameters": [],
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"addon"
]
}
},
"/addon/linkers/{linker_key}/values/": {
"delete": {
"description": "",
"parameters": [],
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"addon"
]
},
"get": {
"description": "",
"parameters": [],
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"addon"
]
},
"parameters": [
{
"in": "path",
"name": "linker_key",
"required": true,
"type": "string"
}
]
},
"/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 \"team\": {\n \"links\": {\n \"events\": {\n \"href\": \"https://api.bitbucket.org/2.0/hook_events/team\"\n }\n }\n },\n \"user\": {\n \"links\": {\n \"events\": {\n \"href\": \"https://api.bitbucket.org/2.0/hook_events/user\"\n }\n }\n }\n}\n```",
"parameters": [],
"responses": {
"200": {
"description": "A mapping of resource/subject types pointing to their individual event types.",
"schema": {
"$ref": "#/definitions/subject_types"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"webhooks"
]
},
"parameters": []
},
"/hook_events/{subject_type}": {
"get": {
"description": "Returns a paginated list of all valid webhook events for the\nspecified entity.\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 `team` `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/team\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 {\n \"category\": \"Repository\",\n \"description\": \"Whenever a repository import occurs\",\n \"event\": \"repo:imported\",\n \"label\": \"Import\"\n }\n ]\n}\n```",
"parameters": [
{
"description": "A resource or subject type.",
"enum": [
"user",
"repository",
"team"
],
"in": "path",
"name": "subject_type",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "A paginated list of webhook types available to subscribe on.",
"schema": {
"$ref": "#/definitions/paginated_hook_events"
}
},
"404": {
"description": "If an invalid `{subject_type}` value was specified.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"webhooks"
]
},
"parameters": [
{
"in": "path",
"name": "subject_type",
"required": true,
"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](../meta/filtering) for more details.",
"parameters": [
{
"description": "Filter the results to include only repositories create 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,
"type": "string"
}
],
"responses": {
"200": {
"description": "All public repositories.",
"schema": {
"$ref": "#/definitions/paginated_repositories"
}
}
},
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"repositories"
]
},
"parameters": []
},
"/repositories/{username}": {
"get": {
"description": "Returns a paginated list of all repositories owned by the specified\naccount or UUID.\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](../../meta/filtering) for more details.",
"parameters": [
{
"description": "This can either be the username or the UUID of the user,\nsurrounded by curly-braces, for example: `{user UUID}`.\n",
"in": "path",
"name": "username",
"required": true,
"type": "string"
},
{
"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",
"enum": [
"admin",
"contributor",
"member",
"owner"
],
"in": "query",
"name": "role",
"required": false,
"type": "string"
}
],
"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"
}
}
},
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"repositories"
]
},
"parameters": [
{
"in": "path",
"name": "username",
"required": true,
"type": "string"
}
]
},
"/repositories/{username}/{repo_slug}": {
"delete": {
"description": "Deletes the repository. This is an irreversible operation.\n\nThis does not affect its forks.",
"parameters": [
{
"description": "This can either be the username or the UUID of the user,\nsurrounded by curly-braces, for example: `{user UUID}`.\n",
"in": "path",
"name": "username",
"required": true,
"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,
"type": "string"
}
],
"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"
}
}
},
"security": [
{
"oauth2": [
"repository:delete"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"repositories"
]
},
"get": {
"description": "Returns the object describing this repository.",
"parameters": [
{
"description": "This can either be the username or the UUID of the user,\nsurrounded by curly-braces, for example: `{user UUID}`.\n",
"in": "path",
"name": "username",
"required": true,
"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,
"type": "string"
}
],
"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"
}
}
},
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"repositories"
]
},
"parameters": [
{
"in": "path",
"name": "username",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "repo_slug",
"required": true,
"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 only be assigned for repositories belonging to a team.\nIf the repository owner is a team and the project is not provided, the\nrepository is automatically assigned to the oldest project in the team.\n\nNote: In the examples above, the username `teamsinspace`,\nand/or the repository name `hablanding` can be replaced by UUIDs.",
"parameters": [
{
"description": "This can either be the username or the UUID of the user,\nsurrounded by curly-braces, for example: `{user UUID}`.\n",
"in": "path",
"name": "username",
"required": true,
"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,
"type": "string"
},
{
"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.",
"in": "body",
"name": "_body",
"required": false,
"schema": {
"$ref": "#/definitions/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"
}
}
},
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"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.",
"parameters": [
{
"description": "This can either be the username or the UUID of the user,\nsurrounded by curly-braces, for example: `{user UUID}`.\n",
"in": "path",
"name": "username",
"required": true,
"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,
"type": "string"
},
{
"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",
"in": "body",
"name": "_body",
"required": false,
"schema": {
"$ref": "#/definitions/repository"
}
}
],
"responses": {
"200": {
"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.",
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/repository"
}
},
"201": {
"description": "A new repository has been created",
"headers": {
"Location": {
"description": "The location of the newly created repository",
"type": "string"
}
},
"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"
}
}
},
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"repositories"
]
}
},
"/repositories/{username}/{repo_slug}/branch-restrictions": {
"get": {
"description": "Returns a paginated list of all branch restrictions on the\nrepository.",
"parameters": [],
"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"
}
}
},
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"branchrestrictions"
]
},
"parameters": [
{
"in": "path",
"name": "username",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "repo_slug",
"required": true,
"type": "string"
}
],
"post": {
"description": "Creates a new branch restriction rule for a repository.\n\n`kind` describes what will be restricted. Allowed values are: `push`,\n`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* `force` can not be specified in a Mercurial repository.\n\n`pattern` is used to determine which branches will be restricted.\n\nA `'*'` in `pattern` will expand to match zero or more characters, and\nevery other character matches itself. For example, `'foo*'` will match\n`'foo'` and `'foobar'`, but not `'barfoo'`. `'*'` will match all\nbranches.\n\n`users` and `groups` are lists of user names and group names.\n\n`kind` and `pattern` must be unique within a repository; adding new\nusers or groups to an existing restriction should be done via `PUT`.\n\nNote that branch restrictions with overlapping patterns are allowed,\nbut the resulting behavior may be surprising.",
"parameters": [
{
"description": "The new rule",
"in": "body",
"name": "_body",
"required": true,
"schema": {
"$ref": "#/definitions/branchrestriction"
}
}
],
"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"
}
}
},
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"branchrestrictions"
]
}
},
"/repositories/{username}/{repo_slug}/branch-restrictions/{id}": {
"delete": {
"description": "Deletes an existing branch restriction rule.",
"parameters": [
{
"description": "The restriction rule's id",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}
],
"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"
}
}
},
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"branchrestrictions"
]
},
"get": {
"description": "Returns a specific branch restriction rule.",
"parameters": [
{
"description": "The restriction rule's id",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The branch restriction rule",
"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 or branch restriction id does not exist",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"branchrestrictions"
]
},
"parameters": [
{
"in": "path",
"name": "username",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "id",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "repo_slug",
"required": true,
"type": "string"
}
],
"put": {
"description": "Updates an existing branch restriction rule.\n\nFields not present in the request body are ignored.\n\nSee [`POST`](../../branch-restrictions#post) for details.",
"parameters": [
{
"description": "The restriction rule's id",
"in": "path",
"name": "id",
"required": true,
"type": "string"
},
{
"description": "The new version of the existing rule",
"in": "body",
"name": "_body",
"required": true,
"schema": {
"$ref": "#/definitions/branchrestriction"
}
}
],
"responses": {
"200": {
"description": "The updated branch restriction rule",
"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 or branch restriction id does not exist",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"branchrestrictions"
]
}
},
"/repositories/{username}/{repo_slug}/commit/{node}/approve": {
"delete": {
"description": "Redact the authenticated user's approval of the specified commit.\n\nThis operation is only available to users that have explicit access to\nthe repository. In contrast, just the fact that a repository is\npublicly accessible to users does not give them the ability to approve\ncommits.",
"parameters": [
{
"description": "The commit's SHA1.",
"in": "path",
"name": "node",
"required": true,
"type": "string"
}
],
"responses": {
"204": {
"description": "An empty response indicating the authenticated user's approval has been withdrawn."
},
"404": {
"description": "If the specified commit, or the repository does not exist.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": [
"repository:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"commits"
]
},
"parameters": [
{
"in": "path",
"name": "username",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "node",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "repo_slug",
"required": true,
"type": "string"
}
],
"post": {
"description": "Approve the specified commit as the authenticated user.\n\nThis operation is only available to users that have explicit access to\nthe repository. In contrast, just the fact that a repository is\npublicly accessible to users does not give them the ability to approve\ncommits.",
"parameters": [
{
"description": "The commit's SHA1.",
"in": "path",
"name": "node",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The `participant` object recording that the authenticated user approved the commit.",
"schema": {
"$ref": "#/definitions/participant"
}
},
"404": {
"description": "If the specified commit, or the repository does not exist.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": [
"repository:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"commits"
]
}
},
"/repositories/{username}/{repo_slug}/commit/{node}/statuses": {
"get": {
"description": "Returns all statuses (e.g. build results) for a specific commit.",
"parameters": [
{
"description": "The commit's SHA1",
"in": "path",
"name": "node",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "A paginated list of all commit statuses for this commit.",
"schema": {
"$ref": "#/definitions/paginated_commitstatuses"
}
},
"401": {
"description": "If the repository is private and the request was not authenticated."
},
"404": {
"description": "If the repository or commit does not exist",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"repositories",
"commitstatuses"
]
},
"parameters": [
{
"in": "path",
"name": "username",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "node",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "repo_slug",
"required": true,
"type": "string"
}
]
},
"/repositories/{username}/{repo_slug}/commit/{node}/statuses/build": {
"parameters": [
{
"in": "path",
"name": "username",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "node",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "repo_slug",
"required": true,
"type": "string"
}
],
"post": {
"description": "Creates a new build status against the specified commit.\n\nIf the specified key already exists, the existing status object will\nbe overwritten.\n\nWhen creating a new commit status, you can use a URI template for the URL.\nTemplates are URLs that contain variable names that Bitbucket will\nevaluate at runtime whenever the URL is displayed anywhere similar to\nparameter substitution in\n[Bitbucket Connect](https://developer.atlassian.com/bitbucket/concepts/context-parameters.html).\nFor example, one could use `https://foo.com/builds/{repository.full_name}`\nwhich Bitbucket will turn into `https://foo.com/builds/foo/bar` at render time.\nThe context variables available are `repository` and `commit`.",
"parameters": [
{
"description": "The commit's SHA1",
"in": "path",
"name": "node",
"required": true,
"type": "string"
}
],
"responses": {
"201": {
"description": "The newly created build status object.",
"schema": {
"$ref": "#/definitions/commitstatus"
}
},
"401": {
"description": "If the repository is private and the request was not authenticated."
},
"404": {
"description": "If the repository, commit, or build status key does not exist",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"repositories",
"commitstatuses"
]
}
},
"/repositories/{username}/{repo_slug}/commit/{node}/statuses/build/{key}": {
"get": {
"description": "Returns the specified build status for a commit.",
"parameters": [
{
"description": "The commit's SHA1",
"in": "path",
"name": "node",
"required": true,
"type": "string"
},
{
"description": "The build status' unique key",
"in": "path",
"name": "key",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The build status object with the specified key.",
"schema": {
"$ref": "#/definitions/commitstatus"
}
},
"401": {
"description": "If the repository is private and the request was not authenticated."
},
"404": {
"description": "If the repository, commit, or build status key does not exist",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"tags": [
"repositories",
"commitstatuses"
]
},
"parameters": [
{
"in": "path",
"name": "username",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "node",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "key",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "repo_slug",
"required": true,
"type": "string"
}
],
"put": {
"description": "Used to update the current status of a build status object on the\nspecific commit.\n\nThis operation can also be used to change other properties of the\nbuild status:\n\n* `state`\n* `name`\n* `description`\n* `url`\n* `refname`\n\nThe `key` cannot be changed.",
"parameters": [
{
"description": "The commit's SHA1",
"in": "path",
"name": "node",
"required": true,
"type": "string"
},
{
"description": "The commit status' unique key",
"in": "path",
"name": "key",
"required": true,
"type": "string"
},
{
"description": "The updated build status object",
"in": "body",
"name": "_body",