{ "info": { "_postman_id": "aaddb632-f083-47c5-8242-26e0dbe7f05b", "name": "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.", "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" }, "item": [ { "name": "Addon", "description": "The addon resource is intended to use used by Bitbucket Cloud Connect\nApps, and only supports JWT authentication.\n", "item": [ { "name": "Update an installed app", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}addon", "query": [], "variable": [] }, "method": "PUT", "header": [], "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 \" \\\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 \" \\\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 \" \\\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." }, "response": [] }, { "name": "Delete an app", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}addon", "query": [], "variable": [] }, "method": "DELETE", "header": [], "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 \"\n```" }, "response": [] }, { "name": "List linkers for an app", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}addon/linkers", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Gets a list of all [linkers](/cloud/bitbucket/modules/linker/)\nfor the authenticated application." }, "response": [] }, { "name": "Get a linker for an app", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}addon/linkers/:linker_key", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Gets a [linker](/cloud/bitbucket/modules/linker/) specified by `linker_key`\nfor the authenticated application." }, "response": [] }, { "name": "List linker values for a linker", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}addon/linkers/:linker_key/values", "query": [], "variable": [] }, "method": "GET", "header": [], "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)" }, "response": [] }, { "name": "Update a linker value", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}addon/linkers/:linker_key/values", "query": [], "variable": [] }, "method": "PUT", "header": [], "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)" }, "response": [] }, { "name": "Create a linker value", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}addon/linkers/:linker_key/values", "query": [], "variable": [] }, "method": "POST", "header": [], "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)" }, "response": [] }, { "name": "Delete all linker values", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}addon/linkers/:linker_key/values", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Delete all [linker](/cloud/bitbucket/modules/linker/) values for the\nspecified linker of the authenticated application." }, "response": [] }, { "name": "Get a linker value", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}addon/linkers/:linker_key/values/:value_id", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Get a single [linker](/cloud/bitbucket/modules/linker/) value\nof the authenticated application." }, "response": [] }, { "name": "Delete a linker value", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}addon/linkers/:linker_key/values/:value_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Delete a single [linker](/cloud/bitbucket/modules/linker/) value\nof the authenticated application." }, "response": [] } ] }, { "name": "Branch restrictions", "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", "item": [ { "name": "List branch restrictions", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/branch-restrictions", "query": [ { "key": "kind", "value": "{{kind}}", "disabled": true, "description": "Branch restrictions of this type" }, { "key": "pattern", "value": "{{pattern}}", "disabled": true, "description": "Branch restrictions applied to branches of this pattern" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of all branch restrictions on the\nrepository." }, "response": [] }, { "name": "Create a branch restriction rule", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/branch-restrictions", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "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.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a branch restriction rule", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/branch-restrictions/:id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a specific branch restriction rule." }, "response": [] }, { "name": "Update a branch restriction rule", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/branch-restrictions/:id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a branch restriction rule", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/branch-restrictions/:id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes an existing branch restriction rule." }, "response": [] } ] }, { "name": "Branching model", "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", "item": [ { "name": "Get the branching model for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/branching-model", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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." }, "response": [] }, { "name": "Get the branching model config for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/branching-model/settings", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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." }, "response": [] }, { "name": "Update the branching model config for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/branching-model/settings", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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\nThere is currently a side effect when using this API endpoint. If the\nrepository is inheriting branching model settings from its project,\nupdating the branching model for this repository will disable the\nproject setting inheritance.\n\n\nWe have deprecated this side effect and will remove it on 1 August 2022." }, "response": [] }, { "name": "Get the effective, or currently applied, branching model for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/effective-branching-model", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "" }, "response": [] }, { "name": "Get the branching model for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/branching-model", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Return the branching model set at the project level. This view is\nread-only. The branching model settings can be changed using the\n[settings](#api-workspaces-workspace-projects-project-key-branching-model-settings-get)\nAPI.\n\nThe returned object:\n\n1. Always has a `development` property. `development.name` is\n the user-specified branch that can be inherited by an individual repository's\n branching model.\n2. Might have a `production` property. `production` will not\n be present when `production` is disabled.\n `production.name` is the user-specified branch that can be\n inherited by an individual repository's branching model.\n3. Always has a `branch_types` array which contains all enabled branch\n types." }, "response": [] }, { "name": "Get the branching model config for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/branching-model/settings", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Return the branching model configuration for a project. 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\n\nThis is the raw configuration for the branching model. A client\nwishing to see the branching model with its actual current branches may find the\n[active model API](#api-workspaces-workspace-projects-project-key-branching-model-get)\nmore useful." }, "response": [] }, { "name": "Update the branching model config for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/branching-model/settings", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Update the branching model configuration for a project.\n\nThe `development` branch can be configured to a specific branch or to\ntrack the main branch. Any branch name can be supplied, but will only\nsuccessfully be applied to a repository via inheritance if that branch\nexists for that repository. 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\nThe `production` branch can be a specific branch, the main\nbranch or disabled. Any branch name can be supplied, but will only\nsuccessfully be applied to a repository via inheritance if that branch\nexists for that repository. The `enabled` property can be used to enable (`true`)\nor disable (`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\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." }, "response": [] } ] }, { "name": "Commit statuses", "description": "Commit statuses provide a way to tag commits with meta data,\nlike automated build results.\n", "item": [ { "name": "List commit statuses for a commit", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/statuses", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "Query string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n" }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "Field by which the results should be sorted as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\nDefaults to `created_on`.\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns all statuses (e.g. build results) for a specific commit." }, "response": [] }, { "name": "Create a build status for a commit", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/statuses/build", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "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\nExample:\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{\n \"key\": \"MY-BUILD\",\n \"state\": \"SUCCESSFUL\",\n \"description\": \"42 tests passed\",\n \"url\": \"https://www.example.org/my-build-result\"\n }'\n```\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`.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a build status for a commit", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/statuses/build/:key", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified build status for a commit." }, "response": [] }, { "name": "Update a build status for a commit", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/statuses/build/:key", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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.", "body": { "mode": "raw", "raw": "" } }, "response": [] } ] }, { "name": "Commits", "description": "These are the repository's commits. They are paginated and returned in\nreverse chronological order, similar to the output of git log.\n", "item": [ { "name": "Get a commit", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified commit." }, "response": [] }, { "name": "Approve a commit", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/approve", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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." }, "response": [] }, { "name": "Unapprove a commit", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/approve", "query": [], "variable": [] }, "method": "DELETE", "header": [], "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." }, "response": [] }, { "name": "List a commit's comments", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/comments", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "Query string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n" }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "Field by which the results should be sorted as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the commit's comments.\n\nThis includes both global and inline comments.\n\nThe default sorting is oldest to newest and can be overridden with\nthe `sort` query parameter." }, "response": [] }, { "name": "Create comment for a commit", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/comments", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates new comment on the specified commit.\n\nTo post a reply to an existing comment, include the `parent.id` field:\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/commit/db9ba1e031d07a02603eae0e559a7adc010257fc/comments/ \\\n -X POST -u evzijst \\\n -H 'Content-Type: application/json' \\\n -d '{\"content\": {\"raw\": \"One more thing!\"},\n \"parent\": {\"id\": 5728901}}'\n```", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a commit comment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/comments/:comment_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified commit comment." }, "response": [] }, { "name": "Update a commit comment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/comments/:comment_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Used to update the contents of a comment. Only the content of the comment can be updated.\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/commit/7f71b5/comments/5728901 \\\n -X PUT -u evzijst \\\n -H 'Content-Type: application/json' \\\n -d '{\"content\": {\"raw\": \"One more thing!\"}'\n```", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a commit comment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/comments/:comment_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the specified commit comment.\n\nNote that deleting comments that have visible replies that point to\nthem will not really delete the resource. This is to retain the integrity\nof the original comment tree. Instead, the `deleted` element is set to\n`true` and the content is blanked out. The comment will continue to be\nreturned by the collections and self endpoints." }, "response": [] }, { "name": "List commits", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commits", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "These are the repository's commits. They are paginated and returned\nin reverse chronological order, similar to the output of `git log`.\nLike these tools, the DAG can be filtered.\n\n#### GET /repositories/{workspace}/{repo_slug}/commits/\n\nReturns all commits in the repo in topological order (newest commit\nfirst). All branches and tags are included (similar to\n`git log --all`).\n\n#### GET /repositories/{workspace}/{repo_slug}/commits/?exclude=master\n\nReturns all commits in the repo that are not on master\n(similar to `git log --all ^master`).\n\n#### GET /repositories/{workspace}/{repo_slug}/commits/?include=foo&include=bar&exclude=fu&exclude=fubar\n\nReturns all commits that are on refs `foo` or `bar`, but not on `fu` or\n`fubar` (similar to `git log foo bar ^fu ^fubar`).\n\nAn optional `path` parameter can be specified that will limit the\nresults to commits that affect that path. `path` can either be a file\nor a directory. If a directory is specified, commits are returned that\nhave modified any file in the directory tree rooted by `path`. It is\nimportant to note that if the `path` parameter is specified, the commits\nreturned by this endpoint may no longer be a DAG, parent commits that\ndo not modify the path will be omitted from the response.\n\n#### GET /repositories/{workspace}/{repo_slug}/commits/?path=README.md&include=foo&include=bar&exclude=master\n\nReturns all commits that are on refs `foo` or `bar`, but not on `master`\nthat changed the file README.md.\n\n#### GET /repositories/{workspace}/{repo_slug}/commits/?path=src/&include=foo&include=bar&exclude=master\n\nReturns all commits that are on refs `foo` or `bar`, but not on `master`\nthat changed to a file in any file in the directory src or its children.\n\nBecause the response could include a very large number of commits, it\nis paginated. Follow the 'next' link in the response to navigate to the\nnext page of commits. As with other paginated resources, do not\nconstruct your own links.\n\nWhen the include and exclude parameters are more than can fit in a\nquery string, clients can use a `x-www-form-urlencoded` POST instead." }, "response": [] }, { "name": "List commits with include/exclude", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commits", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Identical to `GET /repositories/{workspace}/{repo_slug}/commits`,\nexcept that POST allows clients to place the include and exclude\nparameters in the request body to avoid URL length issues.\n\n**Note that this resource does NOT support new commit creation.**" }, "response": [] }, { "name": "List commits for revision", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commits/:revision", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "These are the repository's commits. They are paginated and returned\nin reverse chronological order, similar to the output of `git log`.\nLike these tools, the DAG can be filtered.\n\n#### GET /repositories/{workspace}/{repo_slug}/commits/master\n\nReturns all commits on ref `master` (similar to `git log master`).\n\n#### GET /repositories/{workspace}/{repo_slug}/commits/dev?include=foo&exclude=master\n\nReturns all commits on ref `dev` or `foo`, except those that are reachable on\n`master` (similar to `git log dev foo ^master`).\n\nAn optional `path` parameter can be specified that will limit the\nresults to commits that affect that path. `path` can either be a file\nor a directory. If a directory is specified, commits are returned that\nhave modified any file in the directory tree rooted by `path`. It is\nimportant to note that if the `path` parameter is specified, the commits\nreturned by this endpoint may no longer be a DAG, parent commits that\ndo not modify the path will be omitted from the response.\n\n#### GET /repositories/{workspace}/{repo_slug}/commits/dev?path=README.md&include=foo&include=bar&exclude=master\n\nReturns all commits that are on refs `dev` or `foo` or `bar`, but not on `master`\nthat changed the file README.md.\n\n#### GET /repositories/{workspace}/{repo_slug}/commits/dev?path=src/&include=foo&exclude=master\n\nReturns all commits that are on refs `dev` or `foo`, but not on `master`\nthat changed to a file in any file in the directory src or its children.\n\nBecause the response could include a very large number of commits, it\nis paginated. Follow the 'next' link in the response to navigate to the\nnext page of commits. As with other paginated resources, do not\nconstruct your own links.\n\nWhen the include and exclude parameters are more than can fit in a\nquery string, clients can use a `x-www-form-urlencoded` POST instead." }, "response": [] }, { "name": "List commits for revision using include/exclude", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commits/:revision", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Identical to `GET /repositories/{workspace}/{repo_slug}/commits/{revision}`,\nexcept that POST allows clients to place the include and exclude\nparameters in the request body to avoid URL length issues.\n\n**Note that this resource does NOT support new commit creation.**" }, "response": [] }, { "name": "Compare two commits", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/diff/:spec", "query": [ { "key": "context", "value": "{{context}}", "disabled": true, "description": "Generate diffs with lines of context instead of the usual three." }, { "key": "path", "value": "{{path}}", "disabled": true, "description": "Limit the diff to a particular file (this parameter\ncan be repeated for multiple paths)." }, { "key": "ignore_whitespace", "value": "{{ignore_whitespace}}", "disabled": true, "description": "Generate diffs that ignore whitespace." }, { "key": "binary", "value": "{{binary}}", "disabled": true, "description": "Generate diffs that include binary files, true if omitted." }, { "key": "renames", "value": "{{renames}}", "disabled": true, "description": "Whether to perform rename detection, true if omitted." }, { "key": "merge", "value": "{{merge}}", "disabled": true, "description": "This parameter is deprecated. The 'topic' parameter should be used\ninstead. The 'merge' and 'topic' parameters cannot be both used at\nthe same time.\n\nIf true, the source commit is merged into the\ndestination commit, and then a diff from the\ndestination to the merge result is returned. If false,\na simple 'two dot' diff between the source and\ndestination is returned. True if omitted." }, { "key": "topic", "value": "{{topic}}", "disabled": true, "description": "If true, returns 2-way 'three-dot' diff.\nThis is a diff between the source commit and the merge base\nof the source commit and the destination commit.\nIf false, a simple 'two dot' diff between the source and\ndestination is returned." } ], "variable": [] }, "method": "GET", "header": [], "description": "Produces a raw git-style diff.\n\n#### Single commit spec\n\nIf the `spec` argument to this API is a single commit, the diff is\nproduced against the first parent of the specified commit.\n\n#### Two commit spec\n\nTwo commits separated by `..` may be provided as the `spec`, e.g.,\n`3a8b42..9ff173`. When two commits are provided and the `topic` query\nparameter is true, this API produces a 2-way three dot diff.\nThis is the diff between source commit and the merge base of the source\ncommit and the destination commit. When the `topic` query param is false,\na simple git-style diff is produced.\n\nThe two commits are interpreted as follows:\n\n* First commit: the commit containing the changes we wish to preview\n* Second commit: the commit representing the state to which we want to\n compare the first commit\n* **Note**: This is the opposite of the order used in `git diff`.\n\n#### Comparison to patches\n\nWhile similar to patches, diffs:\n\n* Don't have a commit header (username, commit message, etc)\n* Support the optional `path=foo/bar.py` query param to filter\n the diff to just that one file diff\n\n#### Response\n\nThe raw diff is returned as-is, in whatever encoding the files in the\nrepository use. It is not decoded into unicode. As such, the\ncontent-type is `text/plain`." }, "response": [] }, { "name": "Compare two commit diff stats", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/diffstat/:spec", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Produces a response in JSON format with a record for every path\nmodified, including information on the type of the change and the\nnumber of lines added and removed.\n\n#### Single commit spec\n\nIf the `spec` argument to this API is a single commit, the diff is\nproduced against the first parent of the specified commit.\n\n#### Two commit spec\n\nTwo commits separated by `..` may be provided as the `spec`, e.g.,\n`3a8b42..9ff173`. When two commits are provided and the `topic` query\nparameter is true, this API produces a 2-way three dot diff.\nThis is the diff between source commit and the merge base of the source\ncommit and the destination commit. When the `topic` query param is false,\na simple git-style diff is produced.\n\nThe two commits are interpreted as follows:\n\n* First commit: the commit containing the changes we wish to preview\n* Second commit: the commit representing the state to which we want to\n compare the first commit\n* **Note**: This is the opposite of the order used in `git diff`." }, "response": [] }, { "name": "Get the common ancestor between two commits", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/merge-base/:revspec", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the best common ancestor between two commits, specified in a revspec\nof 2 commits (e.g. 3a8b42..9ff173).\n\nIf more than one best common ancestor exists, only one will be returned. It is\nunspecified which will be returned." }, "response": [] }, { "name": "Get a patch for two commits", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/patch/:spec", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Produces a raw patch for a single commit (diffed against its first\nparent), or a patch-series for a revspec of 2 commits (e.g.\n`3a8b42..9ff173` where the first commit represents the source and the\nsecond commit the destination).\n\nIn case of the latter (diffing a revspec), a patch series is returned\nfor the commits on the source branch (`3a8b42` and its ancestors in\nour example).\n\nWhile similar to diffs, patches:\n\n* Have a commit header (username, commit message, etc)\n* Do not support the `path=foo/bar.py` query parameter\n\nThe raw patch is returned as-is, in whatever encoding the files in the\nrepository use. It is not decoded into unicode. As such, the\ncontent-type is `text/plain`." }, "response": [] } ] }, { "name": "Deployments", "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", "item": [ { "name": "List repository deploy keys", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deploy-keys", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns all deploy-keys belonging to a repository." }, "response": [] }, { "name": "Add a repository deploy key", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deploy-keys", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Create a new deploy key in a repository. Note: If authenticating a deploy key\nwith an OAuth consumer, any changes to the OAuth consumer will subsequently\ninvalidate the deploy key.\n\n\nExample:\n```\n$ curl -X POST \\\n-H \"Authorization \" \\\n-H \"Content-type: application/json\" \\\nhttps://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys -d \\\n'{\n \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 mleu@C02W454JHTD8\",\n \"label\": \"mydeploykey\"\n}'\n```" }, "response": [] }, { "name": "Get a repository deploy key", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deploy-keys/:key_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the deploy key belonging to a specific key." }, "response": [] }, { "name": "Update a repository deploy key", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deploy-keys/:key_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Create a new deploy key in a repository.\n\nThe same key needs to be passed in but the comment and label can change.\n\nExample:\n```\n$ curl -X PUT \\\n-H \"Authorization \" \\\n-H \"Content-type: application/json\" \\\nhttps://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234 -d \\\n'{\n \"label\": \"newlabel\",\n \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 newcomment\",\n}'\n```" }, "response": [] }, { "name": "Delete a repository deploy key", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deploy-keys/:key_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "This deletes a deploy key from a repository." }, "response": [] }, { "name": "List deployments", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deployments", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Find deployments" }, "response": [] }, { "name": "Get a deployment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deployments/:deployment_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "deployment_uuid", "value": "{{deployment_uuid}}", "description": "The deployment UUID.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve a deployment" }, "response": [] }, { "name": "List environments", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/environments", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Find environments" }, "response": [] }, { "name": "Create an environment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/environments", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Create an environment.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get an environment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/environments/:environment_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "environment_uuid", "value": "{{environment_uuid}}", "description": "The environment UUID.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve an environment" }, "response": [] }, { "name": "Delete an environment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/environments/:environment_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "environment_uuid", "value": "{{environment_uuid}}", "description": "The environment UUID.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete an environment" }, "response": [] }, { "name": "Update an environment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/environments/:environment_uuid/changes", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "environment_uuid", "value": "{{environment_uuid}}", "description": "The environment UUID.", "disabled": false } ] }, "method": "POST", "header": [], "description": "Update an environment" }, "response": [] }, { "name": "List project deploy keys", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/deploy-keys", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns all deploy keys belonging to a project." }, "response": [] }, { "name": "Create a project deploy key", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/deploy-keys", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Create a new deploy key in a project.\n\nExample:\n```\n$ curl -X POST \\\n-H \"Authorization \" \\\n-H \"Content-type: application/json\" \\\nhttps://api.bitbucket.org/2.0/workspaces/standard/projects/TEST_PROJECT/deploy-keys/ -d \\\n'{\n \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 mleu@C02W454JHTD8\",\n \"label\": \"mydeploykey\"\n}'\n```" }, "response": [] }, { "name": "Get a project deploy key", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/deploy-keys/:key_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the deploy key belonging to a specific key ID." }, "response": [] }, { "name": "Delete a deploy key from a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/deploy-keys/:key_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "This deletes a deploy key from a project." }, "response": [] } ] }, { "name": "Downloads", "description": "Access the list of download links associated with the repository.", "item": [ { "name": "List download artifacts", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/downloads", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Returns a list of download links associated with the repository." }, "response": [] }, { "name": "Upload a download artifact", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/downloads", "query": [], "variable": [] }, "method": "POST", "header": [], "description": "Upload new download artifacts.\n\nTo upload files, perform a `multipart/form-data` POST containing one\nor more `files` fields:\n\n $ echo Hello World > hello.txt\n $ curl -s -u evzijst -X POST https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads -F files=@hello.txt\n\nWhen a file is uploaded with the same name as an existing artifact,\nthen the existing file will be replaced." }, "response": [] }, { "name": "Get a download artifact link", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/downloads/:filename", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Return a redirect to the contents of a download artifact.\n\nThis endpoint returns the actual file contents and not the artifact's\nmetadata.\n\n $ curl -s -L https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads/hello.txt\n Hello World" }, "response": [] }, { "name": "Delete a download artifact", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/downloads/:filename", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the specified download artifact from the repository." }, "response": [] } ] }, { "name": "Issue tracker", "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. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.\n", "item": [ { "name": "List components", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/components", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the components that have been defined in the issue tracker.\n\nThis resource is only available on repositories that have the issue\ntracker enabled." }, "response": [] }, { "name": "Get a component for issues", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/components/:component_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified issue tracker component object." }, "response": [] }, { "name": "List issues", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the issues in the issue tracker." }, "response": [] }, { "name": "Create an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates a new issue.\n\nThis call requires authentication. Private repositories or private\nissue trackers require the caller to authenticate with an account that\nhas appropriate authorization.\n\nThe authenticated user is used for the issue's `reporter` field.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Export issues", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/export", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "A POST request to this endpoint initiates a new background celery task that archives the repo's issues.\n\nWhen the job has been accepted, it will return a 202 (Accepted) along with a unique url to this job in the\n'Location' response header. This url is the endpoint for where the user can obtain their zip files.\"", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Check issue export status", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/export/:repo_name-issues-:task_id.zip", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "This endpoint is used to poll for the progress of an issue export\njob and return the zip file after the job is complete.\nAs long as the job is running, this will return a 202 response\nwith in the response body a description of the current status.\n\nAfter the job has been scheduled, but before it starts executing, the endpoint\nreturns a 202 response with status `ACCEPTED`.\n\nOnce it starts running, it is a 202 response with status `STARTED` and progress filled.\n\nAfter it is finished, it becomes a 200 response with status `SUCCESS` or `FAILURE`." }, "response": [] }, { "name": "Check issue import status", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/import", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "When using GET, this endpoint reports the status of the current import task.\n\nAfter the job has been scheduled, but before it starts executing, the endpoint\nreturns a 202 response with status `ACCEPTED`.\n\nOnce it starts running, it is a 202 response with status `STARTED` and progress filled.\n\nAfter it is finished, it becomes a 200 response with status `SUCCESS` or `FAILURE`." }, "response": [] }, { "name": "Import issues", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/import", "query": [], "variable": [] }, "method": "POST", "header": [], "description": "A POST request to this endpoint will import the zip file given by the archive parameter into the repository. All\nexisting issues will be deleted and replaced by the contents of the imported zip file.\n\nImports are done through a multipart/form-data POST. There is one valid and required form field, with the name\n\"archive,\" which needs to be a file field:\n\n```\n$ curl -u -X POST -F archive=@/path/to/file.zip https://api.bitbucket.org/2.0/repositories///issues/import\n```" }, "response": [] }, { "name": "Get an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified issue." }, "response": [] }, { "name": "Update an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Modifies the issue.\n\n```\n$ curl https://api.bitbucket.org/2.0/repostories/evzijst/dogslow/issues/123 \\\n -u evzijst -s -X PUT -H 'Content-Type: application/json' \\\n -d '{\n \"title\": \"Updated title\",\n \"assignee\": {\n \"account_id\": \"5d5355e8c6b9320d9ea5b28d\"\n },\n \"priority\": \"minor\",\n \"version\": {\n \"name\": \"1.0\"\n },\n \"component\": null\n}'\n```\n\nThis example changes the `title`, `assignee`, `priority` and the\n`version`. It also removes the value of the `component` from the issue\nby setting the field to `null`. Any field not present keeps its existing\nvalue.\n\nEach time an issue is edited in the UI or through the API, an immutable\nchange record is created under the `/issues/123/changes` endpoint. It\nalso has a comment associated with the change." }, "response": [] }, { "name": "Delete an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id", "query": [], "variable": [] }, "method": "DELETE", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Deletes the specified issue. This requires write access to the\nrepository." }, "response": [] }, { "name": "List attachments for an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/attachments", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns all attachments for this issue.\n\nThis returns the files' meta data. This does not return the files'\nactual contents.\n\nThe files are always ordered by their upload date." }, "response": [] }, { "name": "Upload an attachment to an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/attachments", "query": [], "variable": [] }, "method": "POST", "header": [], "description": "Upload new issue attachments.\n\nTo upload files, perform a `multipart/form-data` POST containing one\nor more file fields.\n\nWhen a file is uploaded with the same name as an existing attachment,\nthen the existing file will be replaced." }, "response": [] }, { "name": "Get attachment for an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/attachments/:path", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Returns the contents of the specified file attachment.\n\nNote that this endpoint does not return a JSON response, but instead\nreturns a redirect pointing to the actual file that in turn will return\nthe raw contents.\n\nThe redirect URL contains a one-time token that has a limited lifetime.\nAs a result, the link should not be persisted, stored, or shared." }, "response": [] }, { "name": "Delete an attachment for an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/attachments/:path", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes an attachment." }, "response": [] }, { "name": "List changes on an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/changes", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for details." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nName of a response property to sort results. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#sorting-query-results)\nfor details.\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the list of all changes that have been made to the specified\nissue. Changes are returned in chronological order with the oldest\nchange first.\n\nEach time an issue is edited in the UI or through the API, an immutable\nchange record is created under the `/issues/123/changes` endpoint. It\nalso has a comment associated with the change.\n\nNote that this operation is changing significantly, due to privacy changes.\nSee the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#changes-to-the-issue-changes-api)\nfor details.\n\nChanges support [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) that\ncan be used to search for specific changes. For instance, to see\nwhen an issue transitioned to \"resolved\":\n\n```\n$ curl -s https://api.bitbucket.org/2.0/repositories/site/master/issues/1/changes \\\n -G --data-urlencode='q=changes.state.new = \"resolved\"'\n```\n\nThis resource is only available on repositories that have the issue\ntracker enabled.\n\nN.B.\n\nThe `changes.assignee` and `changes.assignee_account_id` fields are not\na `user` object. Instead, they contain the raw `username` and\n`account_id` of the user. This is to protect the integrity of the audit\nlog even after a user account gets deleted.\n\nThe `changes.assignee` field is deprecated will disappear in the\nfuture. Use `changes.assignee_account_id` instead." }, "response": [] }, { "name": "Modify the state of an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/changes", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Makes a change to the specified issue.\n\nFor example, to change an issue's state and assignee, create a new\nchange object that modifies these fields:\n\n```\ncurl https://api.bitbucket.org/2.0/site/master/issues/1234/changes \\\n -s -u evzijst -X POST -H \"Content-Type: application/json\" \\\n -d '{\n \"changes\": {\n \"assignee_account_id\": {\n \"new\": \"557058:c0b72ad0-1cb5-4018-9cdc-0cde8492c443\"\n },\n \"state\": {\n \"new\": 'resolved\"\n }\n }\n \"message\": {\n \"raw\": \"This is now resolved.\"\n }\n }'\n```\n\nThe above example also includes a custom comment to go alongside the\nchange. This comment will also be visible on the issue page in the UI.\n\nThe fields of the `changes` object are strings, not objects. This\nallows for immutable change log records, even after user accounts,\nmilestones, or other objects recorded in a change entry, get renamed or\ndeleted.\n\nThe `assignee_account_id` field stores the account id. When POSTing a\nnew change and changing the assignee, the client should therefore use\nthe user's account_id in the `changes.assignee_account_id.new` field.\n\nThis call requires authentication. Private repositories or private\nissue trackers require the caller to authenticate with an account that\nhas appropriate authorization.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get issue change object", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/changes/:change_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified issue change object.\n\nThis resource is only available on repositories that have the issue\ntracker enabled." }, "response": [] }, { "name": "List comments on an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/comments", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of all comments that were made on the\nspecified issue.\n\nThe default sorting is oldest to newest and can be overridden with\nthe `sort` query parameter.\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details." }, "response": [] }, { "name": "Create a comment on an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/comments", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates a new issue comment.\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/issues/42/comments/ \\\n -X POST -u evzijst \\\n -H 'Content-Type: application/json' \\\n -d '{\"content\": {\"raw\": \"Lorem ipsum.\"}}'\n```", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a comment on an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/comments/:comment_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified issue comment object." }, "response": [] }, { "name": "Update a comment on an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/comments/:comment_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates the content of the specified issue comment. Note that only\nthe `content.raw` field can be modified.\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/issues/42/comments/5728901 \\\n -X PUT -u evzijst \\\n -H 'Content-Type: application/json' \\\n -d '{\"content\": {\"raw\": \"Lorem ipsum.\"}'\n```", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a comment on an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/comments/:comment_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the specified comment." }, "response": [] }, { "name": "Check if current user voted for an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/vote", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Check whether the authenticated user has voted for this issue.\nA 204 status code indicates that the user has voted, while a 404\nimplies they haven't." }, "response": [] }, { "name": "Vote for an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/vote", "query": [], "variable": [] }, "method": "PUT", "header": [], "description": "Vote for this issue.\n\nTo cast your vote, do an empty PUT. The 204 status code indicates that\nthe operation was successful." }, "response": [] }, { "name": "Remove vote for an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/vote", "query": [], "variable": [] }, "method": "DELETE", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retract your vote." }, "response": [] }, { "name": "Check if current user is watching a issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/watch", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Indicated whether or not the authenticated user is watching this\nissue." }, "response": [] }, { "name": "Watch an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/watch", "query": [], "variable": [] }, "method": "PUT", "header": [], "description": "Start watching this issue.\n\nTo start watching this issue, do an empty PUT. The 204 status code\nindicates that the operation was successful." }, "response": [] }, { "name": "Stop watching an issue", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/issues/:issue_id/watch", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Stop watching this issue." }, "response": [] }, { "name": "List milestones", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/milestones", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the milestones that have been defined in the issue tracker.\n\nThis resource is only available on repositories that have the issue\ntracker enabled." }, "response": [] }, { "name": "Get a milestone", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/milestones/:milestone_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified issue tracker milestone object." }, "response": [] }, { "name": "List defined versions for issues", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/versions", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the versions that have been defined in the issue tracker.\n\nThis resource is only available on repositories that have the issue\ntracker enabled." }, "response": [] }, { "name": "Get a defined version for issues", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/versions/:version_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified issue tracker version object." }, "response": [] } ] }, { "name": "Pipelines", "description": "Bitbucket Pipelines brings continuous delivery to Bitbucket\nCloud, empowering teams with full branching to deployment\nvisibility and faster feedback loops.\n", "item": [ { "name": "List variables for an environment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deployments_config/environments/:environment_uuid/variables", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "environment_uuid", "value": "{{environment_uuid}}", "description": "The environment.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Find deployment environment level variables." }, "response": [] }, { "name": "Create a variable for an environment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deployments_config/environments/:environment_uuid/variables", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "environment_uuid", "value": "{{environment_uuid}}", "description": "The environment.", "disabled": false } ] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Create a deployment environment level variable.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Update a variable for an environment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deployments_config/environments/:environment_uuid/variables/:variable_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "environment_uuid", "value": "{{environment_uuid}}", "description": "The environment.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to update.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Update a deployment environment level variable.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a variable for an environment", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/deployments_config/environments/:environment_uuid/variables/:variable_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "environment_uuid", "value": "{{environment_uuid}}", "description": "The environment.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to delete.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete a deployment environment level variable." }, "response": [] }, { "name": "List pipelines", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Find pipelines" }, "response": [] }, { "name": "Run a pipeline", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Endpoint to create and initiate a pipeline.\nThere are a couple of different options to initiate a pipeline, where the payload of the request will determine which type of pipeline will be instantiated.\n# Trigger a Pipeline for a branch\nOne way to trigger pipelines is by specifying the branch for which you want to trigger a pipeline.\nThe specified branch will be used to determine which pipeline definition from the `bitbucket-pipelines.yml` file will be applied to initiate the pipeline. The pipeline will then do a clone of the repository and checkout the latest revision of the specified branch.\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\\n -d '\n {\n \"target\": {\n \"ref_type\": \"branch\",\n \"type\": \"pipeline_ref_target\",\n \"ref_name\": \"master\"\n }\n }'\n```\n# Trigger a Pipeline for a commit on a branch or tag\nYou can initiate a pipeline for a specific commit and in the context of a specified reference (e.g. a branch, tag or bookmark).\nThe specified reference will be used to determine which pipeline definition from the bitbucket-pipelines.yml file will be applied to initiate the pipeline. The pipeline will clone the repository and then do a checkout the specified reference.\n\nThe following reference types are supported:\n\n* `branch`\n* `named_branch`\n* `bookmark`\n * `tag`\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\\n -d '\n {\n \"target\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"ce5b7431602f7cbba007062eeb55225c6e18e956\"\n },\n \"ref_type\": \"branch\",\n \"type\": \"pipeline_ref_target\",\n \"ref_name\": \"master\"\n }\n }'\n```\n# Trigger a specific pipeline definition for a commit\nYou can trigger a specific pipeline that is defined in your `bitbucket-pipelines.yml` file for a specific commit.\nIn addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition. The resulting pipeline will then clone the repository and checkout the specified revision.\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\\n -d '\n {\n \"target\": {\n \"commit\": {\n \"hash\":\"a3c4e02c9a3755eccdc3764e6ea13facdf30f923\",\n \"type\":\"commit\"\n },\n \"selector\": {\n \"type\":\"custom\",\n \"pattern\":\"Deploy to production\"\n },\n \"type\":\"pipeline_commit_target\"\n }\n }'\n```\n# Trigger a specific pipeline definition for a commit on a branch or tag\nYou can trigger a specific pipeline that is defined in your `bitbucket-pipelines.yml` file for a specific commit in the context of a specified reference.\nIn addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition, as well as the reference information. The resulting pipeline will then clone the repository a checkout the specified reference.\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\\n -d '\n {\n \"target\": {\n \"commit\": {\n \"hash\":\"a3c4e02c9a3755eccdc3764e6ea13facdf30f923\",\n \"type\":\"commit\"\n },\n \"selector\": {\n \"type\": \"custom\",\n \"pattern\": \"Deploy to production\"\n },\n \"type\": \"pipeline_ref_target\",\n \"ref_name\": \"master\",\n \"ref_type\": \"branch\"\n }\n }'\n```\n\n\n# Trigger a custom pipeline with variables\nIn addition to triggering a custom pipeline that is defined in your `bitbucket-pipelines.yml` file as shown in the examples above, you can specify variables that will be available for your build. In the request, provide a list of variables, specifying the following for each variable: key, value, and whether it should be secured or not (this field is optional and defaults to not secured).\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \\\n -d '\n {\n \"target\": {\n \"type\": \"pipeline_ref_target\",\n \"ref_type\": \"branch\",\n \"ref_name\": \"master\",\n \"selector\": {\n \"type\": \"custom\",\n \"pattern\": \"Deploy to production\"\n }\n },\n \"variables\": [\n {\n \"key\": \"var1key\",\n \"value\": \"var1value\",\n \"secured\": true\n },\n {\n \"key\": \"var2key\",\n \"value\": \"var2value\"\n }\n ]\n }'\n```\n\n# Trigger a pull request pipeline\n\nYou can also initiate a pipeline for a specific pull request.\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \\\n -d '\n {\n \"target\": {\n \"type\": \"pipeline_pullrequest_target\",\n \"source\": \"pull-request-branch\",\n \"destination\": \"master\",\n \"destination_commit\": {\n \"hash\": \"9f848b7\"\n },\n \"commit\": {\n \"hash\": \"1a372fc\"\n },\n \"pullrequest\": {\n \"id\": \"3\"\n },\n \"selector\": {\n \"type\": \"pull-requests\",\n \"pattern\": \"**\"\n }\n }\n }'\n```\n", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "List caches", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines-config/caches", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The account.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve the repository pipelines caches." }, "response": [] }, { "name": "Delete caches", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines-config/caches", "query": [ { "key": "name", "value": "{{name}}", "disabled": false, "description": "The cache name." } ], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The account.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete repository cache versions by name." }, "response": [] }, { "name": "Delete a cache", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines-config/caches/:cache_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The account.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "cache_uuid", "value": "{{cache_uuid}}", "description": "The UUID of the cache to delete.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete a repository cache." }, "response": [] }, { "name": "Get cache content URI", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines-config/caches/:cache_uuid/content-uri", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The account.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "cache_uuid", "value": "{{cache_uuid}}", "description": "The UUID of the cache.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve the URI of the content of the specified cache." }, "response": [] }, { "name": "Get a pipeline", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pipeline_uuid", "value": "{{pipeline_uuid}}", "description": "The pipeline UUID.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve a specified pipeline" }, "response": [] }, { "name": "List steps for a pipeline", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pipeline_uuid", "value": "{{pipeline_uuid}}", "description": "The UUID of the pipeline.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Find steps for the given pipeline." }, "response": [] }, { "name": "Get a step of a pipeline", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pipeline_uuid", "value": "{{pipeline_uuid}}", "description": "The UUID of the pipeline.", "disabled": false }, { "key": "step_uuid", "value": "{{step_uuid}}", "description": "The UUID of the step.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve a given step of a pipeline." }, "response": [] }, { "name": "Get log file for a step", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid/log", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pipeline_uuid", "value": "{{pipeline_uuid}}", "description": "The UUID of the pipeline.", "disabled": false }, { "key": "step_uuid", "value": "{{step_uuid}}", "description": "The UUID of the step.", "disabled": false } ] }, "method": "GET", "header": [], "description": "Retrieve the log file for a given step of a pipeline.\n\nThis endpoint supports (and encourages!) the use of [HTTP Range requests](https://tools.ietf.org/html/rfc7233) to deal with potentially very large log files." }, "response": [] }, { "name": "Get the logs for the build container or a service container for a given step of a pipeline.", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid/logs/:log_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pipeline_uuid", "value": "{{pipeline_uuid}}", "description": "The UUID of the pipeline.", "disabled": false }, { "key": "step_uuid", "value": "{{step_uuid}}", "description": "The UUID of the step.", "disabled": false }, { "key": "log_uuid", "value": "{{log_uuid}}", "description": "For the main build container specify the step UUID; for a service container specify the service container UUID", "disabled": false } ] }, "method": "GET", "header": [], "description": "Retrieve the log file for a build container or service container.\n\nThis endpoint supports (and encourages!) the use of [HTTP Range requests](https://tools.ietf.org/html/rfc7233) to deal with potentially very large log files." }, "response": [] }, { "name": "Get a summary of test reports for a given step of a pipeline.", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid/test_reports", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pipeline_uuid", "value": "{{pipeline_uuid}}", "description": "The UUID of the pipeline.", "disabled": false }, { "key": "step_uuid", "value": "{{step_uuid}}", "description": "The UUID of the step.", "disabled": false } ] }, "method": "GET", "header": [] }, "response": [] }, { "name": "Get test cases for a given step of a pipeline.", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid/test_reports/test_cases", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pipeline_uuid", "value": "{{pipeline_uuid}}", "description": "The UUID of the pipeline.", "disabled": false }, { "key": "step_uuid", "value": "{{step_uuid}}", "description": "The UUID of the step.", "disabled": false } ] }, "method": "GET", "header": [] }, "response": [] }, { "name": "Get test case reasons (output) for a given test case in a step of a pipeline.", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid/test_reports/test_cases/:test_case_uuid/test_case_reasons", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pipeline_uuid", "value": "{{pipeline_uuid}}", "description": "The UUID of the pipeline.", "disabled": false }, { "key": "step_uuid", "value": "{{step_uuid}}", "description": "The UUID of the step.", "disabled": false }, { "key": "test_case_uuid", "value": "{{test_case_uuid}}", "description": "The UUID of the test case.", "disabled": false } ] }, "method": "GET", "header": [] }, "response": [] }, { "name": "Stop a pipeline", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/stopPipeline", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pipeline_uuid", "value": "{{pipeline_uuid}}", "description": "The UUID of the pipeline.", "disabled": false } ] }, "method": "POST", "header": [], "description": "Signal the stop of a pipeline and all of its steps that not have completed yet." }, "response": [] }, { "name": "Get configuration", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The account.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve the repository pipelines configuration." }, "response": [] }, { "name": "Update configuration", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Update the pipelines configuration for a repository.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Update the next build number", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/build_number", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Update the next build number that should be assigned to a pipeline. The next build number that will be configured has to be strictly higher than the current latest build number for this repository.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "List schedules", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/schedules", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve the configured schedules for the given repository." }, "response": [] }, { "name": "Create a schedule", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/schedules", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Create a schedule for the given repository.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a schedule", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/schedules/:schedule_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "schedule_uuid", "value": "{{schedule_uuid}}", "description": "The uuid of the schedule.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve a schedule by its UUID." }, "response": [] }, { "name": "Update a schedule", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/schedules/:schedule_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "schedule_uuid", "value": "{{schedule_uuid}}", "description": "The uuid of the schedule.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Update a schedule.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a schedule", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/schedules/:schedule_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "schedule_uuid", "value": "{{schedule_uuid}}", "description": "The uuid of the schedule.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete a schedule." }, "response": [] }, { "name": "List executions of a schedule", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/schedules/:schedule_uuid/executions", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "schedule_uuid", "value": "{{schedule_uuid}}", "description": "The uuid of the schedule.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve the executions of a given schedule." }, "response": [] }, { "name": "Get SSH key pair", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/ssh/key_pair", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve the repository SSH key pair excluding the SSH private key. The private key is a write only field and will never be exposed in the logs or the REST API." }, "response": [] }, { "name": "Update SSH key pair", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/ssh/key_pair", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Create or update the repository SSH key pair. The private key will be set as a default SSH identity in your build container.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete SSH key pair", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/ssh/key_pair", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete the repository SSH key pair." }, "response": [] }, { "name": "List known hosts", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/ssh/known_hosts", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Find repository level known hosts." }, "response": [] }, { "name": "Create a known host", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/ssh/known_hosts", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Create a repository level known host.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a known host", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/ssh/known_hosts/:known_host_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "known_host_uuid", "value": "{{known_host_uuid}}", "description": "The UUID of the known host to retrieve.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve a repository level known host." }, "response": [] }, { "name": "Update a known host", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/ssh/known_hosts/:known_host_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "known_host_uuid", "value": "{{known_host_uuid}}", "description": "The UUID of the known host to update.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Update a repository level known host.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a known host", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/ssh/known_hosts/:known_host_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "known_host_uuid", "value": "{{known_host_uuid}}", "description": "The UUID of the known host to delete.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete a repository level known host." }, "response": [] }, { "name": "List variables for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/variables", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Find repository level variables." }, "response": [] }, { "name": "Create a variable for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/variables", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false } ] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Create a repository level variable.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a variable for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/variables/:variable_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to retrieve.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve a repository level variable." }, "response": [] }, { "name": "Update a variable for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/variables/:variable_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to update.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Update a repository level variable.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a variable for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pipelines_config/variables/:variable_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to delete.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete a repository level variable." }, "response": [] }, { "name": "List variables for an account", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}teams/:username/pipelines_config/variables", "query": [], "variable": [ { "key": "username", "value": "{{username}}", "description": "The account.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Find account level variables.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/)." }, "response": [] }, { "name": "Create a variable for a user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}teams/:username/pipelines_config/variables", "query": [], "variable": [ { "key": "username", "value": "{{username}}", "description": "The account.", "disabled": false } ] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Create an account level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a variable for a team", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}teams/:username/pipelines_config/variables/:variable_uuid", "query": [], "variable": [ { "key": "username", "value": "{{username}}", "description": "The account.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to retrieve.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve a team level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/)." }, "response": [] }, { "name": "Update a variable for a team", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}teams/:username/pipelines_config/variables/:variable_uuid", "query": [], "variable": [ { "key": "username", "value": "{{username}}", "description": "The account.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Update a team level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a variable for a team", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}teams/:username/pipelines_config/variables/:variable_uuid", "query": [], "variable": [ { "key": "username", "value": "{{username}}", "description": "The account.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to delete.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete a team level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/)." }, "response": [] }, { "name": "List variables for a user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/pipelines_config/variables", "query": [], "variable": [ { "key": "selected_user", "value": "{{selected_user}}", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Find user level variables.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/)." }, "response": [] }, { "name": "Create a variable for a user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/pipelines_config/variables", "query": [], "variable": [ { "key": "selected_user", "value": "{{selected_user}}", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "disabled": false } ] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Create a user level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a variable for a user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/pipelines_config/variables/:variable_uuid", "query": [], "variable": [ { "key": "selected_user", "value": "{{selected_user}}", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to retrieve.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve a user level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/)." }, "response": [] }, { "name": "Update a variable for a user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/pipelines_config/variables/:variable_uuid", "query": [], "variable": [ { "key": "selected_user", "value": "{{selected_user}}", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Update a user level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a variable for a user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/pipelines_config/variables/:variable_uuid", "query": [], "variable": [ { "key": "selected_user", "value": "{{selected_user}}", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to delete.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete an account level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/)." }, "response": [] }, { "name": "Get OpenID configuration for OIDC in Pipelines", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/pipelines-config/identity/oidc/.well-known/openid-configuration", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false } ] }, "method": "GET", "header": [], "description": "This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/" }, "response": [] }, { "name": "Get keys for OIDC in Pipelines", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/pipelines-config/identity/oidc/keys.json", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false } ] }, "method": "GET", "header": [], "description": "This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/" }, "response": [] }, { "name": "List variables for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/pipelines-config/variables", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Find workspace level variables." }, "response": [] }, { "name": "Create a variable for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/pipelines-config/variables", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false } ] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Create a workspace level variable.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get variable for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/pipelines-config/variables/:variable_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to retrieve.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve a workspace level variable." }, "response": [] }, { "name": "Update variable for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/pipelines-config/variables/:variable_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Update a workspace level variable.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a variable for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/pipelines-config/variables/:variable_uuid", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "variable_uuid", "value": "{{variable_uuid}}", "description": "The UUID of the variable to delete.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete a workspace level variable." }, "response": [] } ] }, { "name": "Projects", "description": "Bitbucket Cloud projects make it easier for teams to focus on\na goal, product, or process by organizing their repositories.\n", "item": [ { "name": "Create a project in a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates a new project.\n\nNote that the avatar has to be embedded as either a data-url\nor a URL to an external image as shown in the examples below:\n\n```\n$ body=$(cat << EOF\n{\n \"name\": \"Mars Project\",\n \"key\": \"MARS\",\n \"description\": \"Software for colonizing mars.\",\n \"links\": {\n \"avatar\": {\n \"href\": \"data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/...\"\n }\n },\n \"is_private\": false\n}\nEOF\n)\n$ curl -H \"Content-Type: application/json\" \\\n -X POST \\\n -d \"$body\" \\\n https://api.bitbucket.org/2.0/workspaces/teams-in-space/projects/ | jq .\n{\n // Serialized project document\n}\n```\n\nor even:\n\n```\n$ body=$(cat << EOF\n{\n \"name\": \"Mars Project\",\n \"key\": \"MARS\",\n \"description\": \"Software for colonizing mars.\",\n \"links\": {\n \"avatar\": {\n \"href\": \"http://i.imgur.com/72tRx4w.gif\"\n }\n },\n \"is_private\": false\n}\nEOF\n)\n$ curl -H \"Content-Type: application/json\" \\\n -X POST \\\n -d \"$body\" \\\n https://api.bitbucket.org/2.0/workspaces/teams-in-space/projects/ | jq .\n{\n // Serialized project document\n}\n```", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a project for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the requested project." }, "response": [] }, { "name": "Update a project for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Since this endpoint can be used to both update and to create a\nproject, the request body depends on the intent.\n\n#### Creation\n\nSee the POST documentation for the project collection for an\nexample of the request body.\n\nNote: The `key` should not be specified in the body of request\n(since it is already present in the URL). The `name` is required,\neverything else is optional.\n\n#### Update\n\nSee the POST documentation for the project collection for an\nexample of the request body.\n\nNote: The key is not required in the body (since it is already in\nthe URL). The key may be specified in the body, if the intent is\nto change the key itself. In such a scenario, the location of the\nproject is changed and is returned in the `Location` header of the\nresponse.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a project for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes this project. This is an irreversible operation.\n\nYou cannot delete a project that still contains repositories.\nTo delete the project, [delete](/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-delete)\nor transfer the repositories first.\n\nExample:\n```\n$ curl -X DELETE https://api.bitbucket.org/2.0/workspaces/bbworkspace1/projects/PROJ\n```" }, "response": [] }, { "name": "List the default reviewers in a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/default-reviewers", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Return a list of all default reviewers for a project. This is a list of users that will be added as default\nreviewers to pull requests for any repository within the project." }, "response": [] }, { "name": "Get a default reviewer", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/default-reviewers/:selected_user", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified default reviewer." }, "response": [] }, { "name": "Add the specific user as a default reviewer for the project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/default-reviewers/:selected_user", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Adds the specified user to the project's list of default reviewers. The method is\nidempotent. Accepts an optional body containing the `uuid` of the user to be added." }, "response": [] }, { "name": "Remove the specific user from the project's default reviewers", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/default-reviewers/:selected_user", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Removes a default reviewer from the project.\n\nExample:\n```\n$ curl https://api.bitbucket.org/2.0/.../default-reviewers/%7Bf0e0e8e9-66c1-4b85-a784-44a9eb9ef1a6%7D\n\nHTTP/1.1 204\n```" }, "response": [] }, { "name": "List explicit group permissions for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/permissions-config/groups", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of explicit group permissions for the given project.\nThis endpoint does not support BBQL features." }, "response": [] }, { "name": "Get an explicit group permission for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/permissions-config/groups/:group_slug", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the group permission for a given group and project.\n\nOnly users with admin permission for the project may access this resource.\n\nPermissions can be:\n\n* `admin`\n* `create-repo`\n* `write`\n* `read`\n* `none`" }, "response": [] }, { "name": "Update an explicit group permission for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/permissions-config/groups/:group_slug", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates the group permission, or grants a new permission if one does not already exist.\n\nOnly users with admin permission for the project may access this resource.\n\nDue to security concerns, the JWT and OAuth authentication methods are unsupported.\nThis is to ensure integrations and add-ons are not allowed to change permissions.\n\nPermissions can be:\n\n* `admin`\n* `create-repo`\n* `write`\n* `read`", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete an explicit group permission for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/permissions-config/groups/:group_slug", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the project group permission between the requested project and group, if one exists.\n\nOnly users with admin permission for the project may access this resource." }, "response": [] }, { "name": "List explicit user permissions for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/permissions-config/users", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of explicit user permissions for the given project.\nThis endpoint does not support BBQL features." }, "response": [] }, { "name": "Get an explicit user permission for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/permissions-config/users/:selected_user_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the explicit user permission for a given user and project.\n\nOnly users with admin permission for the project may access this resource.\n\nPermissions can be:\n\n* `admin`\n* `create-repo`\n* `write`\n* `read`\n* `none`" }, "response": [] }, { "name": "Update an explicit user permission for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/permissions-config/users/:selected_user_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates the explicit user permission for a given user and project. The selected\nuser must be a member of the workspace, and cannot be the workspace owner.\n\nOnly users with admin permission for the project may access this resource.\n\nDue to security concerns, the JWT and OAuth authentication methods are unsupported.\nThis is to ensure integrations and add-ons are not allowed to change permissions.\n\nPermissions can be:\n\n* `admin`\n* `create-repo`\n* `write`\n* `read`", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete an explicit user permission for a project", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects/:project_key/permissions-config/users/:selected_user_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the project user permission between the requested project and user, if one exists.\n\nOnly users with admin permission for the project may access this resource.\n\nDue to security concerns, the JWT and OAuth authentication methods are unsupported.\nThis is to ensure integrations and add-ons are not allowed to change permissions." }, "response": [] } ] }, { "name": "Pullrequests", "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", "item": [ { "name": "List pull requests for a user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}pullrequests/:selected_user", "query": [ { "key": "state", "value": "{{state}}", "disabled": true, "description": "Only return pull requests that are in this state. This parameter can be repeated." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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." }, "response": [] }, { "name": "List pull requests that contain a commit", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/pullrequests", "query": [ { "key": "page", "value": "{{page}}", "disabled": true, "description": "Which page to retrieve" }, { "key": "pagelen", "value": "{{pagelen}}", "disabled": true, "description": "How many pull requests to retrieve per page" } ], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository; either the UUID in curly braces, or the slug", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The SHA1 of the commit", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of all pull requests as part of which this commit was reviewed. Pull Request Commit Links app must be installed first before using this API; installation automatically occurs when 'Go to pull request' is clicked from the web interface for a commit's details." }, "response": [] }, { "name": "List default reviewers", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/default-reviewers", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the repository's default reviewers.\n\nThese are the users that are automatically added as reviewers on every\nnew pull request that is created. To obtain the repository's default reviewers\nas well as the default reviewers inherited from the project, use the\n[effective-default-reveiwers](#api-repositories-workspace-repo-slug-effective-default-reviewers-get) endpoint." }, "response": [] }, { "name": "Get a default reviewer", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/default-reviewers/:target_username", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified reviewer.\n\nThis can be used to test whether a user is among the repository's\ndefault reviewers list. A 404 indicates that that specified user is not\na default reviewer." }, "response": [] }, { "name": "Add a user to the default reviewers", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/default-reviewers/:target_username", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Adds the specified user to the repository's list of default\nreviewers.\n\nThis method is idempotent. Adding a user a second time has no effect." }, "response": [] }, { "name": "Remove a user from the default reviewers", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/default-reviewers/:target_username", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Removes a default reviewer from the repository." }, "response": [] }, { "name": "List effective default reviewers", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/effective-default-reviewers", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the repository's effective default reviewers. This includes both default\nreviewers defined at the repository level as well as those inherited from its project.\n\nThese are the users that are automatically added as reviewers on every\nnew pull request that is created." }, "response": [] }, { "name": "List pull requests", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests", "query": [ { "key": "state", "value": "{{state}}", "disabled": true, "description": "Only return pull requests that are in this state. This parameter can be repeated." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns all pull requests on the specified repository.\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." }, "response": [] }, { "name": "Create a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates a new pull request where the destination repository is\nthis repository and the author is the authenticated user.\n\nThe minimum required fields to create a pull request are `title` and\n`source`, specified by a branch name.\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repository/pullrequests \\\n -u my-username:my-password \\\n --request POST \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"title\": \"My Title\",\n \"source\": {\n \"branch\": {\n \"name\": \"staging\"\n }\n }\n }'\n```\n\nIf the pull request's `destination` is not specified, it will default\nto the `repository.mainbranch`. To open a pull request to a\ndifferent branch, say from a feature branch to a staging branch,\nspecify a `destination` (same format as the `source`):\n\n```\n{\n \"title\": \"My Title\",\n \"source\": {\n \"branch\": {\n \"name\": \"my-feature-branch\"\n }\n },\n \"destination\": {\n \"branch\": {\n \"name\": \"staging\"\n }\n }\n}\n```\n\nReviewers can be specified by adding an array of user objects as the\n`reviewers` property.\n\n```\n{\n \"title\": \"My Title\",\n \"source\": {\n \"branch\": {\n \"name\": \"my-feature-branch\"\n }\n },\n \"reviewers\": [\n {\n \"uuid\": \"{504c3b62-8120-4f0c-a7bc-87800b9d6f70}\"\n }\n ]\n}\n```\n\nOther fields:\n\n* `description` - a string\n* `close_source_branch` - boolean that specifies if the source branch should be closed upon merging", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "List a pull request activity log", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/activity", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Returns a paginated list of the pull request's activity log.\n\nThis handler serves both a v20 and internal endpoint. The v20 endpoint\nreturns reviewer comments, updates, approvals and request changes. The internal\nendpoint includes those plus tasks and attachments.\n\nComments created on a file or a line of code have an inline property.\n\nComment example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"comment\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695/comments/118571088\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695/_/diff#comment-118571088\"\n }\n },\n \"deleted\": false,\n \"pullrequest\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n },\n \"content\": {\n \"raw\": \"inline with to a dn from lines\",\n \"markup\": \"markdown\",\n \"html\": \"inline with to a dn from lines\",\n \"type\": \"rendered\"\n },\n \"created_on\": \"2019-09-27T00:33:46.039178+00:00\",\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"created_on\": \"2019-09-27T00:33:46.039178+00:00\",\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"updated_on\": \"2019-09-27T00:33:46.055384+00:00\",\n \"inline\": {\n \"context_lines\": \"\",\n \"to\": null,\n \"path\": \"\",\n \"outdated\": false,\n \"from\": 211\n },\n \"type\": \"pullrequest_comment\",\n \"id\": 118571088\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```\n\nUpdates include a state property of OPEN, MERGED, or DECLINED.\n\nUpdate example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"update\": {\n \"description\": \"\",\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\",\n \"destination\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"6a2c16e4a152\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/6a2c16e4a152\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6a2c16e4a152\"\n }\n }\n },\n \"branch\": {\n \"name\": \"master\"\n },\n \"repository\": {\n \"name\": \"Atlaskit-MK-2\",\n \"type\": \"repository\",\n \"full_name\": \"atlassian/atlaskit-mk-2\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\"\n }\n },\n \"uuid\": \"{}\"\n }\n },\n \"reason\": \"\",\n \"source\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"728c8bad1813\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/728c8bad1813\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/728c8bad1813\"\n }\n }\n },\n \"branch\": {\n \"name\": \"username/NONE-add-onClick-prop-for-accessibility\"\n },\n \"repository\": {\n \"name\": \"Atlaskit-MK-2\",\n \"type\": \"repository\",\n \"full_name\": \"atlassian/atlaskit-mk-2\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\"\n }\n },\n \"uuid\": \"{}\"\n }\n },\n \"state\": \"OPEN\",\n \"author\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"date\": \"2019-05-10T06:48:25.305565+00:00\"\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```\n\nApproval example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"approval\": {\n \"date\": \"2019-09-27T00:37:19.849534+00:00\",\n \"pullrequest\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n },\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n }\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```" }, "response": [] }, { "name": "Get a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified pull request." }, "response": [] }, { "name": "Update a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Mutates the specified pull request.\n\nThis can be used to change the pull request's branches or description.\n\nOnly open pull requests can be mutated.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "List a pull request activity log", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/activity", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Returns a paginated list of the pull request's activity log.\n\nThis handler serves both a v20 and internal endpoint. The v20 endpoint\nreturns reviewer comments, updates, approvals and request changes. The internal\nendpoint includes those plus tasks and attachments.\n\nComments created on a file or a line of code have an inline property.\n\nComment example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"comment\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695/comments/118571088\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695/_/diff#comment-118571088\"\n }\n },\n \"deleted\": false,\n \"pullrequest\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n },\n \"content\": {\n \"raw\": \"inline with to a dn from lines\",\n \"markup\": \"markdown\",\n \"html\": \"inline with to a dn from lines\",\n \"type\": \"rendered\"\n },\n \"created_on\": \"2019-09-27T00:33:46.039178+00:00\",\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"created_on\": \"2019-09-27T00:33:46.039178+00:00\",\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"updated_on\": \"2019-09-27T00:33:46.055384+00:00\",\n \"inline\": {\n \"context_lines\": \"\",\n \"to\": null,\n \"path\": \"\",\n \"outdated\": false,\n \"from\": 211\n },\n \"type\": \"pullrequest_comment\",\n \"id\": 118571088\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```\n\nUpdates include a state property of OPEN, MERGED, or DECLINED.\n\nUpdate example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"update\": {\n \"description\": \"\",\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\",\n \"destination\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"6a2c16e4a152\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/6a2c16e4a152\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6a2c16e4a152\"\n }\n }\n },\n \"branch\": {\n \"name\": \"master\"\n },\n \"repository\": {\n \"name\": \"Atlaskit-MK-2\",\n \"type\": \"repository\",\n \"full_name\": \"atlassian/atlaskit-mk-2\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\"\n }\n },\n \"uuid\": \"{}\"\n }\n },\n \"reason\": \"\",\n \"source\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"728c8bad1813\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/728c8bad1813\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/728c8bad1813\"\n }\n }\n },\n \"branch\": {\n \"name\": \"username/NONE-add-onClick-prop-for-accessibility\"\n },\n \"repository\": {\n \"name\": \"Atlaskit-MK-2\",\n \"type\": \"repository\",\n \"full_name\": \"atlassian/atlaskit-mk-2\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\"\n }\n },\n \"uuid\": \"{}\"\n }\n },\n \"state\": \"OPEN\",\n \"author\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"date\": \"2019-05-10T06:48:25.305565+00:00\"\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```\n\nApproval example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"approval\": {\n \"date\": \"2019-09-27T00:37:19.849534+00:00\",\n \"pullrequest\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n },\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n }\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```" }, "response": [] }, { "name": "Approve a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/approve", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Approve the specified pull request as the authenticated user." }, "response": [] }, { "name": "Unapprove a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/approve", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Redact the authenticated user's approval of the specified pull\nrequest." }, "response": [] }, { "name": "List comments on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/comments", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of the pull request's comments.\n\nThis includes both global, inline comments and replies.\n\nThe default sorting is oldest to newest and can be overridden with\nthe `sort` query parameter.\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more\ndetails." }, "response": [] }, { "name": "Create a comment on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/comments", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates a new pull request comment.\n\nReturns the newly created pull request comment.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a comment on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/comments/:comment_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a specific pull request comment." }, "response": [] }, { "name": "Update a comment on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/comments/:comment_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates a specific pull request comment.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a comment on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/comments/:comment_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes a specific pull request comment." }, "response": [] }, { "name": "Resolve a comment thread", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/comments/:comment_id/resolve", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "" }, "response": [] }, { "name": "Reopen a comment thread", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/comments/:comment_id/resolve", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "" }, "response": [] }, { "name": "List commits on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/commits", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Returns a paginated list of the pull request's commits.\n\nThese are the commits that are being merged into the destination\nbranch when the pull requests gets accepted." }, "response": [] }, { "name": "Decline a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/decline", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Declines the pull request." }, "response": [] }, { "name": "List changes in a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/diff", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Redirects to the [repository diff](/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diff-spec-get)\nwith the revspec that corresponds to the pull request." }, "response": [] }, { "name": "Get the diff stat for a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/diffstat", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Redirects to the [repository diffstat](/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get)\nwith the revspec that corresponds to the pull request." }, "response": [] }, { "name": "Merge a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/merge", "query": [ { "key": "async", "value": "{{async}}", "disabled": true, "description": "Default value is false.\n\n\nWhen set to true, runs merge asynchronously and\nimmediately returns a 202 with polling link to\nthe task-status API in the Location header.\n\n\nWhen set to false, runs merge and waits for it to\ncomplete, returning 200 when it succeeds. If the\nduration of the merge exceeds a timeout threshold,\nthe API returns a 202 with polling link to the\ntask-status API in the Location header." } ], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Merges the pull request.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get the merge task status for a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/merge/task-status/:task_id", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "When merging a pull request takes too long, the client receives a\ntask ID along with a 202 status code. The task ID can be used in a call\nto this endpoint to check the status of a merge task.\n\n```\ncurl -X GET https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/\n```\n\nIf the merge task is not yet finished, a PENDING status will be returned.\n\n```\nHTTP/2 200\n{\n \"task_status\": \"PENDING\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/\"\n }\n }\n}\n```\n\nIf the merge was successful, a SUCCESS status will be returned.\n\n```\nHTTP/2 200\n{\n \"task_status\": \"SUCCESS\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/\"\n }\n },\n \"merge_result\": \n}\n```\n\nIf the merge task failed, an error will be returned.\n\n```\n{\n \"type\": \"error\",\n \"error\": {\n \"message\": \"\"\n }\n}\n```" }, "response": [] }, { "name": "Get the patch for a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/patch", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Redirects to the [repository patch](/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-patch-spec-get)\nwith the revspec that corresponds to pull request." }, "response": [] }, { "name": "Request changes for a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/request-changes", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "" }, "response": [] }, { "name": "Remove change request for a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/request-changes", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "" }, "response": [] }, { "name": "List commit statuses for a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/statuses", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "Query string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n" }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "Field by which the results should be sorted as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\nDefaults to `created_on`.\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns all statuses (e.g. build results) for the given pull\nrequest." }, "response": [] }, { "name": "List tasks on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/tasks", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for details." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nField by which the results should be sorted as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\nDefaults to `created_on`.\n" }, { "key": "pagelen", "value": "{{pagelen}}", "disabled": true, "description": "\nCurrent number of objects on the existing page.\nThe default value is 10 with 100 being the maximum allowed value.\nIndividual APIs may enforce different values.\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of the pull request's tasks.\n\nThis endpoint supports filtering and sorting of the results by the 'task' field.\nSee [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details." }, "response": [] }, { "name": "Create a task on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/tasks", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates a new pull request task.\n\nReturns the newly created pull request task.\n\nTasks can optionally be created in relation to a comment specified by the comment's ID which\nwill cause the task to appear below the comment on a pull request when viewed in Bitbucket.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a task on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/tasks/:task_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a specific pull request task." }, "response": [] }, { "name": "Update a task on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/tasks/:task_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates a specific pull request task.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a task on a pull request", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/tasks/:task_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes a specific pull request task." }, "response": [] } ] }, { "name": "Refs", "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", "item": [ { "name": "List branches and tags", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/refs", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nField by which the results should be sorted as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering). The `name`\nfield is handled specially for refs in that, if specified as the sort field, it\nuses a natural sort order instead of the default lexicographical sort order. For example,\nit will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2']." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the branches and tags in the repository.\n\nBy default, results will be in the order the underlying source control system returns them and identical to\nthe ordering one sees when running \"$ git show-ref\". Note that this follows simple\nlexical ordering of the ref names.\n\nThis can be undesirable as it does apply any natural sorting semantics, meaning for instance that refs are\nsorted [\"branch1\", \"branch10\", \"branch2\", \"v10\", \"v11\", \"v9\"] instead of [\"branch1\", \"branch2\",\n\"branch10\", \"v9\", \"v10\", \"v11\"].\n\nSorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name,\nBitbucket will apply natural sorting and interpret numerical values as numbers instead of strings." }, "response": [] }, { "name": "List open branches", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/refs/branches", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nField by which the results should be sorted as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering). The `name`\nfield is handled specially for branches in that, if specified as the sort field, it\nuses a natural sort order instead of the default lexicographical sort order. For example,\nit will return ['branch1', 'branch2', 'branch10'] instead of ['branch1', 'branch10', 'branch2']." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a list of all open branches within the specified repository.\nResults will be in the order the source control manager returns them.\n\nBranches support [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)\nthat can be used to search for specific branches. For instance, to find\nall branches that have \"stab\" in their name:\n\n```\ncurl -s https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches -G --data-urlencode 'q=name ~ \"stab\"'\n```\n\nBy default, results will be in the order the underlying source control system returns them and identical to\nthe ordering one sees when running \"$ git branch --list\". Note that this follows simple\nlexical ordering of the ref names.\n\nThis can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are\nsorted [\"v10\", \"v11\", \"v9\"] instead of [\"v9\", \"v10\", \"v11\"].\n\nSorting can be changed using the ?q= query parameter. When using ?q=name to explicitly sort on ref name,\nBitbucket will apply natural sorting and interpret numerical values as numbers instead of strings." }, "response": [] }, { "name": "Create a branch", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/refs/branches", "query": [], "variable": [] }, "method": "POST", "header": [], "description": "Creates a new branch in the specified repository.\n\nThe payload of the POST should consist of a JSON document that\ncontains the name of the tag and the target hash.\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/branches \\\n-s -u seanfarley -X POST -H \"Content-Type: application/json\" \\\n-d '{\n \"name\" : \"smf/create-feature\",\n \"target\" : {\n \"hash\" : \"default\",\n }\n}'\n```\n\nThis call requires authentication. Private repositories require the\ncaller to authenticate with an account that has appropriate\nauthorization.\n\nThe branch name should not include any prefixes (e.g.\nrefs/heads). This endpoint does support using short hash prefixes for\nthe commit hash, but it may return a 400 response if the provided\nprefix is ambiguous. Using a full commit hash is the preferred\napproach." }, "response": [] }, { "name": "Get a branch", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/refs/branches/:name", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a branch object within the specified repository.\n\nThis call requires authentication. Private repositories require the\ncaller to authenticate with an account that has appropriate\nauthorization.\n\nFor Git, the branch name should not include any prefixes (e.g.\nrefs/heads)." }, "response": [] }, { "name": "Delete a branch", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/refs/branches/:name", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Delete a branch in the specified repository.\n\nThe main branch is not allowed to be deleted and will return a 400\nresponse.\n\nThe branch name should not include any prefixes (e.g.\nrefs/heads)." }, "response": [] }, { "name": "List tags", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/refs/tags", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nField by which the results should be sorted as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering). The `name`\nfield is handled specially for tags in that, if specified as the sort field, it\nuses a natural sort order instead of the default lexicographical sort order. For example,\nit will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2']." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the tags in the repository.\n\nBy default, results will be in the order the underlying source control system returns them and identical to\nthe ordering one sees when running \"$ git tag --list\". Note that this follows simple\nlexical ordering of the ref names.\n\nThis can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are\nsorted [\"v10\", \"v11\", \"v9\"] instead of [\"v9\", \"v10\", \"v11\"].\n\nSorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name,\nBitbucket will apply natural sorting and interpret numerical values as numbers instead of strings." }, "response": [] }, { "name": "Create a tag", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/refs/tags", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates a new tag in the specified repository.\n\nThe payload of the POST should consist of a JSON document that\ncontains the name of the tag and the target hash.\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/jdoe/myrepo/refs/tags \\\n-s -u jdoe -X POST -H \"Content-Type: application/json\" \\\n-d '{\n \"name\" : \"new-tag-name\",\n \"target\" : {\n \"hash\" : \"a1b2c3d4e5f6\",\n }\n}'\n```\n\nThis endpoint does support using short hash prefixes for the commit\nhash, but it may return a 400 response if the provided prefix is\nambiguous. Using a full commit hash is the preferred approach.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a tag", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/refs/tags/:name", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specified tag.\n\n```\n$ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8 -G | jq .\n{\n \"name\": \"3.8\",\n \"links\": {\n \"commits\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commits/3.8\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/hg/commits/tag/3.8\"\n }\n },\n \"tagger\": {\n \"raw\": \"Matt Mackall \",\n \"type\": \"author\",\n \"user\": {\n \"username\": \"mpmselenic\",\n \"nickname\": \"mpmselenic\",\n \"display_name\": \"Matt Mackall\",\n \"type\": \"user\",\n \"uuid\": \"{a4934530-db4c-419c-a478-9ab4964c2ee7}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/mpmselenic\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/mpmselenic/\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/mpmselenic/avatar/32/\"\n }\n }\n }\n },\n \"date\": \"2016-05-01T18:52:25+00:00\",\n \"message\": \"Added tag 3.8 for changeset f85de28eae32\",\n \"type\": \"tag\",\n \"target\": {\n \"hash\": \"f85de28eae32e7d3064b1a1321309071bbaaa069\",\n \"repository\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/hg\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/seanfarley/hg/avatar/32/\"\n }\n },\n \"type\": \"repository\",\n \"name\": \"hg\",\n \"full_name\": \"seanfarley/hg\",\n \"uuid\": \"{c75687fb-e99d-4579-9087-190dbd406d30}\"\n },\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069\"\n },\n \"comments\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/comments\"\n },\n \"patch\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/patch/f85de28eae32e7d3064b1a1321309071bbaaa069\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/hg/commits/f85de28eae32e7d3064b1a1321309071bbaaa069\"\n },\n \"diff\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/diff/f85de28eae32e7d3064b1a1321309071bbaaa069\"\n },\n \"approve\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/approve\"\n },\n \"statuses\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/statuses\"\n }\n },\n \"author\": {\n \"raw\": \"Sean Farley \",\n \"type\": \"author\",\n \"user\": {\n \"username\": \"seanfarley\",\n \"nickname\": \"seanfarley\",\n \"display_name\": \"Sean Farley\",\n \"type\": \"user\",\n \"uuid\": \"{a295f8a8-5876-4d43-89b5-3ad8c6c3c51d}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/seanfarley\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/seanfarley/avatar/32/\"\n }\n }\n }\n },\n \"parents\": [\n {\n \"hash\": \"9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2\",\n \"type\": \"commit\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/hg/commits/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2\"\n }\n }\n }\n ],\n \"date\": \"2016-05-01T04:21:17+00:00\",\n \"message\": \"debian: alphabetize build deps\",\n \"type\": \"commit\"\n }\n}\n```" }, "response": [] }, { "name": "Delete a tag", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/refs/tags/:name", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Delete a tag in the specified repository.\n\nThe tag name should not include any prefixes (e.g. refs/tags)." }, "response": [] } ] }, { "name": "Reports", "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", "item": [ { "name": "List reports", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/reports", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit for which to retrieve reports.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of Reports linked to this commit." }, "response": [] }, { "name": "Get a report", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit the report belongs to.", "disabled": false }, { "key": "reportId", "value": "{{reportId}}", "description": "Either the uuid or external-id of the report.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a single Report matching the provided ID." }, "response": [] }, { "name": "Create or update a report", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit the report belongs to.", "disabled": false }, { "key": "reportId", "value": "{{reportId}}", "description": "Either the uuid or external-id of the report.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Creates or updates a report for the specified commit.\nTo upload a report, make sure to generate an ID that is unique across all reports for that commit. If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-001.\n\n### Sample cURL request:\n```\ncurl --request PUT 'https://api.bitbucket.org/2.0/repositories///commit//reports/mysystem-001' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Security scan report\",\n \"details\": \"This pull request introduces 10 new dependency vulnerabilities.\",\n \"report_type\": \"SECURITY\",\n \"reporter\": \"mySystem\",\n \"link\": \"http://www.mysystem.com/reports/001\",\n \"result\": \"FAILED\",\n \"data\": [\n {\n \"title\": \"Duration (seconds)\",\n \"type\": \"DURATION\",\n \"value\": 14\n },\n {\n \"title\": \"Safe to merge?\",\n \"type\": \"BOOLEAN\",\n \"value\": false\n }\n ]\n}'\n```\n\n### Possible field values:\nreport_type: SECURITY, COVERAGE, TEST, BUG\nresult: PASSED, FAILED, PENDING\ndata.type: BOOLEAN, DATE, DURATION, LINK, NUMBER, PERCENTAGE, TEXT\n\n#### Data field formats\n| Type Field | Value Field Type | Value Field Display |\n|:--------------|:------------------|:--------------------|\n| None/ Omitted | Number, String or Boolean (not an array or object) | Plain text |\n| BOOLEAN\t| Boolean | The value will be read as a JSON boolean and displayed as 'Yes' or 'No'. |\n| DATE | Number | The value will be read as a JSON number in the form of a Unix timestamp (milliseconds) and will be displayed as a relative date if the date is less than one week ago, otherwise it will be displayed as an absolute date. |\n| DURATION | Number | The value will be read as a JSON number in milliseconds and will be displayed in a human readable duration format. |\n| LINK | Object: `{\"text\": \"Link text here\", \"href\": \"https://link.to.annotation/in/external/tool\"}` | The value will be read as a JSON object containing the fields \"text\" and \"href\" and will be displayed as a clickable link on the report. |\n| NUMBER | Number | The value will be read as a JSON number and large numbers will be displayed in a human readable format (e.g. 14.3k). |\n| PERCENTAGE | Number (between 0 and 100) | The value will be read as a JSON number between 0 and 100 and will be displayed with a percentage sign. |\n| TEXT | String | The value will be read as a JSON string and will be displayed as-is |\n\nPlease refer to the [Code Insights documentation](https://confluence.atlassian.com/bitbucket/code-insights-994316785.html) for more information.\n", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a report", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit the report belongs to.", "disabled": false }, { "key": "reportId", "value": "{{reportId}}", "description": "Either the uuid or external-id of the report.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Deletes a single Report matching the provided ID." }, "response": [] }, { "name": "List annotations", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId/annotations", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit for which to retrieve reports.", "disabled": false }, { "key": "reportId", "value": "{{reportId}}", "description": "Uuid or external-if of the report for which to get annotations for.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of Annotations for a specified report." }, "response": [] }, { "name": "Bulk create or update annotations", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId/annotations", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit for which to retrieve reports.", "disabled": false }, { "key": "reportId", "value": "{{reportId}}", "description": "Uuid or external-if of the report for which to get annotations for.", "disabled": false } ] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Bulk upload of annotations.\nAnnotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations.\n\nAdd the annotations you want to upload as objects in a JSON array and make sure each annotation has the external_id field set to a unique value. If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-annotation001. The external id can later be used to identify the report as an alternative to the generated [UUID](https://developer.atlassian.com/bitbucket/api/2/reference/meta/uri-uuid#uuid). You can upload up to 100 annotations per POST request.\n\n### Sample cURL request:\n```\ncurl --location 'https://api.bitbucket.org/2.0/repositories///commit//reports/mysystem-001/annotations' \\\n--header 'Content-Type: application/json' \\\n--data-raw '[\n {\n \"external_id\": \"mysystem-annotation001\",\n \"title\": \"Security scan report\",\n \"annotation_type\": \"VULNERABILITY\",\n \"summary\": \"This line represents a security threat.\",\n \"severity\": \"HIGH\",\n \"path\": \"my-service/src/main/java/com/myCompany/mysystem/logic/Main.java\",\n \"line\": 42\n },\n {\n \"external_id\": \"mySystem-annotation002\",\n \"title\": \"Bug report\",\n \"annotation_type\": \"BUG\",\n \"result\": \"FAILED\",\n \"summary\": \"This line might introduce a bug.\",\n \"severity\": \"MEDIUM\",\n \"path\": \"my-service/src/main/java/com/myCompany/mysystem/logic/Helper.java\",\n \"line\": 13\n }\n]'\n```\n\n### Possible field values:\nannotation_type: VULNERABILITY, CODE_SMELL, BUG\nresult: PASSED, FAILED, IGNORED, SKIPPED\nseverity: HIGH, MEDIUM, LOW, CRITICAL\n\nPlease refer to the [Code Insights documentation](https://confluence.atlassian.com/bitbucket/code-insights-994316785.html) for more information.\n", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get an annotation", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId/annotations/:annotationId", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit the report belongs to.", "disabled": false }, { "key": "reportId", "value": "{{reportId}}", "description": "Either the uuid or external-id of the report.", "disabled": false }, { "key": "annotationId", "value": "{{annotationId}}", "description": "Either the uuid or external-id of the annotation.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a single Annotation matching the provided ID." }, "response": [] }, { "name": "Create or update an annotation", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId/annotations/:annotationId", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit the report belongs to.", "disabled": false }, { "key": "reportId", "value": "{{reportId}}", "description": "Either the uuid or external-id of the report.", "disabled": false }, { "key": "annotationId", "value": "{{annotationId}}", "description": "Either the uuid or external-id of the annotation.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Creates or updates an individual annotation for the specified report.\nAnnotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations.\n\nJust as reports, annotation needs to be uploaded with a unique ID that can later be used to identify the report as an alternative to the generated [UUID](https://developer.atlassian.com/bitbucket/api/2/reference/meta/uri-uuid#uuid). If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-annotation001.\n\n### Sample cURL request:\n```\ncurl --request PUT 'https://api.bitbucket.org/2.0/repositories///commit//reports/mySystem-001/annotations/mysystem-annotation001' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Security scan report\",\n \"annotation_type\": \"VULNERABILITY\",\n \"summary\": \"This line represents a security thread.\",\n \"severity\": \"HIGH\",\n \"path\": \"my-service/src/main/java/com/myCompany/mysystem/logic/Main.java\",\n \"line\": 42\n}'\n```\n\n### Possible field values:\nannotation_type: VULNERABILITY, CODE_SMELL, BUG\nresult: PASSED, FAILED, IGNORED, SKIPPED\nseverity: HIGH, MEDIUM, LOW, CRITICAL\n\nPlease refer to the [Code Insights documentation](https://confluence.atlassian.com/bitbucket/code-insights-994316785.html) for more information.\n", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete an annotation", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId/annotations/:annotationId", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit the annotation belongs to.", "disabled": false }, { "key": "reportId", "value": "{{reportId}}", "description": "Either the uuid or external-id of the annotation.", "disabled": false }, { "key": "annotationId", "value": "{{annotationId}}", "description": "Either the uuid or external-id of the annotation.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Deletes a single Annotation matching the provided ID." }, "response": [] } ] }, { "name": "Repositories", "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", "item": [ { "name": "List public repositories", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories", "query": [ { "key": "after", "value": "{{after}}", "disabled": true, "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`" }, { "key": "role", "value": "{{role}}", "disabled": true, "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" }, { "key": "q", "value": "{{q}}", "disabled": true, "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" }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "Field by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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." }, "response": [] }, { "name": "List repositories in a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace", "query": [ { "key": "role", "value": "{{role}}", "disabled": true, "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" }, { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n" }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nField by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n " } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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." }, "response": [] }, { "name": "Get a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the object describing this repository." }, "response": [] }, { "name": "Update a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Create a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug", "query": [ { "key": "redirect_to", "value": "{{redirect_to}}", "disabled": true, "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" } ], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the repository. This is an irreversible operation.\n\nThis does not affect its forks." }, "response": [] }, { "name": "List repository forks", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/forks", "query": [ { "key": "role", "value": "{{role}}", "disabled": true, "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" }, { "key": "q", "value": "{{q}}", "disabled": true, "description": "Query string to narrow down the response as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n" }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "Field by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of all the forks of the specified\nrepository." }, "response": [] }, { "name": "Fork a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/forks", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates a new fork of the specified repository.\n\n#### Forking a repository\n\nTo create a fork, specify the workspace explicitly as part of the\nrequest body:\n\n```\n$ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/atlassian/bbql/forks \\\n -H 'Content-Type: application/json' -d '{\n \"name\": \"bbql_fork\",\n \"workspace\": {\n \"slug\": \"atlassian\"\n }\n}'\n```\n\nTo fork a repository into the same workspace, also specify a new `name`.\n\nWhen you specify a value for `name`, it will also affect the `slug`.\nThe `slug` is reflected in the repository URL of the new fork. It is\nderived from `name` by substituting non-ASCII characters, removes\nwhitespace, and changes characters to lower case. For example,\n`My repo` would turn into `my_repo`.\n\nYou need contributor access to create new forks within a workspace.\n\n\n#### Change the properties of a new fork\n\nBy default the fork inherits most of its properties from the parent.\nHowever, since the optional POST body document follows the normal\n`repository` JSON schema and you can override the new fork's\nproperties.\n\nProperties that can be overridden include:\n\n* description\n* fork_policy\n* language\n* mainbranch\n* is_private (note that a private repo's fork_policy might prohibit\n the creation of public forks, in which `is_private=False` would fail)\n* has_issues (to initialize or disable the new repo's issue tracker --\n note that the actual contents of the parent repository's issue\n tracker are not copied during forking)\n* has_wiki (to initialize or disable the new repo's wiki --\n note that the actual contents of the parent repository's wiki are not\n copied during forking)\n* project (when forking into a private project, the fork's `is_private`\n must be `true`)\n\nProperties that cannot be modified include:\n\n* scm\n* parent\n* full_name", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "List webhooks for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/hooks", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of webhooks installed on this repository." }, "response": [] }, { "name": "Create a webhook for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/hooks", "query": [], "variable": [] }, "method": "POST", "header": [], "description": "Creates a new webhook on the specified repository.\n\nExample:\n\n```\n$ curl -X POST -u credentials -H 'Content-Type: application/json'\n https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo-slug/hooks\n -d '\n {\n \"description\": \"Webhook Description\",\n \"url\": \"https://example.com/\",\n \"active\": true,\n \"secret\": \"this is a really bad secret\",\n \"events\": [\n \"repo:push\",\n \"issue:created\",\n \"issue:updated\"\n ]\n }'\n```\n\nWhen the `secret` is provided it will be used as the key to generate a HMAC\ndigest value sent in the `X-Hub-Signature` header at delivery time. Passing\na `null` or empty `secret` or not passing a `secret` will leave the webhook's\nsecret unset. Bitbucket only generates the `X-Hub-Signature` when the webhook's\nsecret is set.\n\nNote that this call requires the webhook scope, as well as any scope\nthat applies to the events that the webhook subscribes to. In the\nexample above that means: `webhook`, `repository` and `issue`.\n\nAlso note that the `url` must properly resolve and cannot be an\ninternal, non-routed address." }, "response": [] }, { "name": "Get a webhook for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/hooks/:uid", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the webhook with the specified id installed on the specified\nrepository." }, "response": [] }, { "name": "Update a webhook for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/hooks/:uid", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates the specified webhook subscription.\n\nThe following properties can be mutated:\n\n* `description`\n* `url`\n* `secret`\n* `active`\n* `events`\n\nThe hook's secret is used as a key to generate the HMAC hex digest sent in the\n`X-Hub-Signature` header at delivery time. This signature is only generated\nwhen the hook has a secret.\n\nSet the hook's secret by passing the new value in the `secret` field. Passing a\n`null` value in the `secret` field will remove the secret from the hook. The\nhook's secret can be left unchanged by not passing the `secret` field in the\nrequest." }, "response": [] }, { "name": "Delete a webhook for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/hooks/:uid", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the specified webhook subscription from the given\nrepository." }, "response": [] }, { "name": "Retrieve the inheritance state for repository settings", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/override-settings", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "" }, "response": [] }, { "name": "Set the inheritance state for repository settings\n ", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/override-settings", "query": [], "variable": [] }, "method": "PUT", "header": [], "description": "" }, "response": [] }, { "name": "List explicit group permissions for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/permissions-config/groups", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of explicit group permissions for the given repository.\nThis endpoint does not support BBQL features." }, "response": [] }, { "name": "Get an explicit group permission for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/permissions-config/groups/:group_slug", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the group permission for a given group slug and repository\n\nOnly users with admin permission for the repository may access this resource.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`\n* `none`" }, "response": [] }, { "name": "Update an explicit group permission for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/permissions-config/groups/:group_slug", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates the group permission, or grants a new permission if one does not already exist.\n\nOnly users with admin permission for the repository may access this resource.\n\nThe only authentication method supported for this endpoint is via app passwords.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete an explicit group permission for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/permissions-config/groups/:group_slug", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the repository group permission between the requested repository and group, if one exists.\n\nOnly users with admin permission for the repository may access this resource." }, "response": [] }, { "name": "List explicit user permissions for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/permissions-config/users", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of explicit user permissions for the given repository.\nThis endpoint does not support BBQL features." }, "response": [] }, { "name": "Get an explicit user permission for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/permissions-config/users/:selected_user_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the explicit user permission for a given user and repository.\n\nOnly users with admin permission for the repository may access this resource.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`\n* `none`" }, "response": [] }, { "name": "Update an explicit user permission for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/permissions-config/users/:selected_user_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates the explicit user permission for a given user and repository. The selected user must be a member of\nthe workspace, and cannot be the workspace owner.\nOnly users with admin permission for the repository may access this resource.\n\nThe only authentication method for this endpoint is via app passwords.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete an explicit user permission for a repository", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/permissions-config/users/:selected_user_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the repository user permission between the requested repository and user, if one exists.\n\nOnly users with admin permission for the repository may access this resource.\n\nThe only authentication method for this endpoint is via app passwords." }, "response": [] }, { "name": "List repositories watchers", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/watchers", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of all the watchers on the specified\nrepository." }, "response": [] }, { "name": "List repository permissions for a user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}user/permissions/repositories", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nName of a response property sort the result by as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns an object for each repository the caller has explicit access\nto and their effective permission — the highest level of permission the\ncaller has. This does not return public repositories that the user was\nnot granted any specific permission in, and does not distinguish between\nexplicit and implicit privileges.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`\n\nResults may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering) by\nrepository or permission by adding the following query string\nparameters:\n\n* `q=repository.name=\"geordi\"` or `q=permission>\"read\"`\n* `sort=repository.name`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`." }, "response": [] } ] }, { "name": "Snippets", "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", "item": [ { "name": "List snippets", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets", "query": [ { "key": "role", "value": "{{role}}", "disabled": true, "description": "Filter down the result based on the authenticated user's role (`owner`, `contributor`, or `member`)." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns all snippets. Like pull requests, repositories and workspaces, the\nfull set of snippets is defined by what the current user has access to.\n\nThis includes all snippets owned by any of the workspaces the user is a member of,\nor snippets by other users that the current user is either watching or has collaborated\non (for instance by commenting on it).\n\nTo limit the set of returned snippets, apply the\n`?role=[owner|contributor|member]` query parameter where the roles are\ndefined as follows:\n\n* `owner`: all snippets owned by the current user\n* `contributor`: all snippets owned by, or watched by the current user\n* `member`: created in a workspaces or watched by the current user\n\nWhen no role is specified, all public snippets are returned, as well as all\nprivately owned snippets watched or commented on.\n\nThe returned response is a normal paginated JSON list. This endpoint\nonly supports `application/json` responses and no\n`multipart/form-data` or `multipart/related`. As a result, it is not\npossible to include the file contents." }, "response": [] }, { "name": "Create a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates a new snippet under the authenticated user's account.\n\nSnippets can contain multiple files. Both text and binary files are\nsupported.\n\nThe simplest way to create a new snippet from a local file:\n\n $ curl -u username:password -X POST https://api.bitbucket.org/2.0/snippets -F file=@image.png\n\nCreating snippets through curl has a few limitations and so let's look\nat a more complicated scenario.\n\nSnippets are created with a multipart POST. Both `multipart/form-data`\nand `multipart/related` are supported. Both allow the creation of\nsnippets with both meta data (title, etc), as well as multiple text\nand binary files.\n\nThe main difference is that `multipart/related` can use rich encoding\nfor the meta data (currently JSON).\n\n\nmultipart/related (RFC-2387)\n----------------------------\n\nThis is the most advanced and efficient way to create a paste.\n\n POST /2.0/snippets/evzijst HTTP/1.1\n Content-Length: 1188\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"title\": \"My snippet\",\n \"is_private\": true,\n \"scm\": \"git\",\n \"files\": {\n \"foo.txt\": {},\n \"image.png\": {}\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"foo.txt\"\n Content-Disposition: attachment; filename=\"foo.txt\"\n\n foo\n\n --===============1438169132528273974==\n Content-Type: image/png\n MIME-Version: 1.0\n Content-Transfer-Encoding: base64\n Content-ID: \"image.png\"\n Content-Disposition: attachment; filename=\"image.png\"\n\n iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m\n TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB\n cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5\n EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ\n 73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN\n AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==\n --===============1438169132528273974==--\n\nThe request contains multiple parts and is structured as follows.\n\nThe first part is the JSON document that describes the snippet's\nproperties or meta data. It either has to be the first part, or the\nrequest's `Content-Type` header must contain the `start` parameter to\npoint to it.\n\nThe remaining parts are the files of which there can be zero or more.\nEach file part should contain the `Content-ID` MIME header through\nwhich the JSON meta data's `files` element addresses it. The value\nshould be the name of the file.\n\n`Content-Disposition` is an optional MIME header. The header's\noptional `filename` parameter can be used to specify the file name\nthat Bitbucket should use when writing the file to disk. When present,\n`filename` takes precedence over the value of `Content-ID`.\n\nWhen the JSON body omits the `files` element, the remaining parts are\nnot ignored. Instead, each file is added to the new snippet as if its\nname was explicitly linked (the use of the `files` elements is\nmandatory for some operations like deleting or renaming files).\n\n\nmultipart/form-data\n-------------------\n\nThe use of JSON for the snippet's meta data is optional. Meta data can\nalso be supplied as regular form fields in a more conventional\n`multipart/form-data` request:\n\n $ curl -X POST -u credentials https://api.bitbucket.org/2.0/snippets -F title=\"My snippet\" -F file=@foo.txt -F file=@image.png\n\n POST /2.0/snippets HTTP/1.1\n Content-Length: 951\n Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"file\"; filename=\"foo.txt\"\n Content-Type: text/plain\n\n foo\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"file\"; filename=\"image.png\"\n Content-Type: application/octet-stream\n\n ?PNG\n\n IHDR?1??I.....\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"title\"\n\n My snippet\n ------------------------------63a4b224c59f--\n\nHere the meta data properties are included as flat, top-level form\nfields. The file attachments use the `file` field name. To attach\nmultiple files, simply repeat the field.\n\nThe advantage of `multipart/form-data` over `multipart/related` is\nthat it can be easier to build clients.\n\nEssentially all properties are optional, `title` and `files` included.\n\n\nSharing and Visibility\n----------------------\n\nSnippets can be either public (visible to anyone on Bitbucket, as well\nas anonymous users), or private (visible only to members of the workspace).\nThis is controlled through the snippet's `is_private` element:\n\n* **is_private=false** -- everyone, including anonymous users can view\n the snippet\n* **is_private=true** -- only workspace members can view the snippet\n\nTo create the snippet under a workspace, just append the workspace ID\nto the URL. See [`/2.0/snippets/{workspace}`](/cloud/bitbucket/rest/api-group-snippets/#api-snippets-workspace-post).", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "List snippets in a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace", "query": [ { "key": "role", "value": "{{role}}", "disabled": true, "description": "Filter down the result based on the authenticated user's role (`owner`, `contributor`, or `member`)." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Identical to [`/snippets`](/cloud/bitbucket/rest/api-group-snippets/#api-snippets-get), except that the result is further filtered\nby the snippet owner and only those that are owned by `{workspace}` are\nreturned." }, "response": [] }, { "name": "Create a snippet for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Identical to [`/snippets`](/cloud/bitbucket/rest/api-group-snippets/#api-snippets-post), except that the new snippet will be\ncreated under the workspace specified in the path parameter\n`{workspace}`.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieves a single snippet.\n\nSnippets support multiple content types:\n\n* application/json\n* multipart/related\n* multipart/form-data\n\n\napplication/json\n----------------\n\nThe default content type of the response is `application/json`.\nSince JSON is always `utf-8`, it cannot reliably contain file contents\nfor files that are not text. Therefore, JSON snippet documents only\ncontain the filename and links to the file contents.\n\nThis means that in order to retrieve all parts of a snippet, N+1\nrequests need to be made (where N is the number of files in the\nsnippet).\n\n\nmultipart/related\n-----------------\n\nTo retrieve an entire snippet in a single response, use the\n`Accept: multipart/related` HTTP request header.\n\n $ curl -H \"Accept: multipart/related\" https://api.bitbucket.org/2.0/snippets/evzijst/1\n\nResponse:\n\n HTTP/1.1 200 OK\n Content-Length: 2214\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/snippets/evzijst/kypj\"\n },\n \"comments\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/comments\"\n },\n \"watchers\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/watchers\"\n },\n \"commits\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/commits\"\n }\n },\n \"id\": kypj,\n \"title\": \"My snippet\",\n \"created_on\": \"2014-12-29T22:22:04.790331+00:00\",\n \"updated_on\": \"2014-12-29T22:22:04.790331+00:00\",\n \"is_private\": false,\n \"files\": {\n \"foo.txt\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/files/367ab19/foo.txt\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/snippets/evzijst/kypj#file-foo.txt\"\n }\n }\n },\n \"image.png\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/files/367ab19/image.png\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/snippets/evzijst/kypj#file-image.png\"\n }\n }\n }\n ],\n \"owner\": {\n \"username\": \"evzijst\",\n \"nickname\": \"evzijst\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/evzijst\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/evzijst\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/31/erik-avatar-725122544-0_avatar.png\"\n }\n }\n },\n \"creator\": {\n \"username\": \"evzijst\",\n \"nickname\": \"evzijst\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/evzijst\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/evzijst\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/31/erik-avatar-725122544-0_avatar.png\"\n }\n }\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"foo.txt\"\n Content-Disposition: attachment; filename=\"foo.txt\"\n\n foo\n\n --===============1438169132528273974==\n Content-Type: image/png\n MIME-Version: 1.0\n Content-Transfer-Encoding: base64\n Content-ID: \"image.png\"\n Content-Disposition: attachment; filename=\"image.png\"\n\n iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m\n TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB\n cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5\n EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ\n 73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN\n AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==\n --===============1438169132528273974==--\n\nmultipart/form-data\n-------------------\n\nAs with creating new snippets, `multipart/form-data` can be used as an\nalternative to `multipart/related`. However, the inherently flat\nstructure of form-data means that only basic, root-level properties\ncan be returned, while nested elements like `links` are omitted:\n\n $ curl -H \"Accept: multipart/form-data\" https://api.bitbucket.org/2.0/snippets/evzijst/kypj\n\nResponse:\n\n HTTP/1.1 200 OK\n Content-Length: 951\n Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"title\"\n Content-Type: text/plain; charset=\"utf-8\"\n\n My snippet\n ------------------------------63a4b224c59f--\n Content-Disposition: attachment; name=\"file\"; filename=\"foo.txt\"\n Content-Type: text/plain\n\n foo\n\n ------------------------------63a4b224c59f\n Content-Disposition: attachment; name=\"file\"; filename=\"image.png\"\n Content-Transfer-Encoding: base64\n Content-Type: application/octet-stream\n\n iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m\n TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB\n cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5\n EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ\n 73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN\n AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==\n ------------------------------5957323a6b76--" }, "response": [] }, { "name": "Update a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Used to update a snippet. Use this to add and delete files and to\nchange a snippet's title.\n\nTo update a snippet, one can either PUT a full snapshot, or only the\nparts that need to be changed.\n\nThe contract for PUT on this API is that properties missing from the\nrequest remain untouched so that snippets can be efficiently\nmanipulated with differential payloads.\n\nTo delete a property (e.g. the title, or a file), include its name in\nthe request, but omit its value (use `null`).\n\nAs in Git, explicit renaming of files is not supported. Instead, to\nrename a file, delete it and add it again under another name. This can\nbe done atomically in a single request. Rename detection is left to\nthe SCM.\n\nPUT supports three different content types for both request and\nresponse bodies:\n\n* `application/json`\n* `multipart/related`\n* `multipart/form-data`\n\nThe content type used for the request body can be different than that\nused for the response. Content types are specified using standard HTTP\nheaders.\n\nUse the `Content-Type` and `Accept` headers to select the desired\nrequest and response format.\n\n\napplication/json\n----------------\n\nAs with creation and retrieval, the content type determines what\nproperties can be manipulated. `application/json` does not support\nfile contents and is therefore limited to a snippet's meta data.\n\nTo update the title, without changing any of its files:\n\n $ curl -X POST -H \"Content-Type: application/json\" https://api.bitbucket.org/2.0/snippets/evzijst/kypj -d '{\"title\": \"Updated title\"}'\n\n\nTo delete the title:\n\n $ curl -X POST -H \"Content-Type: application/json\" https://api.bitbucket.org/2.0/snippets/evzijst/kypj -d '{\"title\": null}'\n\nNot all parts of a snippet can be manipulated. The owner and creator\nfor instance are immutable.\n\n\nmultipart/related\n-----------------\n\n`multipart/related` can be used to manipulate all of a snippet's\nproperties. The body is identical to a POST. properties omitted from\nthe request are left unchanged. Since the `start` part contains JSON,\nthe mechanism for manipulating the snippet's meta data is identical\nto `application/json` requests.\n\nTo update one of a snippet's file contents, while also changing its\ntitle:\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 288\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"title\": \"My updated snippet\",\n \"files\": {\n \"foo.txt\": {}\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"foo.txt\"\n Content-Disposition: attachment; filename=\"foo.txt\"\n\n Updated file contents.\n\n --===============1438169132528273974==--\n\nHere only the parts that are changed are included in the body. The\nother files remain untouched.\n\nNote the use of the `files` list in the JSON part. This list contains\nthe files that are being manipulated. This list should have\ncorresponding multiparts in the request that contain the new contents\nof these files.\n\nIf a filename in the `files` list does not have a corresponding part,\nit will be deleted from the snippet, as shown below:\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 188\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"files\": {\n \"image.png\": {}\n }\n }\n\n --===============1438169132528273974==--\n\nTo simulate a rename, delete a file and add the same file under\nanother name:\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 212\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"files\": {\n \"foo.txt\": {},\n \"bar.txt\": {}\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"bar.txt\"\n Content-Disposition: attachment; filename=\"bar.txt\"\n\n foo\n\n --===============1438169132528273974==--\n\n\nmultipart/form-data\n-----------------\n\nAgain, one can also use `multipart/form-data` to manipulate file\ncontents and meta data atomically.\n\n $ curl -X PUT http://localhost:12345/2.0/snippets/evzijst/kypj -F title=\"My updated snippet\" -F file=@foo.txt\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 351\n Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"file\"; filename=\"foo.txt\"\n Content-Type: text/plain\n\n foo\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"title\"\n\n My updated snippet\n ------------------------------63a4b224c59f\n\nTo delete a file, omit its contents while including its name in the\n`files` field:\n\n $ curl -X PUT https://api.bitbucket.org/2.0/snippets/evzijst/kypj -F files=image.png\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 149\n Content-Type: multipart/form-data; boundary=----------------------------ef8871065a86\n\n ------------------------------ef8871065a86\n Content-Disposition: form-data; name=\"files\"\n\n image.png\n ------------------------------ef8871065a86--\n\nThe explicit use of the `files` element in `multipart/related` and\n`multipart/form-data` is only required when deleting files.\nThe default mode of operation is for file parts to be processed,\nregardless of whether or not they are listed in `files`, as a\nconvenience to the client." }, "response": [] }, { "name": "Delete a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes a snippet and returns an empty response." }, "response": [] }, { "name": "List comments on a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/comments", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Used to retrieve a paginated list of all comments for a specific\nsnippet.\n\nThis resource works identical to commit and pull request comments.\n\nThe default sorting is oldest to newest and can be overridden with\nthe `sort` query parameter." }, "response": [] }, { "name": "Create a comment on a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/comments", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Creates a new comment.\n\nThe only required field in the body is `content.raw`.\n\nTo create a threaded reply to an existing comment, include `parent.id`.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a comment on a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/comments/:comment_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the specific snippet comment." }, "response": [] }, { "name": "Update a comment on a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/comments/:comment_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates a comment.\n\nThe only required field in the body is `content.raw`.\n\nComments can only be updated by their author.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a comment on a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/comments/:comment_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes a snippet comment.\n\nComments can only be removed by the comment author, snippet creator, or workspace admin." }, "response": [] }, { "name": "List snippet changes", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/commits", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the changes (commits) made on this snippet." }, "response": [] }, { "name": "Get a previous snippet change", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/commits/:revision", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the changes made on this snippet in this commit." }, "response": [] }, { "name": "Get a snippet's raw file at HEAD", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/files/:path", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Convenience resource for getting to a snippet's raw files without the\nneed for first having to retrieve the snippet itself and having to pull\nout the versioned file links." }, "response": [] }, { "name": "Check if the current user is watching a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/watch", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Used to check if the current user is watching a specific snippet.\n\nReturns 204 (No Content) if the user is watching the snippet and 404 if\nnot.\n\nHitting this endpoint anonymously always returns a 404." }, "response": [] }, { "name": "Watch a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/watch", "query": [], "variable": [] }, "method": "PUT", "header": [], "description": "Used to start watching a specific snippet. Returns 204 (No Content)." }, "response": [] }, { "name": "Stop watching a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/watch", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Used to stop watching a specific snippet. Returns 204 (No Content)\nto indicate success." }, "response": [] }, { "name": "List users watching a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/watchers", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of all users watching a specific snippet." }, "response": [] }, { "name": "Get a previous revision of a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/:node_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Identical to `GET /snippets/encoded_id`, except that this endpoint\ncan be used to retrieve the contents of the snippet as it was at an\nolder revision, while `/snippets/encoded_id` always returns the\nsnippet's current revision.\n\nNote that only the snippet's file contents are versioned, not its\nmeta data properties like the title.\n\nOther than that, the two endpoints are identical in behavior." }, "response": [] }, { "name": "Update a previous revision of a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/:node_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Identical to `UPDATE /snippets/encoded_id`, except that this endpoint\ntakes an explicit commit revision. Only the snippet's \"HEAD\"/\"tip\"\n(most recent) version can be updated and requests on all other,\nolder revisions fail by returning a 405 status.\n\nUsage of this endpoint over the unrestricted `/snippets/encoded_id`\ncould be desired if the caller wants to be sure no concurrent\nmodifications have taken place between the moment of the UPDATE\nrequest and the original GET.\n\nThis can be considered a so-called \"Compare And Swap\", or CAS\noperation.\n\nOther than that, the two endpoints are identical in behavior." }, "response": [] }, { "name": "Delete a previous revision of a snippet", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/:node_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the snippet.\n\nNote that this only works for versioned URLs that point to the latest\ncommit of the snippet. Pointing to an older commit results in a 405\nstatus code.\n\nTo delete a snippet, regardless of whether or not concurrent changes\nare being made to it, use `DELETE /snippets/{encoded_id}` instead." }, "response": [] }, { "name": "Get a snippet's raw file", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/:node_id/files/:path", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Retrieves the raw contents of a specific file in the snippet. The\n`Content-Disposition` header will be \"attachment\" to avoid issues with\nmalevolent executable files.\n\nThe file's mime type is derived from its filename and returned in the\n`Content-Type` header.\n\nNote that for text files, no character encoding is included as part of\nthe content type." }, "response": [] }, { "name": "Get snippet changes between versions", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/:revision/diff", "query": [ { "key": "path", "value": "{{path}}", "disabled": true, "description": "When used, only one the diff of the specified file will be returned." } ], "variable": [] }, "method": "GET", "header": [], "description": "Returns the diff of the specified commit against its first parent.\n\nNote that this resource is different in functionality from the `patch`\nresource.\n\nThe differences between a diff and a patch are:\n\n* patches have a commit header with the username, message, etc\n* diffs support the optional `path=foo/bar.py` query param to filter the\n diff to just that one file diff (not supported for patches)\n* for a merge, the diff will show the diff between the merge commit and\n its first parent (identical to how PRs work), while patch returns a\n response containing separate patches for each commit on the second\n parent's ancestry, up to the oldest common ancestor (identical to\n its reachability).\n\nNote that the character encoding of the contents of the diff is\nunspecified as Git does not track this, making it hard for\nBitbucket to reliably determine this." }, "response": [] }, { "name": "Get snippet patch between versions", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}snippets/:workspace/:encoded_id/:revision/patch", "query": [], "variable": [] }, "method": "GET", "header": [], "description": "Returns the patch of the specified commit against its first\nparent.\n\nNote that this resource is different in functionality from the `diff`\nresource.\n\nThe differences between a diff and a patch are:\n\n* patches have a commit header with the username, message, etc\n* diffs support the optional `path=foo/bar.py` query param to filter the\n diff to just that one file diff (not supported for patches)\n* for a merge, the diff will show the diff between the merge commit and\n its first parent (identical to how PRs work), while patch returns a\n response containing separate patches for each commit on the second\n parent's ancestry, up to the oldest common ancestor (identical to\n its reachability).\n\nNote that the character encoding of the contents of the patch is\nunspecified as Git does not track this, making it hard for\nBitbucket to reliably determine this." }, "response": [] } ] }, { "name": "Source", "description": "Browse the source code in the repository and\n create new commits by uploading.", "item": [ { "name": "List commits that modified a file", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/filehistory/:commit/:path", "query": [ { "key": "renames", "value": "{{renames}}", "disabled": true, "description": "\nWhen `true`, Bitbucket will follow the history of the file across\nrenames (this is the default behavior). This can be turned off by\nspecifying `false`." }, { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nName of a response property sort the result by as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#sorting-query-results).\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of commits that modified the specified file.\n\nCommits are returned in reverse chronological order. This is roughly\nequivalent to the following commands:\n\n $ git log --follow --date-order \n\nBy default, Bitbucket will follow renames and the path name in the\nreturned entries reflects that. This can be turned off using the\n`?renames=false` query parameter.\n\nResults are returned in descending chronological order by default, and\nlike most endpoints you can\n[filter and sort](/cloud/bitbucket/rest/intro/#filtering) the response to\nonly provide exactly the data you want.\n\nThe example response returns commits made before 2011-05-18 against a file\nnamed `README.rst`. The results are filtered to only return the path and\ndate. This request can be made using:\n\n```\n$ curl 'https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/filehistory/master/README.rst'\\\n '?fields=values.next,values.path,values.commit.date&q=commit.date<=2011-05-18'\n```\n\nIn the response you can see that the file was renamed to `README.rst`\nby the commit made on 2011-05-16, and was previously named `README.txt`." }, "response": [] }, { "name": "Get the root directory of the main branch", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/src", "query": [ { "key": "format", "value": "{{format}}", "disabled": true, "description": "Instead of returning the file's contents, return the (json) meta data for it." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "This endpoint redirects the client to the directory listing of the\nroot directory on the main branch.\n\nThis is equivalent to directly hitting\n[/2.0/repositories/{username}/{repo_slug}/src/{commit}/{path}](src/%7Bcommit%7D/%7Bpath%7D)\nwithout having to know the name or SHA1 of the repo's main branch.\n\nTo create new commits, [POST to this endpoint](#post)" }, "response": [] }, { "name": "Create a commit by uploading a file", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/src", "query": [ { "key": "message", "value": "{{message}}", "disabled": true, "description": "The commit message. When omitted, Bitbucket uses a canned string." }, { "key": "author", "value": "{{author}}", "disabled": true, "description": "\nThe raw string to be used as the new commit's author.\nThis string follows the format\n`Erik van Zijst `.\n\nWhen omitted, Bitbucket uses the authenticated user's\nfull/display name and primary email address. Commits cannot\nbe created anonymously." }, { "key": "parents", "value": "{{parents}}", "disabled": true, "description": "\nA comma-separated list of SHA1s of the commits that should\nbe the parents of the newly created commit.\n\nWhen omitted, the new commit will inherit from and become\na child of the main branch's tip/HEAD commit.\n\nWhen more than one SHA1 is provided, the first SHA1\nidentifies the commit from which the content will be\ninherited.\"." }, { "key": "files", "value": "{{files}}", "disabled": true, "description": "\nOptional field that declares the files that the request is\nmanipulating. When adding a new file to a repo, or when\noverwriting an existing file, the client can just upload\nthe full contents of the file in a normal form field and\nthe use of this `files` meta data field is redundant.\nHowever, when the `files` field contains a file path that\ndoes not have a corresponding, identically-named form\nfield, then Bitbucket interprets that as the client wanting\nto replace the named file with the null set and the file is\ndeleted instead.\n\nPaths in the repo that are referenced in neither files nor\nan individual file field, remain unchanged and carry over\nfrom the parent to the new commit.\n\nThis API does not support renaming as an explicit feature.\nTo rename a file, simply delete it and recreate it under\nthe new name in the same commit.\n" }, { "key": "branch", "value": "{{branch}}", "disabled": true, "description": "\nThe name of the branch that the new commit should be\ncreated on. When omitted, the commit will be created on top\nof the main branch and will become the main branch's new\nhead.\n\nWhen a branch name is provided that already exists in the\nrepo, then the commit will be created on top of that\nbranch. In this case, *if* a parent SHA1 was also provided,\nthen it is asserted that the parent is the branch's\ntip/HEAD at the time the request is made. When this is not\nthe case, a 409 is returned.\n\nWhen a new branch name is specified (that does not already\nexist in the repo), and no parent SHA1s are provided, then\nthe new commit will inherit from the current main branch's\ntip/HEAD commit, but not advance the main branch. The new\ncommit will be the new branch. When the request *also*\nspecifies a parent SHA1, then the new commit and branch\nare created directly on top of the parent commit,\nregardless of the state of the main branch.\n\nWhen a branch name is not specified, but a parent SHA1 is\nprovided, then Bitbucket asserts that it represents the\nmain branch's current HEAD/tip, or a 409 is returned.\n\nWhen a branch name is not specified and the repo is empty,\nthe new commit will become the repo's root commit and will\nbe on the main branch.\n\nWhen a branch name is specified and the repo is empty, the\nnew commit will become the repo's root commit and also\ndefine the repo's main branch going forward.\n\nThis API cannot be used to create additional root commits\nin non-empty repos.\n\nThe branch field cannot be repeated.\n\nAs a side effect, this API can be used to create a new\nbranch without modifying any files, by specifying a new\nbranch name in this field, together with `parents`, but\nomitting the `files` fields, while not sending any files.\nThis will create a new commit and branch with the same\ncontents as the first parent. The diff of this commit\nagainst its first parent will be empty.\n" } ], "variable": [] }, "method": "POST", "header": [], "description": "This endpoint is used to create new commits in the repository by\nuploading files.\n\nTo add a new file to a repository:\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \\\n -F /repo/path/to/image.png=@image.png\n```\n\nThis will create a new commit on top of the main branch, inheriting the\ncontents of the main branch, but adding (or overwriting) the\n`image.png` file to the repository in the `/repo/path/to` directory.\n\nTo create a commit that deletes files, use the `files` parameter:\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \\\n -F files=/file/to/delete/1.txt \\\n -F files=/file/to/delete/2.txt\n```\n\nYou can add/modify/delete multiple files in a request. Rename/move a\nfile by deleting the old path and adding the content at the new path.\n\nThis endpoint accepts `multipart/form-data` (as in the examples above),\nas well as `application/x-www-form-urlencoded`.\n\nNote: `multipart/form-data` is currently not supported by Forge apps\nfor this API.\n\n#### multipart/form-data\n\nA `multipart/form-data` post contains a series of \"form fields\" that\nidentify both the individual files that are being uploaded, as well as\nadditional, optional meta data.\n\nFiles are uploaded in file form fields (those that have a\n`Content-Disposition` parameter) whose field names point to the remote\npath in the repository where the file should be stored. Path field\nnames are always interpreted to be absolute from the root of the\nrepository, regardless whether the client uses a leading slash (as the\nabove `curl` example did).\n\nFile contents are treated as bytes and are not decoded as text.\n\nThe commit message, as well as other non-file meta data for the\nrequest, is sent along as normal form field elements. Meta data fields\nshare the same namespace as the file objects. For `multipart/form-data`\nbodies that should not lead to any ambiguity, as the\n`Content-Disposition` header will contain the `filename` parameter to\ndistinguish between a file named \"message\" and the commit message field.\n\n#### application/x-www-form-urlencoded\n\nIt is also possible to upload new files using a simple\n`application/x-www-form-urlencoded` POST. This can be convenient when\nuploading pure text files:\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src \\\n --data-urlencode \"/path/to/me.txt=Lorem ipsum.\" \\\n --data-urlencode \"message=Initial commit\" \\\n --data-urlencode \"author=Erik van Zijst \"\n```\n\nThere could be a field name clash if a client were to upload a file\nnamed \"message\", as this filename clashes with the meta data property\nfor the commit message. To avoid this and to upload files whose names\nclash with the meta data properties, use a leading slash for the files,\ne.g. `curl --data-urlencode \"/message=file contents\"`.\n\nWhen an explicit slash is omitted for a file whose path matches that of\na meta data parameter, then it is interpreted as meta data, not as a\nfile.\n\n#### Executables and links\n\nWhile this API aims to facilitate the most common use cases, it is\npossible to perform some more advanced operations like creating a new\nsymlink in the repository, or creating an executable file.\n\nFiles can be supplied with a `x-attributes` value in the\n`Content-Disposition` header. For example, to upload an executable\nfile, as well as create a symlink from `README.txt` to `README`:\n\n```\n--===============1438169132528273974==\nContent-Type: text/plain; charset=\"us-ascii\"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nContent-ID: \"bin/shutdown.sh\"\nContent-Disposition: attachment; filename=\"shutdown.sh\"; x-attributes:\"executable\"\n\n#!/bin/sh\nhalt\n\n--===============1438169132528273974==\nContent-Type: text/plain; charset=\"us-ascii\"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nContent-ID: \"/README.txt\"\nContent-Disposition: attachment; filename=\"README.txt\"; x-attributes:\"link\"\n\nREADME\n--===============1438169132528273974==--\n```\n\nLinks are files that contain the target path and have\n`x-attributes:\"link\"` set.\n\nWhen overwriting links with files, or vice versa, the newly uploaded\nfile determines both the new contents, as well as the attributes. That\nmeans uploading a file without specifying `x-attributes=\"link\"` will\ncreate a regular file, even if the parent commit hosted a symlink at\nthe same path.\n\nThe same applies to executables. When modifying an existing executable\nfile, the form-data file element must include\n`x-attributes=\"executable\"` in order to preserve the executable status\nof the file.\n\nNote that this API does not support the creation or manipulation of\nsubrepos / submodules." }, "response": [] }, { "name": "Get file or directory contents", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/src/:commit/:path", "query": [ { "key": "format", "value": "{{format}}", "disabled": true, "description": "If 'meta' is provided, returns the (json) meta data for the contents of the file. If 'rendered' is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. The 'rendered' option only supports these filetypes: `.md`, `.markdown`, `.mkd`, `.mkdn`, `.mdown`, `.text`, `.rst`, and `.textile`. Since Git does not generally track what text encoding scheme is used, this endpoint attempts to detect the most appropriate character encoding. While usually correct, determining the character encoding can be ambiguous which in exceptional cases can lead to misinterpretation of the characters. As such, the raw element in the response object should not be treated as equivalent to the file's actual contents." }, { "key": "q", "value": "{{q}}", "disabled": true, "description": "Optional filter expression as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "Optional sorting parameter as per [filtering and sorting](/cloud/bitbucket/rest/intro/#sorting-query-results)." }, { "key": "max_depth", "value": "{{max_depth}}", "disabled": true, "description": "If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "This endpoints is used to retrieve the contents of a single file,\nor the contents of a directory at a specified revision.\n\n#### Raw file contents\n\nWhen `path` points to a file, this endpoint returns the raw contents.\nThe response's Content-Type is derived from the filename\nextension (not from the contents). The file contents are not processed\nand no character encoding/recoding is performed and as a result no\ncharacter encoding is included as part of the Content-Type.\n\nThe `Content-Disposition` header will be \"attachment\" to prevent\nbrowsers from running executable files.\n\nIf the file is managed by LFS, then a 301 redirect pointing to\nAtlassian's media services platform is returned.\n\nThe response includes an ETag that is based on the contents of the file\nand its attributes. This means that an empty `__init__.py` always\nreturns the same ETag, regardless on the directory it lives in, or the\ncommit it is on.\n\n#### File meta data\n\nWhen the request for a file path includes the query parameter\n`?format=meta`, instead of returning the file's raw contents, Bitbucket\ninstead returns the JSON object describing the file's properties:\n\n```javascript\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef/tests/__init__.py?format=meta\n{\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py\"\n },\n \"meta\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py?format=meta\"\n }\n },\n \"path\": \"tests/__init__.py\",\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n }\n }\n },\n \"attributes\": [],\n \"type\": \"commit_file\",\n \"size\": 0\n}\n```\n\nFile objects contain an `attributes` element that contains a list of\npossible modifiers. Currently defined values are:\n\n* `link` -- indicates that the entry is a symbolic link. The contents\n of the file represent the path the link points to.\n* `executable` -- indicates that the file has the executable bit set.\n* `subrepository` -- indicates that the entry points to a submodule or\n subrepo. The contents of the file is the SHA1 of the repository\n pointed to.\n* `binary` -- indicates whether Bitbucket thinks the file is binary.\n\nThis endpoint can provide an alternative to how a HEAD request can be\nused to check for the existence of a file, or a file's size without\nincurring the overhead of receiving its full contents.\n\n\n#### Directory listings\n\nWhen `path` points to a directory instead of a file, the response is a\npaginated list of directory and file objects in the same order as the\nunderlying SCM system would return them.\n\nFor example:\n\n```javascript\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef/tests\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"path\": \"tests/test_project\",\n \"type\": \"commit_directory\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/\"\n },\n \"meta\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/?format=meta\"\n }\n },\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n }\n }\n }\n },\n {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py\"\n },\n \"meta\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py?format=meta\"\n }\n },\n \"path\": \"tests/__init__.py\",\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n }\n }\n },\n \"attributes\": [],\n \"type\": \"commit_file\",\n \"size\": 0\n }\n ],\n \"page\": 1,\n \"size\": 2\n}\n```\n\nWhen listing the contents of the repo's root directory, the use of a\ntrailing slash at the end of the URL is required.\n\nThe response by default is not recursive, meaning that only the direct contents of\na path are returned. The response does not recurse down into\nsubdirectories. In order to \"walk\" the entire directory tree, the\nclient can either parse each response and follow the `self` links of each\n`commit_directory` object, or can specify a `max_depth` to recurse to.\n\nThe max_depth parameter will do a breadth-first search to return the contents of the subdirectories\nup to the depth specified. Breadth-first search was chosen as it leads to the least amount of\nfile system operations for git. If the `max_depth` parameter is specified to be too\nlarge, the call will time out and return a 555.\n\nEach returned object is either a `commit_file`, or a `commit_directory`,\nboth of which contain a `path` element. This path is the absolute path\nfrom the root of the repository. Each object also contains a `commit`\nobject which embeds the commit the file is on. Note that this is merely\nthe commit that was used in the URL. It is *not* the commit that last\nmodified the file.\n\nDirectory objects have 2 representations. Their `self` link returns the\npaginated contents of the directory. The `meta` link on the other hand\nreturns the actual `directory` object itself, e.g.:\n\n```javascript\n{\n \"path\": \"tests/test_project\",\n \"type\": \"commit_directory\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/\"\n },\n \"meta\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/?format=meta\"\n }\n },\n \"commit\": { ... }\n}\n```\n\n#### Querying, filtering and sorting\n\nLike most API endpoints, this API supports the Bitbucket\nquerying/filtering syntax and so you could filter a directory listing\nto only include entries that match certain criteria. For instance, to\nlist all binary files over 1kb use the expression:\n\n`size > 1024 and attributes = \"binary\"`\n\nwhich after urlencoding yields the query string:\n\n`?q=size%3E1024+and+attributes%3D%22binary%22`\n\nTo change the ordering of the response, use the `?sort` parameter:\n\n`.../src/eefd5ef/?sort=-size`\n\nSee [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more\ndetails." }, "response": [] } ] }, { "name": "Ssh", "description": "The SSH resource allows you to manage SSH keys.\n", "item": [ { "name": "List SSH keys", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/ssh-keys", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of the user's SSH public keys." }, "response": [] }, { "name": "Add a new SSH key", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/ssh-keys", "query": [], "variable": [] }, "method": "POST", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Adds a new SSH public key to the specified user account and returns the resulting key.\n\nExample:\n\n```\n$ curl -X POST -H \"Content-Type: application/json\" -d '{\"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY user@myhost\"}' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys\n```", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Get a SSH key", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/ssh-keys/:key_id", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a specific SSH public key belonging to a user." }, "response": [] }, { "name": "Update a SSH key", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/ssh-keys/:key_id", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" }, { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates a specific SSH public key on a user's account\n\nNote: Only the 'comment' field can be updated using this API. To modify the key or comment values, you must delete and add the key again.\n\nExample:\n\n```\n$ curl -X PUT -H \"Content-Type: application/json\" -d '{\"label\": \"Work key\"}' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/{b15b6026-9c02-4626-b4ad-b905f99f763a}\n```", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a SSH key", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/ssh-keys/:key_id", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes a specific SSH public key from a user's account." }, "response": [] } ] }, { "name": "Users", "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", "item": [ { "name": "Get current user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}user", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the currently logged in user." }, "response": [] }, { "name": "List email addresses for current user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}user/emails", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns all the authenticated user's email addresses. Both\nconfirmed and unconfirmed." }, "response": [] }, { "name": "Get an email address for current user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}user/emails/:email", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns details about a specific one of the authenticated user's\nemail addresses.\n\nDetails describe whether the address has been confirmed by the user and\nwhether it is the user's primary address or not." }, "response": [] }, { "name": "Get a user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Gets the public information associated with a user account.\n\nIf the user's profile is private, `location`, `website` and\n`created_on` elements are omitted.\n\nNote that the user object returned by this operation is changing significantly, due to privacy changes.\nSee the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#changes-to-bitbucket-user-objects) for details." }, "response": [] } ] }, { "name": "Webhooks", "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", "item": [ { "name": "Get a webhook resource", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}hook_events", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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." }, "response": [] }, { "name": "List subscribable webhook types", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}hook_events/:subject_type", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "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." }, "response": [] } ] }, { "name": "Workspaces", "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", "item": [ { "name": "List workspaces for the current user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}user/permissions/workspaces", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for details." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nName of a response property to sort results. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#sorting-query-results)\nfor details.\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns an object for each workspace the caller is a member of, and\ntheir effective role - the highest level of privilege the caller has.\nIf a user is a member of multiple groups with distinct roles, only the\nhighest level is returned.\n\nPermissions can be:\n\n* `owner`\n* `collaborator`\n* `member`\n\n**The `collaborator` role is being removed from the Bitbucket Cloud API. For more information,\nsee the [deprecation announcement](/cloud/bitbucket/deprecation-notice-collaborator-role/).**\n\n**When you move your administration from Bitbucket Cloud to admin.atlassian.com, the following fields on\n`workspace_membership` will no longer be present: `last_accessed` and `added_on`. See the\n[deprecation announcement](/cloud/bitbucket/announcement-breaking-change-workspace-membership/).**\n\nResults may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering) by\nworkspace or permission by adding the following query string parameters:\n\n* `q=workspace.slug=\"bbworkspace1\"` or `q=permission=\"owner\"`\n* `sort=workspace.slug`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`." }, "response": [] }, { "name": "List workspaces for user", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces", "query": [ { "key": "role", "value": "{{role}}", "disabled": true, "description": "\n Filters the workspaces based on the authenticated user's role on each workspace.\n\n * **member**: returns a list of all the workspaces which the caller is a member of\n at least one workspace group or repository\n * **collaborator**: returns a list of workspaces which the caller has write access\n to at least one repository in the workspace\n * **owner**: returns a list of workspaces which the caller has administrator access\n " }, { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for details." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nName of a response property to sort results. See\n[filtering and sorting](/cloud/bitbucket/rest/intro/#sorting-query-results)\nfor details.\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a list of workspaces accessible by the authenticated user.\n\nResults may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering) by\nworkspace or permission by adding the following query string parameters:\n\n* `q=slug=\"bbworkspace1\"` or `q=is_private=true`\n* `sort=created_on`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`.\n\n**The `collaborator` role is being removed from the Bitbucket Cloud API. For more information,\nsee the [deprecation announcement](/cloud/bitbucket/deprecation-notice-collaborator-role/).**" }, "response": [] }, { "name": "Get a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the requested workspace." }, "response": [] }, { "name": "List webhooks for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/hooks", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns a paginated list of webhooks installed on this workspace." }, "response": [] }, { "name": "Create a webhook for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/hooks", "query": [], "variable": [] }, "method": "POST", "header": [], "description": "Creates a new webhook on the specified workspace.\n\nWorkspace webhooks are fired for events from all repositories contained\nby that workspace.\n\nExample:\n\n```\n$ curl -X POST -u credentials -H 'Content-Type: application/json'\n https://api.bitbucket.org/2.0/workspaces/my-workspace/hooks\n -d '\n {\n \"description\": \"Webhook Description\",\n \"url\": \"https://example.com/\",\n \"active\": true,\n \"secret\": \"this is a really bad secret\",\n \"events\": [\n \"repo:push\",\n \"issue:created\",\n \"issue:updated\"\n ]\n }'\n```\n\nWhen the `secret` is provided it will be used as the key to generate a HMAC\ndigest value sent in the `X-Hub-Signature` header at delivery time. Passing\na `null` or empty `secret` or not passing a `secret` will leave the webhook's\nsecret unset. Bitbucket only generates the `X-Hub-Signature` when the webhook's\nsecret is set.\n\nThis call requires the webhook scope, as well as any scope\nthat applies to the events that the webhook subscribes to. In the\nexample above that means: `webhook`, `repository` and `issue`.\n\nThe `url` must properly resolve and cannot be an internal, non-routed address.\n\nOnly workspace owners can install webhooks on workspaces." }, "response": [] }, { "name": "Get a webhook for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/hooks/:uid", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the webhook with the specified id installed on the given\nworkspace." }, "response": [] }, { "name": "Update a webhook for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/hooks/:uid", "query": [], "variable": [] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Updates the specified webhook subscription.\n\nThe following properties can be mutated:\n\n* `description`\n* `url`\n* `secret`\n* `active`\n* `events`\n\nThe hook's secret is used as a key to generate the HMAC hex digest sent in the\n`X-Hub-Signature` header at delivery time. This signature is only generated\nwhen the hook has a secret.\n\nSet the hook's secret by passing the new value in the `secret` field. Passing a\n`null` value in the `secret` field will remove the secret from the hook. The\nhook's secret can be left unchanged by not passing the `secret` field in the\nrequest." }, "response": [] }, { "name": "Delete a webhook for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/hooks/:uid", "query": [], "variable": [] }, "method": "DELETE", "header": [], "description": "Deletes the specified webhook subscription from the given workspace." }, "response": [] }, { "name": "List users in a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/members", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns all members of the requested workspace." }, "response": [] }, { "name": "Get user membership for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/members/:member", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the workspace membership, which includes\na `User` object for the member and a `Workspace` object\nfor the requested workspace." }, "response": [] }, { "name": "List user permissions in a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/permissions", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the list of members in a workspace\nand their permission levels.\nPermission can be:\n* `owner`\n* `collaborator`\n* `member`\n\n**The `collaborator` role is being removed from the Bitbucket Cloud API. For more information,\nsee the [deprecation announcement](/cloud/bitbucket/deprecation-notice-collaborator-role/).**\n\n**When you move your administration from Bitbucket Cloud to admin.atlassian.com, the following fields on\n`workspace_membership` will no longer be present: `last_accessed` and `added_on`. See the\n[deprecation announcement](/cloud/bitbucket/announcement-breaking-change-workspace-membership/).**\n\nResults may be further [filtered](/cloud/bitbucket/rest/intro/#filtering) by\npermission by adding the following query string parameters:\n\n* `q=permission=\"owner\"`" }, "response": [] }, { "name": "List all repository permissions for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/permissions/repositories", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nName of a response property sort the result by as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#sorting-query-results).\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns an object for each repository permission for all of a\nworkspace's repositories.\n\nPermissions returned are effective permissions: the highest level of\npermission the user has. This does not distinguish between direct and\nindirect (group) privileges.\n\nOnly users with admin permission for the team may access this resource.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`\n\nResults may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering)\nby repository, user, or permission by adding the following query string\nparameters:\n\n* `q=repository.name=\"geordi\"` or `q=permission>\"read\"`\n* `sort=user.display_name`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`." }, "response": [] }, { "name": "List a repository permissions for a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/permissions/repositories/:repo_slug", "query": [ { "key": "q", "value": "{{q}}", "disabled": true, "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)." }, { "key": "sort", "value": "{{sort}}", "disabled": true, "description": "\nName of a response property sort the result by as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#sorting-query-results).\n" } ], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns an object for the repository permission of each user in the\nrequested repository.\n\nPermissions returned are effective permissions: the highest level of\npermission the user has. This does not distinguish between direct and\nindirect (group) privileges.\n\nOnly users with admin permission for the repository may access this resource.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`\n\nResults may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering)\nby user, or permission by adding the following query string parameters:\n\n* `q=permission>\"read\"`\n* `sort=user.display_name`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`." }, "response": [] }, { "name": "List projects in a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/projects", "query": [], "variable": [] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Returns the list of projects in this workspace." }, "response": [] } ] }, { "name": "Other operations", "item": [ { "name": "Get a commit application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve an [application property](/cloud/bitbucket/application-properties/) value stored against a commit." }, "response": [] }, { "name": "Update a commit application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Update an [application property](/cloud/bitbucket/application-properties/) value stored against a commit.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a commit application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/commit/:commit/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "commit", "value": "{{commit}}", "description": "The commit.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete an [application property](/cloud/bitbucket/application-properties/) value stored against a commit." }, "response": [] }, { "name": "Get a repository application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve an [application property](/cloud/bitbucket/application-properties/) value stored against a repository." }, "response": [] }, { "name": "Update a repository application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Update an [application property](/cloud/bitbucket/application-properties/) value stored against a repository.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a repository application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete an [application property](/cloud/bitbucket/application-properties/) value stored against a repository." }, "response": [] }, { "name": "Get a pull request application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pullrequest_id/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pullrequest_id", "value": "{{pullrequest_id}}", "description": "The pull request ID.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve an [application property](/cloud/bitbucket/application-properties/) value stored against a pull request." }, "response": [] }, { "name": "Update a pull request application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pullrequest_id/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pullrequest_id", "value": "{{pullrequest_id}}", "description": "The pull request ID.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Update an [application property](/cloud/bitbucket/application-properties/) value stored against a pull request.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a pull request application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}repositories/:workspace/:repo_slug/pullrequests/:pullrequest_id/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "disabled": false }, { "key": "repo_slug", "value": "{{repo_slug}}", "description": "The repository.", "disabled": false }, { "key": "pullrequest_id", "value": "{{pullrequest_id}}", "description": "The pull request ID.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete an [application property](/cloud/bitbucket/application-properties/) value stored against a pull request." }, "response": [] }, { "name": "Search for code in a team's repositories", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}teams/:username/search/code", "query": [ { "key": "search_query", "value": "{{search_query}}", "disabled": false, "description": "The search query" }, { "key": "page", "value": "{{page}}", "disabled": true, "description": "Which page of the search results to retrieve" }, { "key": "pagelen", "value": "{{pagelen}}", "disabled": true, "description": "How many search results to retrieve per page" } ], "variable": [ { "key": "username", "value": "{{username}}", "description": "The account to search in; either the username or the UUID in curly braces", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Search for code in the repositories of the specified team.\n\nNote that searches can match in the file's text (`content_matches`),\nthe path (`path_matches`), or both.\n\nYou can use the same syntax for the search query as in the UI.\nE.g. to search for \"foo\" only within the repository \"demo\",\nuse the query parameter `search_query=foo+repo:demo`.\n\nSimilar to other APIs, you can request more fields using a\n`fields` query parameter. E.g. to get some more information about\nthe repository of matched files, use the query parameter\n`search_query=foo&fields=%2Bvalues.file.commit.repository`\n(the `%2B` is a URL-encoded `+`).\n\nTry `fields=%2Bvalues.*.*.*.*` to get an idea what's possible.\n" }, "response": [] }, { "name": "Get a user application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "selected_user", "value": "{{selected_user}}", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Retrieve an [application property](/cloud/bitbucket/application-properties/) value stored against a user." }, "response": [] }, { "name": "Update a user application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "selected_user", "value": "{{selected_user}}", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "PUT", "header": [ { "description": "", "disabled": false, "key": "Content-Type", "value": "application/json" } ], "description": "Update an [application property](/cloud/bitbucket/application-properties/) value stored against a user.", "body": { "mode": "raw", "raw": "" } }, "response": [] }, { "name": "Delete a user application property", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/properties/:app_key/:property_name", "query": [], "variable": [ { "key": "selected_user", "value": "{{selected_user}}", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "disabled": false }, { "key": "app_key", "value": "{{app_key}}", "description": "The key of the Connect app.", "disabled": false }, { "key": "property_name", "value": "{{property_name}}", "description": "The name of the property.", "disabled": false } ] }, "method": "DELETE", "header": [], "description": "Delete an [application property](/cloud/bitbucket/application-properties/) value stored against a user." }, "response": [] }, { "name": "Search for code in a user's repositories", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}users/:selected_user/search/code", "query": [ { "key": "search_query", "value": "{{search_query}}", "disabled": false, "description": "The search query" }, { "key": "page", "value": "{{page}}", "disabled": true, "description": "Which page of the search results to retrieve" }, { "key": "pagelen", "value": "{{pagelen}}", "disabled": true, "description": "How many search results to retrieve per page" } ], "variable": [ { "key": "selected_user", "value": "{{selected_user}}", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Search for code in the repositories of the specified user.\n\nNote that searches can match in the file's text (`content_matches`),\nthe path (`path_matches`), or both.\n\nYou can use the same syntax for the search query as in the UI.\nE.g. to search for \"foo\" only within the repository \"demo\",\nuse the query parameter `search_query=foo+repo:demo`.\n\nSimilar to other APIs, you can request more fields using a\n`fields` query parameter. E.g. to get some more information about\nthe repository of matched files, use the query parameter\n`search_query=foo&fields=%2Bvalues.file.commit.repository`\n(the `%2B` is a URL-encoded `+`).\n" }, "response": [] }, { "name": "Search for code in a workspace", "request": { "url": { "protocol": "{{protocol}}", "host": "{{host}}", "path": "{{basePath}}workspaces/:workspace/search/code", "query": [ { "key": "search_query", "value": "{{search_query}}", "disabled": false, "description": "The search query" }, { "key": "page", "value": "{{page}}", "disabled": true, "description": "Which page of the search results to retrieve" }, { "key": "pagelen", "value": "{{pagelen}}", "disabled": true, "description": "How many search results to retrieve per page" } ], "variable": [ { "key": "workspace", "value": "{{workspace}}", "description": "The workspace to search in; either the slug or the UUID in curly braces", "disabled": false } ] }, "method": "GET", "header": [ { "description": "", "disabled": false, "key": "Accept", "value": "application/json" } ], "description": "Search for code in the repositories of the specified workspace.\n\nNote that searches can match in the file's text (`content_matches`),\nthe path (`path_matches`), or both.\n\nYou can use the same syntax for the search query as in the UI.\nE.g. to search for \"foo\" only within the repository \"demo\",\nuse the query parameter `search_query=foo+repo:demo`.\n\nSimilar to other APIs, you can request more fields using a\n`fields` query parameter. E.g. to get some more information about\nthe repository of matched files, use the query parameter\n`search_query=foo&fields=%2Bvalues.file.commit.repository`\n(the `%2B` is a URL-encoded `+`).\n\nTry `fields=%2Bvalues.*.*.*.*` to get an idea what's possible.\n" }, "response": [] } ] } ], "variable": [ { "key": "protocol", "name": "Protocol", "description": "The HTTP Protocol that should be used for this REST API.", "type": "string", "value": "https" }, { "key": "host", "name": "Host", "description": "The HTTP host that should be used for this REST API.", "type": "string", "value": "api.bitbucket.org" }, { "key": "basePath", "name": "Base Path", "description": "The path, after the host, of the base of the REST API.", "type": "string", "value": "2.0/" } ] }