Bitbucket

Bitbucket API

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…

Developer tools#openapi#developer-tools#collaboration

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

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.

Endpoints 303

Addon

  • PUTUpdate an installed app/addonUpdates the application installation for the user. This endpoint is intended to be used by Bitbucket Connect apps and only supports JWT authentication -- that…
  • DELETEDelete an app/addonDeletes the application for the user. This endpoint is intended to be used by Bitbucket Connect apps and only supports JWT authentication -- that is how…
  • GETList linkers for an app/addon/linkersGets a list of all linkers for the authenticated application.
  • GETGet a linker for an app/addon/linkers/:linker_keyGets a linker specified by linker_key for the authenticated application.
  • GETList linker values for a linker/addon/linkers/:linker_key/valuesGets a list of all linker values for the specified linker of the authenticated application. A linker value lets applications supply values to modify its…
  • PUTUpdate a linker value/addon/linkers/:linker_key/valuesBulk update linker values for the specified linker of the authenticated application. A linker value lets applications supply values to modify its regular…
  • POSTCreate a linker value/addon/linkers/:linker_key/valuesCreates a linker value for the specified linker of authenticated application. A linker value lets applications supply values to modify its regular expression.…
  • DELETEDelete all linker values/addon/linkers/:linker_key/valuesDelete all linker values for the specified linker of the authenticated application.
  • GETGet a linker value/addon/linkers/:linker_key/values/:value_idGet a single linker value of the authenticated application.
  • DELETEDelete a linker value/addon/linkers/:linker_key/values/:value_idDelete a single linker value of the authenticated application.

Branch restrictions

  • GETList branch restrictions/repositories/:workspace/:repo_slug/branch-restrictions?kind=string&pattern=stringReturns a paginated list of all branch restrictions on the repository.
  • POSTCreate a branch restriction rule/repositories/:workspace/:repo_slug/branch-restrictionsCreates a new branch restriction rule for a repository. kind describes what will be restricted. Allowed values include: push, force, delete and…
  • GETGet a branch restriction rule/repositories/:workspace/:repo_slug/branch-restrictions/:idReturns a specific branch restriction rule.
  • PUTUpdate a branch restriction rule/repositories/:workspace/:repo_slug/branch-restrictions/:idUpdates an existing branch restriction rule. Fields not present in the request body are ignored. See POST for details.
  • DELETEDelete a branch restriction rule/repositories/:workspace/:repo_slug/branch-restrictions/:idDeletes an existing branch restriction rule.

Branching model

  • GETGet the branching model for a repository/repositories/:workspace/:repo_slug/branching-modelReturn the branching model as applied to the repository. This view is read-only. The branching model settings can be changed using the settings API. The…
  • GETGet the branching model config for a repository/repositories/:workspace/:repo_slug/branching-model/settingsReturn the branching model configuration for a repository. The returned object: 1. Always has a development property for the development branch. 2. Always a…
  • PUTUpdate the branching model config for a repository/repositories/:workspace/:repo_slug/branching-model/settingsUpdate the branching model configuration for a repository. The development branch can be configured to a specific branch or to track the main branch. When set…
  • GETGet the effective, or currently applied, branching model for a repository/repositories/:workspace/:repo_slug/effective-branching-model
  • GETGet the branching model for a project/workspaces/:workspace/projects/:project_key/branching-modelReturn the branching model set at the project level. This view is read-only. The branching model settings can be changed using the settings API. The returned…
  • GETGet the branching model config for a project/workspaces/:workspace/projects/:project_key/branching-model/settingsReturn the branching model configuration for a project. The returned object: 1. Always has a development property for the development branch. 2. Always a…
  • PUTUpdate the branching model config for a project/workspaces/:workspace/projects/:project_key/branching-model/settingsUpdate the branching model configuration for a project. The development branch can be configured to a specific branch or to track the main branch. Any branch…

Commit statuses

  • GETList commit statuses for a commit/repositories/:workspace/:repo_slug/commit/:commit/statuses?q=string&sort=stringReturns all statuses (e.g. build results) for a specific commit.
  • POSTCreate a build status for a commit/repositories/:workspace/:repo_slug/commit/:commit/statuses/buildCreates a new build status against the specified commit. If the specified key already exists, the existing status object will be overwritten. Example: curl…
  • GETGet a build status for a commit/repositories/:workspace/:repo_slug/commit/:commit/statuses/build/:keyReturns the specified build status for a commit.
  • PUTUpdate a build status for a commit/repositories/:workspace/:repo_slug/commit/:commit/statuses/build/:keyUsed to update the current status of a build status object on the specific commit. This operation can also be used to change other properties of the build…

Commits

  • GETGet a commit/repositories/:workspace/:repo_slug/commit/:commitReturns the specified commit. Example: $ curl https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a1 { "rendered": { "message": { "raw":…
  • POSTApprove a commit/repositories/:workspace/:repo_slug/commit/:commit/approveApprove the specified commit as the authenticated user. This operation is only available to users that have explicit access to the repository. In contrast,…
  • DELETEUnapprove a commit/repositories/:workspace/:repo_slug/commit/:commit/approveRedact the authenticated user's approval of the specified commit. This operation is only available to users that have explicit access to the repository. In…
  • GETList a commit's comments/repositories/:workspace/:repo_slug/commit/:commit/comments?q=string&sort=stringReturns the commit's comments. This includes both global and inline comments. The default sorting is oldest to newest and can be overridden with the sort…
  • POSTCreate comment for a commit/repositories/:workspace/:repo_slug/commit/:commit/commentsCreates new comment on the specified commit. To post a reply to an existing comment, include the parent.id field: $ curl…
  • GETGet a commit comment/repositories/:workspace/:repo_slug/commit/:commit/comments/:comment_idReturns the specified commit comment.
  • PUTUpdate a commit comment/repositories/:workspace/:repo_slug/commit/:commit/comments/:comment_idUsed to update the contents of a comment. Only the content of the comment can be updated. $ curl…
  • DELETEDelete a commit comment/repositories/:workspace/:repo_slug/commit/:commit/comments/:comment_idDeletes the specified commit comment. Note that deleting comments that have visible replies that point to them will not really delete the resource. This is to…
  • GETList commits/repositories/:workspace/:repo_slug/commitsThese are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of git log. Like these tools, the…
  • POSTList commits with include/exclude/repositories/:workspace/:repo_slug/commitsIdentical to GET /repositories/{workspace}/{repo_slug}/commits, except that POST allows clients to place the include and exclude parameters in the request…
  • GETList commits for revision/repositories/:workspace/:repo_slug/commits/:revisionThese are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of git log. Like these tools, the…
  • POSTList commits for revision using include/exclude/repositories/:workspace/:repo_slug/commits/:revisionIdentical to GET /repositories/{workspace}/{repo_slug}/commits/{revision}, except that POST allows clients to place the include and exclude parameters in the…
  • GETCompare two commits/repositories/:workspace/:repo_slug/diff/:spec?context=0&path=string&ignore_whitespace=true&binary=true&renames=true&merge=true&topic=trueProduces a raw git-style diff. Single commit spec If the spec argument to this API is a single commit, the diff is produced against the first parent of the…
  • GETCompare two commit diff stats/repositories/:workspace/:repo_slug/diffstat/:spec?ignore_whitespace=true&merge=true&path=string&renames=true&topic=trueProduces a response in JSON format with a record for every path modified, including information on the type of the change and the number of lines added and…
  • GETGet the common ancestor between two commits/repositories/:workspace/:repo_slug/merge-base/:revspecReturns the best common ancestor between two commits, specified in a revspec of 2 commits (e.g. 3a8b42..9ff173). If more than one best common ancestor exists,…
  • GETGet a patch for two commits/repositories/:workspace/:repo_slug/patch/:specProduces a raw patch for a single commit (diffed against its first parent), or a patch-series for a revspec of 2 commits (e.g. 3a8b42..9ff173 where the first…

Deployments

  • GETList repository deploy keys/repositories/:workspace/:repo_slug/deploy-keysReturns all deploy-keys belonging to a repository. Example: $ curl -H "Authorization <auth header>" \…
  • POSTAdd a repository deploy key/repositories/:workspace/:repo_slug/deploy-keysCreate a new deploy key in a repository. Note: If authenticating a deploy key with an OAuth consumer, any changes to the OAuth consumer will subsequently…
  • GETGet a repository deploy key/repositories/:workspace/:repo_slug/deploy-keys/:key_idReturns the deploy key belonging to a specific key. Example: $ curl -H "Authorization <auth header>" \…
  • PUTUpdate a repository deploy key/repositories/:workspace/:repo_slug/deploy-keys/:key_idCreate a new deploy key in a repository. The same key needs to be passed in but the comment and label can change. Example: $ curl -XPUT \ -H "Authorization…
  • DELETEDelete a repository deploy key/repositories/:workspace/:repo_slug/deploy-keys/:key_idThis deletes a deploy key from a repository. Example: $ curl -XDELETE \ -H "Authorization <auth header>" \…
  • GETList deployments/repositories/:workspace/:repo_slug/deployments/Find deployments
  • GETGet a deployment/repositories/:workspace/:repo_slug/deployments/:deployment_uuidRetrieve a deployment
  • GETList environments/repositories/:workspace/:repo_slug/environments/Find environments
  • POSTCreate an environment/repositories/:workspace/:repo_slug/environments/Create an environment.
  • GETGet an environment/repositories/:workspace/:repo_slug/environments/:environment_uuidRetrieve an environment
  • DELETEDelete an environment/repositories/:workspace/:repo_slug/environments/:environment_uuidDelete an environment
  • POSTUpdate an environment/repositories/:workspace/:repo_slug/environments/:environment_uuid/changes/Update an environment
  • GETList project deploy keys/workspaces/:workspace/projects/:project_key/deploy-keysReturns all deploy keys belonging to a project. Example: $ curl -H "Authorization <auth header>" \…
  • POSTCreate a project deploy key/workspaces/:workspace/projects/:project_key/deploy-keysCreate a new deploy key in a project. Example: $ curl -XPOST \ -H "Authorization <auth header>" \ -H "Content-type: application/json" \…
  • GETGet a project deploy key/workspaces/:workspace/projects/:project_key/deploy-keys/:key_idReturns the deploy key belonging to a specific key ID. Example: $ curl -H "Authorization <auth header>" \…
  • DELETEDelete a deploy key from a project/workspaces/:workspace/projects/:project_key/deploy-keys/:key_idThis deletes a deploy key from a project. Example: $ curl -XDELETE \ -H "Authorization <auth header>" \…

Downloads

  • GETList download artifacts/repositories/:workspace/:repo_slug/downloadsReturns a list of download links associated with the repository.
  • POSTUpload a download artifact/repositories/:workspace/:repo_slug/downloadsUpload new download artifacts. To upload files, perform a multipart/form-data POST containing one or more files fields: $ echo Hello World > hello.txt $ curl…
  • GETGet a download artifact link/repositories/:workspace/:repo_slug/downloads/:filenameReturn a redirect to the contents of a download artifact. This endpoint returns the actual file contents and not the artifact's metadata. $ curl -s -L…
  • DELETEDelete a download artifact/repositories/:workspace/:repo_slug/downloads/:filenameDeletes the specified download artifact from the repository.

Issue tracker

  • GETList components/repositories/:workspace/:repo_slug/componentsReturns the components that have been defined in the issue tracker. This resource is only available on repositories that have the issue tracker enabled.
  • GETGet a component for issues/repositories/:workspace/:repo_slug/components/:component_idReturns the specified issue tracker component object.
  • GETList issues/repositories/:workspace/:repo_slug/issuesReturns the issues in the issue tracker.
  • POSTCreate an issue/repositories/:workspace/:repo_slug/issuesCreates a new issue. This call requires authentication. Private repositories or private issue trackers require the caller to authenticate with an account that…
  • POSTExport issues/repositories/:workspace/:repo_slug/issues/exportA POST request to this endpoint initiates a new background celery task that archives the repo's issues. For example, you can run: curl -u <username> -X POST…
  • GETCheck issue export status/repositories/:workspace/:repo_slug/issues/export/:repo_name-issues-:task_id.zipThis endpoint is used to poll for the progress of an issue export job and return the zip file after the job is complete. As long as the job is running, this…
  • GETCheck issue import status/repositories/:workspace/:repo_slug/issues/importWhen using GET, this endpoint reports the status of the current import task. Request example: $ curl -u <username> -X GET…
  • POSTImport issues/repositories/:workspace/:repo_slug/issues/importA POST request to this endpoint will import the zip file given by the archive parameter into the repository. All existing issues will be deleted and replaced…
  • GETGet an issue/repositories/:workspace/:repo_slug/issues/:issue_idReturns the specified issue.
  • PUTUpdate an issue/repositories/:workspace/:repo_slug/issues/:issue_idModifies the issue. $ curl https://api.bitbucket.org/2.0/repostories/evzijst/dogslow/issues/123 \ -u evzijst -s -X PUT -H 'Content-Type: application/json' \…
  • DELETEDelete an issue/repositories/:workspace/:repo_slug/issues/:issue_idDeletes the specified issue. This requires write access to the repository.
  • GETList attachments for an issue/repositories/:workspace/:repo_slug/issues/:issue_id/attachmentsReturns all attachments for this issue. This returns the files' meta data. This does not return the files' actual contents. The files are always ordered by…
  • POSTUpload an attachment to an issue/repositories/:workspace/:repo_slug/issues/:issue_id/attachmentsUpload new issue attachments. To upload files, perform a multipart/form-data POST containing one or more file fields. When a file is uploaded with the same…
  • GETGet attachment for an issue/repositories/:workspace/:repo_slug/issues/:issue_id/attachments/:pathReturns the contents of the specified file attachment. Note that this endpoint does not return a JSON response, but instead returns a redirect pointing to the…
  • DELETEDelete an attachment for an issue/repositories/:workspace/:repo_slug/issues/:issue_id/attachments/:pathDeletes an attachment.
  • GETList changes on an issue/repositories/:workspace/:repo_slug/issues/:issue_id/changes?q=string&sort=stringReturns the list of all changes that have been made to the specified issue. Changes are returned in chronological order with the oldest change first. Each…
  • POSTModify the state of an issue/repositories/:workspace/:repo_slug/issues/:issue_id/changesMakes a change to the specified issue. For example, to change an issue's state and assignee, create a new change object that modifies these fields: curl…
  • GETGet issue change object/repositories/:workspace/:repo_slug/issues/:issue_id/changes/:change_idReturns the specified issue change object. This resource is only available on repositories that have the issue tracker enabled.
  • GETList comments on an issue/repositories/:workspace/:repo_slug/issues/:issue_id/comments?q=stringReturns a paginated list of all comments that were made on the specified issue. The default sorting is oldest to newest and can be overridden with the sort…
  • POSTCreate a comment on an issue/repositories/:workspace/:repo_slug/issues/:issue_id/commentsCreates a new issue comment. $ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/issues/42/comments/ \ -X POST -u evzijst \ -H 'Content-Type:…
  • GETGet a comment on an issue/repositories/:workspace/:repo_slug/issues/:issue_id/comments/:comment_idReturns the specified issue comment object.
  • PUTUpdate a comment on an issue/repositories/:workspace/:repo_slug/issues/:issue_id/comments/:comment_idUpdates the content of the specified issue comment. Note that only the content.raw field can be modified. $ curl…
  • DELETEDelete a comment on an issue/repositories/:workspace/:repo_slug/issues/:issue_id/comments/:comment_idDeletes the specified comment.
  • GETCheck if current user voted for an issue/repositories/:workspace/:repo_slug/issues/:issue_id/voteCheck whether the authenticated user has voted for this issue. A 204 status code indicates that the user has voted, while a 404 implies they haven't.
  • PUTVote for an issue/repositories/:workspace/:repo_slug/issues/:issue_id/voteVote for this issue. To cast your vote, do an empty PUT. The 204 status code indicates that the operation was successful.
  • DELETERemove vote for an issue/repositories/:workspace/:repo_slug/issues/:issue_id/voteRetract your vote.
  • GETCheck if current user is watching a issue/repositories/:workspace/:repo_slug/issues/:issue_id/watchIndicated whether or not the authenticated user is watching this issue.
  • PUTWatch an issue/repositories/:workspace/:repo_slug/issues/:issue_id/watchStart watching this issue. To start watching this issue, do an empty PUT. The 204 status code indicates that the operation was successful.
  • DELETEStop watching an issue/repositories/:workspace/:repo_slug/issues/:issue_id/watchStop watching this issue.
  • GETList milestones/repositories/:workspace/:repo_slug/milestonesReturns the milestones that have been defined in the issue tracker. This resource is only available on repositories that have the issue tracker enabled.
  • GETGet a milestone/repositories/:workspace/:repo_slug/milestones/:milestone_idReturns the specified issue tracker milestone object.
  • GETList defined versions for issues/repositories/:workspace/:repo_slug/versionsReturns the versions that have been defined in the issue tracker. This resource is only available on repositories that have the issue tracker enabled.
  • GETGet a defined version for issues/repositories/:workspace/:repo_slug/versions/:version_idReturns the specified issue tracker version object.

Pipelines

  • GETList variables for an environment/repositories/:workspace/:repo_slug/deployments_config/environments/:environment_uuid/variablesFind deployment environment level variables.
  • POSTCreate a variable for an environment/repositories/:workspace/:repo_slug/deployments_config/environments/:environment_uuid/variablesCreate a deployment environment level variable.
  • PUTUpdate a variable for an environment/repositories/:workspace/:repo_slug/deployments_config/environments/:environment_uuid/variables/:variable_uuidUpdate a deployment environment level variable.
  • DELETEDelete a variable for an environment/repositories/:workspace/:repo_slug/deployments_config/environments/:environment_uuid/variables/:variable_uuidDelete a deployment environment level variable.
  • DELETEDelete caches/repositories/:workspace/:repo_slug/pipelines-config/caches?name=stringDelete repository cache versions by name.
  • GETList caches/repositories/:workspace/:repo_slug/pipelines-config/caches/Retrieve the repository pipelines caches.
  • DELETEDelete a cache/repositories/:workspace/:repo_slug/pipelines-config/caches/:cache_uuidDelete a repository cache.
  • GETGet cache content URI/repositories/:workspace/:repo_slug/pipelines-config/caches/:cache_uuid/content-uriRetrieve the URI of the content of the specified cache.
  • GETList pipelines/repositories/:workspace/:repo_slug/pipelines/Find pipelines
  • POSTRun a pipeline/repositories/:workspace/:repo_slug/pipelines/Endpoint to create and initiate a pipeline. There are a couple of different options to initiate a pipeline, where the payload of the request will determine…
  • GETGet a pipeline/repositories/:workspace/:repo_slug/pipelines/:pipeline_uuidRetrieve a specified pipeline
  • GETList steps for a pipeline/repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/Find steps for the given pipeline.
  • GETGet a step of a pipeline/repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuidRetrieve a given step of a pipeline.
  • GETGet log file for a step/repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid/logRetrieve the log file for a given step of a pipeline. This endpoint supports (and encourages!) the use of HTTP Range requests to deal with potentially very…
  • GETGet the logs for the build container or a service container for a given step of a pipeline./repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid/logs/:log_uuidRetrieve the log file for a build container or service container. This endpoint supports (and encourages!) the use of HTTP Range requests to deal with…
  • GETGet a summary of test reports for a given step of a pipeline./repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid/test_reports
  • GETGet test cases for a given step of a pipeline./repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid/test_reports/test_cases
  • GETGet test case reasons (output) for a given test case in a step of a pipeline./repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/steps/:step_uuid/test_reports/test_cases/:test_case_uuid/test_case_reasons
  • POSTStop a pipeline/repositories/:workspace/:repo_slug/pipelines/:pipeline_uuid/stopPipelineSignal the stop of a pipeline and all of its steps that not have completed yet.
  • GETGet configuration/repositories/:workspace/:repo_slug/pipelines_configRetrieve the repository pipelines configuration.
  • PUTUpdate configuration/repositories/:workspace/:repo_slug/pipelines_configUpdate the pipelines configuration for a repository.
  • PUTUpdate the next build number/repositories/:workspace/:repo_slug/pipelines_config/build_numberUpdate 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…
  • GETList schedules/repositories/:workspace/:repo_slug/pipelines_config/schedules/Retrieve the configured schedules for the given repository.
  • POSTCreate a schedule/repositories/:workspace/:repo_slug/pipelines_config/schedules/Create a schedule for the given repository.
  • GETGet a schedule/repositories/:workspace/:repo_slug/pipelines_config/schedules/:schedule_uuidRetrieve a schedule by its UUID.
  • PUTUpdate a schedule/repositories/:workspace/:repo_slug/pipelines_config/schedules/:schedule_uuidUpdate a schedule.
  • DELETEDelete a schedule/repositories/:workspace/:repo_slug/pipelines_config/schedules/:schedule_uuidDelete a schedule.
  • GETList executions of a schedule/repositories/:workspace/:repo_slug/pipelines_config/schedules/:schedule_uuid/executions/Retrieve the executions of a given schedule.
  • GETGet SSH key pair/repositories/:workspace/:repo_slug/pipelines_config/ssh/key_pairRetrieve 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.
  • PUTUpdate SSH key pair/repositories/:workspace/:repo_slug/pipelines_config/ssh/key_pairCreate or update the repository SSH key pair. The private key will be set as a default SSH identity in your build container.
  • DELETEDelete SSH key pair/repositories/:workspace/:repo_slug/pipelines_config/ssh/key_pairDelete the repository SSH key pair.
  • GETList known hosts/repositories/:workspace/:repo_slug/pipelines_config/ssh/known_hosts/Find repository level known hosts.
  • POSTCreate a known host/repositories/:workspace/:repo_slug/pipelines_config/ssh/known_hosts/Create a repository level known host.
  • GETGet a known host/repositories/:workspace/:repo_slug/pipelines_config/ssh/known_hosts/:known_host_uuidRetrieve a repository level known host.
  • PUTUpdate a known host/repositories/:workspace/:repo_slug/pipelines_config/ssh/known_hosts/:known_host_uuidUpdate a repository level known host.
  • DELETEDelete a known host/repositories/:workspace/:repo_slug/pipelines_config/ssh/known_hosts/:known_host_uuidDelete a repository level known host.
  • GETList variables for a repository/repositories/:workspace/:repo_slug/pipelines_config/variables/Find repository level variables.
  • POSTCreate a variable for a repository/repositories/:workspace/:repo_slug/pipelines_config/variables/Create a repository level variable.
  • GETGet a variable for a repository/repositories/:workspace/:repo_slug/pipelines_config/variables/:variable_uuidRetrieve a repository level variable.
  • PUTUpdate a variable for a repository/repositories/:workspace/:repo_slug/pipelines_config/variables/:variable_uuidUpdate a repository level variable.
  • DELETEDelete a variable for a repository/repositories/:workspace/:repo_slug/pipelines_config/variables/:variable_uuidDelete a repository level variable.
  • GETList variables for an account/teams/:username/pipelines_config/variables/Deprecated. Find account level variables. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the…
  • POSTCreate a variable for a user/teams/:username/pipelines_config/variables/Deprecated. Create an account level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the…
  • GETGet a variable for a team/teams/:username/pipelines_config/variables/:variable_uuidDeprecated. Retrieve a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the…
  • PUTUpdate a variable for a team/teams/:username/pipelines_config/variables/:variable_uuidDeprecated. Update a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the…
  • DELETEDelete a variable for a team/teams/:username/pipelines_config/variables/:variable_uuidDeprecated. Delete a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the…
  • GETList variables for a user/users/:selected_user/pipelines_config/variables/Deprecated. Find user level variables. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the…
  • POSTCreate a variable for a user/users/:selected_user/pipelines_config/variables/Deprecated. Create a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the…
  • GETGet a variable for a user/users/:selected_user/pipelines_config/variables/:variable_uuidDeprecated. Retrieve a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the…
  • PUTUpdate a variable for a user/users/:selected_user/pipelines_config/variables/:variable_uuidDeprecated. Update a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the…
  • DELETEDelete a variable for a user/users/:selected_user/pipelines_config/variables/:variable_uuidDeprecated. Delete an account level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the…
  • GETGet OpenID configuration for OIDC in Pipelines/workspaces/:workspace/pipelines-config/identity/oidc/.well-known/openid-configurationThis is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/
  • GETGet keys for OIDC in Pipelines/workspaces/:workspace/pipelines-config/identity/oidc/keys.jsonThis is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/
  • GETList variables for a workspace/workspaces/:workspace/pipelines-config/variablesFind workspace level variables.
  • POSTCreate a variable for a workspace/workspaces/:workspace/pipelines-config/variablesCreate a workspace level variable.
  • GETGet variable for a workspace/workspaces/:workspace/pipelines-config/variables/:variable_uuidRetrieve a workspace level variable.
  • PUTUpdate variable for a workspace/workspaces/:workspace/pipelines-config/variables/:variable_uuidUpdate a workspace level variable.
  • DELETEDelete a variable for a workspace/workspaces/:workspace/pipelines-config/variables/:variable_uuidDelete a workspace level variable.

Projects

  • POSTCreate a project in a workspace/workspaces/:workspace/projectsCreates a new project. Note that the avatar has to be embedded as either a data-url or a URL to an external image as shown in the examples below: $ body=$(cat…
  • GETGet a project for a workspace/workspaces/:workspace/projects/:project_keyReturns the requested project.
  • PUTUpdate a project for a workspace/workspaces/:workspace/projects/:project_keySince this endpoint can be used to both update and to create a project, the request body depends on the intent. Creation See the POST documentation for the…
  • DELETEDelete a project for a workspace/workspaces/:workspace/projects/:project_keyDeletes this project. This is an irreversible operation. You cannot delete a project that still contains repositories. To delete the project, delete or…
  • GETList the default reviewers in a project/workspaces/:workspace/projects/:project_key/default-reviewersReturn a list of all default reviewers for a project. This is a list of users that will be added as default reviewers to pull requests for any repository…
  • GETGet a default reviewer/workspaces/:workspace/projects/:project_key/default-reviewers/:selected_userReturns the specified default reviewer. Example: $ curl https://api.bitbucket.org/2.0/.../default-reviewers/%7Bf0e0e8e9-66c1-4b85-a784-44a9eb9ef1a6%7D {…
  • PUTAdd the specific user as a default reviewer for the project/workspaces/:workspace/projects/:project_key/default-reviewers/:selected_userAdds the specified user to the project's list of default reviewers. The method is idempotent. Accepts an optional body containing the uuid of the user to be…
  • DELETERemove the specific user from the project's default reviewers/workspaces/:workspace/projects/:project_key/default-reviewers/:selected_userRemoves a default reviewer from the project. Example: $ curl https://api.bitbucket.org/2.0/.../default-reviewers/%7Bf0e0e8e9-66c1-4b85-a784-44a9eb9ef1a6%7D…

Pullrequests

  • GETList pull requests for a user/pullrequests/:selected_user?state=OPENReturns all pull requests authored by the specified user. By default only open pull requests are returned. This can be controlled using the state query…
  • GETList pull requests that contain a commit/repositories/:workspace/:repo_slug/commit/:commit/pullrequests?page=1&pagelen=30Returns 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…
  • GETList default reviewers/repositories/:workspace/:repo_slug/default-reviewersReturns the repository's default reviewers. These are the users that are automatically added as reviewers on every new pull request that is created. To obtain…
  • GETGet a default reviewer/repositories/:workspace/:repo_slug/default-reviewers/:target_usernameReturns the specified reviewer. This can be used to test whether a user is among the repository's default reviewers list. A 404 indicates that that specified…
  • PUTAdd a user to the default reviewers/repositories/:workspace/:repo_slug/default-reviewers/:target_usernameAdds the specified user to the repository's list of default reviewers. This method is idempotent. Adding a user a second time has no effect.
  • DELETERemove a user from the default reviewers/repositories/:workspace/:repo_slug/default-reviewers/:target_usernameRemoves a default reviewer from the repository.
  • GETList effective default reviewers/repositories/:workspace/:repo_slug/effective-default-reviewersReturns the repository's effective default reviewers. This includes both default reviewers defined at the repository level as well as those inherited from its…
  • GETList pull requests/repositories/:workspace/:repo_slug/pullrequests?state=OPENReturns all pull requests on the specified repository. By default only open pull requests are returned. This can be controlled using the state query…
  • POSTCreate a pull request/repositories/:workspace/:repo_slug/pullrequestsCreates a new pull request where the destination repository is this repository and the author is the authenticated user. The minimum required fields to create…
  • GETList a pull request activity log/repositories/:workspace/:repo_slug/pullrequests/activityReturns a paginated list of the pull request's activity log. This handler serves both a v20 and internal endpoint. The v20 endpoint returns reviewer comments,…
  • GETGet a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_idReturns the specified pull request.
  • PUTUpdate a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_idMutates the specified pull request. This can be used to change the pull request's branches or description. Only open pull requests can be mutated.
  • GETList a pull request activity log/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/activityReturns a paginated list of the pull request's activity log. This handler serves both a v20 and internal endpoint. The v20 endpoint returns reviewer comments,…
  • POSTApprove a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/approveApprove the specified pull request as the authenticated user.
  • DELETEUnapprove a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/approveRedact the authenticated user's approval of the specified pull request.
  • GETList comments on a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/commentsReturns a paginated list of the pull request's comments. This includes both global, inline comments and replies. The default sorting is oldest to newest and…
  • POSTCreate a comment on a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/commentsCreates a new pull request comment. Returns the newly created pull request comment.
  • GETGet a comment on a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/comments/:comment_idReturns a specific pull request comment.
  • PUTUpdate a comment on a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/comments/:comment_idUpdates a specific pull request comment.
  • DELETEDelete a comment on a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/comments/:comment_idDeletes a specific pull request comment.
  • GETList commits on a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/commitsReturns a paginated list of the pull request's commits. These are the commits that are being merged into the destination branch when the pull requests gets…
  • POSTDecline a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/declineDeclines the pull request.
  • GETList changes in a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/diffRedirects to the repository diff with the revspec that corresponds to the pull request.
  • GETGet the diff stat for a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/diffstatRedirects to the repository diffstat with the revspec that corresponds to the pull request.
  • POSTMerge a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/merge?async=trueMerges the pull request.
  • GETGet the merge task status for a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/merge/task-status/:task_idWhen merging a pull request takes too long, the client receives a task ID along with a 202 status code. The task ID can be used in a call to this endpoint to…
  • GETGet the patch for a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/patchRedirects to the repository patch with the revspec that corresponds to pull request.
  • POSTRequest changes for a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/request-changes
  • DELETERemove change request for a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/request-changes
  • GETList commit statuses for a pull request/repositories/:workspace/:repo_slug/pullrequests/:pull_request_id/statuses?q=string&sort=stringReturns all statuses (e.g. build results) for the given pull request.

Refs

  • GETList branches and tags/repositories/:workspace/:repo_slug/refs?q=string&sort=stringReturns the branches and tags in the repository. By default, results will be in the order the underlying source control system returns them and identical to…
  • GETList open branches/repositories/:workspace/:repo_slug/refs/branches?q=string&sort=stringReturns a list of all open branches within the specified repository. Results will be in the order the source control manager returns them. $ curl -s…
  • POSTCreate a branch/repositories/:workspace/:repo_slug/refs/branchesCreates a new branch in the specified repository. The payload of the POST should consist of a JSON document that contains the name of the tag and the target…
  • GETGet a branch/repositories/:workspace/:repo_slug/refs/branches/:nameReturns a branch object within the specified repository. $ curl -s https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches/master | jq . {…
  • DELETEDelete a branch/repositories/:workspace/:repo_slug/refs/branches/:nameDelete a branch in the specified repository. The main branch is not allowed to be deleted and will return a 400 response. The branch name should not include…
  • GETList tags/repositories/:workspace/:repo_slug/refs/tags?q=string&sort=stringReturns the tags in the repository. By default, results will be in the order the underlying source control system returns them and identical to the ordering…
  • POSTCreate a tag/repositories/:workspace/:repo_slug/refs/tagsCreates a new tag in the specified repository. The payload of the POST should consist of a JSON document that contains the name of the tag and the target…
  • GETGet a tag/repositories/:workspace/:repo_slug/refs/tags/:nameReturns the specified tag. $ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8 -G | jq . { "name": "3.8", "links": { "commits": {…
  • DELETEDelete a tag/repositories/:workspace/:repo_slug/refs/tags/:nameDelete a tag in the specified repository. The tag name should not include any prefixes (e.g. refs/tags).

Reports

  • GETList reports/repositories/:workspace/:repo_slug/commit/:commit/reportsReturns a paginated list of Reports linked to this commit.
  • GETGet a report/repositories/:workspace/:repo_slug/commit/:commit/reports/:reportIdReturns a single Report matching the provided ID.
  • PUTCreate or update a report/repositories/:workspace/:repo_slug/commit/:commit/reports/:reportIdCreates or updates a report for the specified commit. To upload a report, make sure to generate an ID that is unique across all reports for that commit. If…
  • DELETEDelete a report/repositories/:workspace/:repo_slug/commit/:commit/reports/:reportIdDeletes a single Report matching the provided ID.
  • GETList annotations/repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId/annotationsReturns a paginated list of Annotations for a specified report.
  • POSTBulk create or update annotations/repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId/annotationsBulk upload of annotations. Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a…
  • GETGet an annotation/repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId/annotations/:annotationIdReturns a single Annotation matching the provided ID.
  • PUTCreate or update an annotation/repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId/annotations/:annotationIdCreates or updates an individual annotation for the specified report. Annotations are individual findings that have been identified as part of a report, for…
  • DELETEDelete an annotation/repositories/:workspace/:repo_slug/commit/:commit/reports/:reportId/annotations/:annotationIdDeletes a single Annotation matching the provided ID.

Repositories

  • GETList public repositories/repositories?after=string&role=admin&q=string&sort=stringReturns a paginated list of all public repositories. This endpoint also supports filtering and sorting of the results. See filtering and sorting for more…
  • GETList repositories in a workspace/repositories/:workspace?role=admin&q=string&sort=stringReturns a paginated list of all repositories owned by the specified workspace. The result can be narrowed down based on the authenticated user's role. E.g.…
  • GETGet a repository/repositories/:workspace/:repo_slugReturns the object describing this repository.
  • PUTUpdate a repository/repositories/:workspace/:repo_slugSince this endpoint can be used to both update and to create a repository, the request body depends on the intent. Creation See the POST documentation for the…
  • POSTCreate a repository/repositories/:workspace/:repo_slugCreates a new repository. Note: In order to set the project for the newly created repository, pass in either the project key or the project UUID as part of…
  • DELETEDelete a repository/repositories/:workspace/:repo_slug?redirect_to=stringDeletes the repository. This is an irreversible operation. This does not affect its forks.
  • GETList repository forks/repositories/:workspace/:repo_slug/forks?role=admin&q=string&sort=stringReturns a paginated list of all the forks of the specified repository.
  • POSTFork a repository/repositories/:workspace/:repo_slug/forksCreates a new fork of the specified repository. Forking a repository To create a fork, specify the workspace explicitly as part of the request body: $ curl -X…
  • GETList webhooks for a repository/repositories/:workspace/:repo_slug/hooksReturns a paginated list of webhooks installed on this repository.
  • POSTCreate a webhook for a repository/repositories/:workspace/:repo_slug/hooksCreates a new webhook on the specified repository. Example: $ curl -X POST -u credentials -H 'Content-Type: application/json'…
  • GETGet a webhook for a repository/repositories/:workspace/:repo_slug/hooks/:uidReturns the webhook with the specified id installed on the specified repository.
  • PUTUpdate a webhook for a repository/repositories/:workspace/:repo_slug/hooks/:uidUpdates the specified webhook subscription. The following properties can be mutated: * description * url * active * events
  • DELETEDelete a webhook for a repository/repositories/:workspace/:repo_slug/hooks/:uidDeletes the specified webhook subscription from the given repository.
  • GETRetrieve the inheritance state for repository settings/repositories/:workspace/:repo_slug/override-settings
  • PUTSet the inheritance state for repository settings /repositories/:workspace/:repo_slug/override-settings
  • GETList explicit group permissions for a repository/repositories/:workspace/:repo_slug/permissions-config/groupsReturns a paginated list of explicit group permissions for the given repository. This endpoint does not support BBQL features. Example: $ curl…
  • GETGet an explicit group permission for a repository/repositories/:workspace/:repo_slug/permissions-config/groups/:group_slugReturns the group permission for a given group slug and repository Only users with admin permission for the repository may access this resource. Permissions…
  • PUTUpdate an explicit group permission for a repository/repositories/:workspace/:repo_slug/permissions-config/groups/:group_slugUpdates the group permission if it exists. Only users with admin permission for the repository may access this resource. The only authentication method…
  • DELETEDelete an explicit group permission for a repository/repositories/:workspace/:repo_slug/permissions-config/groups/:group_slugDeletes the repository group permission between the requested repository and group, if one exists. Only users with admin permission for the repository may…
  • GETList explicit user permissions for a repository/repositories/:workspace/:repo_slug/permissions-config/usersReturns a paginated list of explicit user permissions for the given repository. This endpoint does not support BBQL features. Example: $ curl…
  • GETGet an explicit user permission for a repository/repositories/:workspace/:repo_slug/permissions-config/users/:selected_user_idReturns the explicit user permission for a given user and repository. Only users with admin permission for the repository may access this resource.…
  • PUTUpdate an explicit user permission for a repository/repositories/:workspace/:repo_slug/permissions-config/users/:selected_user_idUpdates the explicit user permission for a given user and repository. The selected user must be a member of the workspace, and cannot be the workspace owner.…
  • DELETEDelete an explicit user permission for a repository/repositories/:workspace/:repo_slug/permissions-config/users/:selected_user_idDeletes the repository user permission between the requested repository and user, if one exists. Only users with admin permission for the repository may…
  • GETList repositories watchers/repositories/:workspace/:repo_slug/watchersReturns a paginated list of all the watchers on the specified repository.
  • GETList repository permissions for a user/user/permissions/repositories?q=string&sort=stringReturns an object for each repository the caller has explicit access to and their effective permission — the highest level of permission the caller has. This…

Snippets

  • GETList snippets/snippets?role=ownerReturns all snippets. Like pull requests, repositories and workspaces, the full set of snippets is defined by what the current user has access to. This…
  • POSTCreate a snippet/snippetsCreates a new snippet under the authenticated user's account. Snippets can contain multiple files. Both text and binary files are supported. The simplest way…
  • GETList snippets in a workspace/snippets/:workspace?role=ownerIdentical to /snippets, except that the result is further filtered by the snippet owner and only those that are owned by {workspace} are returned.
  • POSTCreate a snippet for a workspace/snippets/:workspaceIdentical to /snippets, except that the new snippet will be created under the workspace specified in the path parameter {workspace}.
  • GETGet a snippet/snippets/:workspace/:encoded_idRetrieves a single snippet. Snippets support multiple content types: * application/json * multipart/related * multipart/form-data application/json The default…
  • PUTUpdate a snippet/snippets/:workspace/:encoded_idUsed to update a snippet. Use this to add and delete files and to change a snippet's title. To update a snippet, one can either PUT a full snapshot, or only…
  • DELETEDelete a snippet/snippets/:workspace/:encoded_idDeletes a snippet and returns an empty response.
  • GETList comments on a snippet/snippets/:workspace/:encoded_id/commentsUsed to retrieve a paginated list of all comments for a specific snippet. This resource works identical to commit and pull request comments. The default…
  • POSTCreate a comment on a snippet/snippets/:workspace/:encoded_id/commentsCreates a new comment. The only required field in the body is content.raw. To create a threaded reply to an existing comment, include parent.id.
  • GETGet a comment on a snippet/snippets/:workspace/:encoded_id/comments/:comment_idReturns the specific snippet comment.
  • PUTUpdate a comment on a snippet/snippets/:workspace/:encoded_id/comments/:comment_idUpdates a comment. The only required field in the body is content.raw. Comments can only be updated by their author.
  • DELETEDelete a comment on a snippet/snippets/:workspace/:encoded_id/comments/:comment_idDeletes a snippet comment. Comments can only be removed by the comment author, snippet creator, or workspace admin.
  • GETList snippet changes/snippets/:workspace/:encoded_id/commitsReturns the changes (commits) made on this snippet.
  • GETGet a previous snippet change/snippets/:workspace/:encoded_id/commits/:revisionReturns the changes made on this snippet in this commit.
  • GETGet a snippet's raw file at HEAD/snippets/:workspace/:encoded_id/files/:pathConvenience resource for getting to a snippet's raw files without the need for first having to retrieve the snippet itself and having to pull out the…
  • GETCheck if the current user is watching a snippet/snippets/:workspace/:encoded_id/watchUsed to check if the current user is watching a specific snippet. Returns 204 (No Content) if the user is watching the snippet and 404 if not. Hitting this…
  • PUTWatch a snippet/snippets/:workspace/:encoded_id/watchUsed to start watching a specific snippet. Returns 204 (No Content).
  • DELETEStop watching a snippet/snippets/:workspace/:encoded_id/watchUsed to stop watching a specific snippet. Returns 204 (No Content) to indicate success.
  • GETList users watching a snippet/snippets/:workspace/:encoded_id/watchersDeprecated. Returns a paginated list of all users watching a specific snippet.
  • GETGet a previous revision of a snippet/snippets/:workspace/:encoded_id/:node_idIdentical to GET /snippets/encoded_id, except that this endpoint can be used to retrieve the contents of the snippet as it was at an older revision, while…
  • PUTUpdate a previous revision of a snippet/snippets/:workspace/:encoded_id/:node_idIdentical to UPDATE /snippets/encoded_id, except that this endpoint takes an explicit commit revision. Only the snippet's "HEAD"/"tip" (most recent) version…
  • DELETEDelete a previous revision of a snippet/snippets/:workspace/:encoded_id/:node_idDeletes the snippet. Note that this only works for versioned URLs that point to the latest commit of the snippet. Pointing to an older commit results in a 405…
  • GETGet a snippet's raw file/snippets/:workspace/:encoded_id/:node_id/files/:pathRetrieves the raw contents of a specific file in the snippet. The Content-Disposition header will be "attachment" to avoid issues with malevolent executable…
  • GETGet snippet changes between versions/snippets/:workspace/:encoded_id/:revision/diff?path=stringReturns the diff of the specified commit against its first parent. Note that this resource is different in functionality from the patch resource. The…
  • GETGet snippet patch between versions/snippets/:workspace/:encoded_id/:revision/patchReturns the patch of the specified commit against its first parent. Note that this resource is different in functionality from the diff resource. The…

Source

  • GETList commits that modified a file/repositories/:workspace/:repo_slug/filehistory/:commit/:path?renames=string&q=string&sort=stringReturns a paginated list of commits that modified the specified file. Commits are returned in reverse chronological order. This is roughly equivalent to the…
  • GETGet the root directory of the main branch/repositories/:workspace/:repo_slug/src?format=metaThis endpoint redirects the client to the directory listing of the root directory on the main branch. This is equivalent to directly hitting…
  • POSTCreate a commit by uploading a file/repositories/:workspace/:repo_slug/src?message=string&author=string&parents=string&files=string&branch=stringThis endpoint is used to create new commits in the repository by uploading files. To add a new file to a repository: $ curl…
  • GETGet file or directory contents/repositories/:workspace/:repo_slug/src/:commit/:path?format=meta&q=string&sort=string&max_depth=0This endpoints is used to retrieve the contents of a single file, or the contents of a directory at a specified revision. Raw file contents When path points…

Ssh

  • GETList SSH keys/users/:selected_user/ssh-keysReturns a paginated list of the user's SSH public keys. Example: $ curl https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys {…
  • POSTAdd a new SSH key/users/:selected_user/ssh-keysAdds a new SSH public key to the specified user account and returns the resulting key. Example: $ curl -X POST -H "Content-Type: application/json" -d '{"key":…
  • GETGet a SSH key/users/:selected_user/ssh-keys/:key_idReturns a specific SSH public key belonging to a user. Example: $ curl…
  • PUTUpdate a SSH key/users/:selected_user/ssh-keys/:key_idUpdates a specific SSH public key on a user's account Note: Only the 'comment' field can be updated using this API. To modify the key or comment values, you…
  • DELETEDelete a SSH key/users/:selected_user/ssh-keys/:key_idDeletes a specific SSH public key from a user's account Example: $ curl -X DELETE…

Users

  • GETGet current user/userReturns the currently logged in user.
  • GETList email addresses for current user/user/emailsReturns all the authenticated user's email addresses. Both confirmed and unconfirmed.
  • GETGet an email address for current user/user/emails/:emailReturns details about a specific one of the authenticated user's email addresses. Details describe whether the address has been confirmed by the user and…
  • GETGet a user/users/:selected_userGets the public information associated with a user account. If the user's profile is private, location, website and created_on elements are omitted. Note that…

Webhooks

  • GETGet a webhook resource/hook_eventsReturns the webhook resource or subject types on which webhooks can be registered. Each resource/subject type contains an events link that returns the…
  • GETList subscribable webhook types/hook_events/:subject_typeReturns a paginated list of all valid webhook events for the specified entity. The team and user webhooks are deprecated, and you should use workspace…

Workspaces

  • GETList workspaces for the current user/user/permissions/workspaces?q=string&sort=stringReturns an object for each workspace the caller is a member of, and their effective role - the highest level of privilege the caller has. If a user is a…
  • GETList workspaces for user/workspaces?role=owner&q=string&sort=stringReturns a list of workspaces accessible by the authenticated user. Example: $ curl https://api.bitbucket.org/2.0/workspaces { "pagelen": 10, "page": 1,…
  • GETGet a workspace/workspaces/:workspaceReturns the requested workspace.
  • GETList webhooks for a workspace/workspaces/:workspace/hooksReturns a paginated list of webhooks installed on this workspace.
  • POSTCreate a webhook for a workspace/workspaces/:workspace/hooksCreates a new webhook on the specified workspace. Workspace webhooks are fired for events from all repositories contained by that workspace. Example: $ curl…
  • GETGet a webhook for a workspace/workspaces/:workspace/hooks/:uidReturns the webhook with the specified id installed on the given workspace.
  • PUTUpdate a webhook for a workspace/workspaces/:workspace/hooks/:uidUpdates the specified webhook subscription. The following properties can be mutated: * description * url * active * events
  • DELETEDelete a webhook for a workspace/workspaces/:workspace/hooks/:uidDeletes the specified webhook subscription from the given workspace.
  • GETList users in a workspace/workspaces/:workspace/membersReturns all members of the requested workspace.
  • GETGet user membership for a workspace/workspaces/:workspace/members/:memberReturns the workspace membership, which includes a User object for the member and a Workspace object for the requested workspace.
  • GETList user permissions in a workspace/workspaces/:workspace/permissions?q=stringReturns the list of members in a workspace and their permission levels. Permission can be: * owner * collaborator * member The collaborator role is being…
  • GETList all repository permissions for a workspace/workspaces/:workspace/permissions/repositories?q=string&sort=stringReturns an object for each repository permission for all of a workspace's repositories. Permissions returned are effective permissions: the highest level of…
  • GETList a repository permissions for a workspace/workspaces/:workspace/permissions/repositories/:repo_slug?q=string&sort=stringReturns an object for the repository permission of each user in the requested repository. Permissions returned are effective permissions: the highest level of…
  • GETList projects in a workspace/workspaces/:workspace/projectsReturns the list of projects in this workspace.

properties

  • GETGet a commit application property/repositories/:workspace/:repo_slug/commit/:commit/properties/:app_key/:property_nameRetrieve an application property value stored against a commit.
  • PUTUpdate a commit application property/repositories/:workspace/:repo_slug/commit/:commit/properties/:app_key/:property_nameUpdate an application property value stored against a commit.
  • DELETEDelete a commit application property/repositories/:workspace/:repo_slug/commit/:commit/properties/:app_key/:property_nameDelete an application property value stored against a commit.
  • GETGet a repository application property/repositories/:workspace/:repo_slug/properties/:app_key/:property_nameRetrieve an application property value stored against a repository.
  • PUTUpdate a repository application property/repositories/:workspace/:repo_slug/properties/:app_key/:property_nameUpdate an application property value stored against a repository.
  • DELETEDelete a repository application property/repositories/:workspace/:repo_slug/properties/:app_key/:property_nameDelete an application property value stored against a repository.
  • GETGet a pull request application property/repositories/:workspace/:repo_slug/pullrequests/:pullrequest_id/properties/:app_key/:property_nameRetrieve an application property value stored against a pull request.
  • PUTUpdate a pull request application property/repositories/:workspace/:repo_slug/pullrequests/:pullrequest_id/properties/:app_key/:property_nameUpdate an application property value stored against a pull request.
  • DELETEDelete a pull request application property/repositories/:workspace/:repo_slug/pullrequests/:pullrequest_id/properties/:app_key/:property_nameDelete an application property value stored against a pull request.
  • GETGet a user application property/users/:selected_user/properties/:app_key/:property_nameRetrieve an application property value stored against a user.
  • PUTUpdate a user application property/users/:selected_user/properties/:app_key/:property_nameUpdate an application property value stored against a user.
  • DELETEDelete a user application property/users/:selected_user/properties/:app_key/:property_nameDelete an application property value stored against a user.

Showing 300 of 303 endpoints. Fork the collection to see all of them.

API details

Base URL
https://api.bitbucket.org/2.0
Authentication
An API key in the Authorization header
HTTP Basic authentication (username and password)
OAuth 2.0 (authorization code flow) with 24 scopes
Operations
303 operations on 178 pathsGET 164DELETE 49POST 46PUT 44
11 marked deprecated
Main resources
Pipelines 58Issue tracker 33Pullrequests 30Repositories 29Commits 25Snippets 25Deployments 16Workspaces 15Webhooks 12properties 12
Response formats
application/json multipart/form-data multipart/related application/octet-stream
Description format
OpenAPI 3.0.0, API version 2.0
Listed from
APIs.guru OpenAPI Directory (CC0-1.0)
Source updated

How to test the Bitbucket API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Bitbucket API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses an API key in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Update an installed app” (PUT /addon), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Bitbucket API?

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… It is listed under Developer tools and has 303 endpoints.

Who publishes the Bitbucket API?

It is listed from Bitbucket's public API description (an OpenAPI document), not published by Bitbucket on Swastik Codes. Anyone who controls bitbucket.org can claim the profile by adding a DNS TXT record.

What is the base URL of the Bitbucket API?

Requests go to https://api.bitbucket.org/2.0. Endpoint paths are added to this base URL.

How do I authenticate with the Bitbucket API?

It accepts 3 methods: an API key in the Authorization header; HTTP Basic authentication (username and password); OAuth 2.0 (authorization code flow) with 24 scopes.

How many endpoints does the Bitbucket API have?

303 operations on 178 paths (164 GET, 49 DELETE, 46 POST, 44 PUT). The largest groups are Pipelines, Issue tracker, Pullrequests, Repositories.

Is forking the Bitbucket API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.