Development — entry 010 of 100

Bitbucket

Verified Jul 2026

Bitbucket's Cloud REST API covers repositories, pull requests, pipelines, issues, and webhooks for Atlassian's Git hosting platform, returning JSON over versioned 2.0 endpoints. Authentication has shifted from the old app-passwords scheme (retired for most workspaces through 2025) to OAuth 2.0 and Atlassian API tokens with scopes, so new integrations should build against those rather than the deprecated basic-auth flow.

gitdevopsrepositoriespull-requestsci-cd
AuthenticationOAuthRequires an OAuth flow; expect app registration.
HTTPSSupportedTraffic is encrypted in transit.
CORSEnabledCallable directly from browser JavaScript.
PricingFreemiumA usable free tier exists, with paid plans for more volume.
FormatsJSONResponses can be requested as JSON.

GreatAPIs Score

Score74out of 100
Authentication8/25OAuth flow required
Pricing17/20Freemium tier available
Docs20/20Machine-readable spec file bundled
Formats9/15Single response format
Freshness20/20Verified within 6 months

Embed this badge

Scored 74 on greatapis.com
<a href="https://greatapis.com/api/bitbucket/"><img src="https://greatapis.com/badge/bitbucket.svg" alt="Scored 74 on greatapis.com"></a>

Auth quickstart

  1. Register an app / run the OAuth flow to obtain a bearer token.
  2. Send it as an Authorization headerAuthorization: Bearer <token>
Stored keyNo key stored

Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.

Endpoints

Servers
https://api.bitbucket.org/2.0
Auth
oauth2basicapi_key
Addon3

The addon resource is intended to use used by Bitbucket Cloud Connect Apps, and only supports JWT authentication.

PUT/addonUpdate an installed app
Responses
StatusDescriptionSchema
204Request has succeeded. The installation has been updated to the new descriptor.
400Scopes have increased or decreased to none.error
401No authorization.error
403Improper authentication.error
DELETE/addonDelete an app
Responses
StatusDescriptionSchema
204Request has succeeded. The application has been deleted for the user.
401No authorization.error
403Improper authentication.error
GET/addon/{addon_key}/client-keyGet the client key of a Connect addon
Parameters
NameInRequiredType
addon_keypathyesstring
Responses
StatusDescriptionSchema
200The client key of the Connect addon linked to the Forge app installation where the request was made
401Invalid authentication.error
403Improper authorization.error
404The Connect addon or the Forge app does not exist.error
Branch restrictions5

Repository owners and administrators can set branch management rules on a repository that control what can be pushed by whom. Through these rules, you can enforce a project or team workflow. For example, owners or administrators can: * Limit push powers * Prevent branch deletion * Prevent history re-writes (Git only)

GET/repositories/{workspace}/{repo_slug}/branch-restrictionsList branch restrictions
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
kindquerynostring
patternquerynostring
Responses
StatusDescriptionSchema
200A paginated list of branch restrictionspaginated_branchrestrictions
401If the request was not authenticatederror
403If the authenticated user does not have admin access to the repositoryerror
404If the repository does not existerror
POST/repositories/{workspace}/{repo_slug}/branch-restrictionsCreate a branch restriction rule
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonbranchrestriction (required)

Responses
StatusDescriptionSchema
201A paginated list of branch restrictionsbranchrestriction
401If the request was not authenticatederror
403If the authenticated user does not have admin access to the repositoryerror
404If the repository does not existerror
GET/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}Get a branch restriction rule
Parameters
NameInRequiredType
idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The branch restriction rulebranchrestriction
401If the request was not authenticatederror
403If the authenticated user does not have admin access to the repositoryerror
404If the repository or branch restriction id does not existerror
PUT/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}Update a branch restriction rule
Parameters
NameInRequiredType
idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonbranchrestriction (required)

Responses
StatusDescriptionSchema
200The updated branch restriction rulebranchrestriction
401If the request was not authenticatederror
403If the authenticated user does not have admin access to the repositoryerror
404If the repository or branch restriction id does not existerror
DELETE/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}Delete a branch restriction rule
Parameters
NameInRequiredType
idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204
401If the request was not authenticatederror
403If the authenticated user does not have admin access to the repositoryerror
404If the repository or branch restriction id does not existerror
Branching model7

The branching model resource is used to modify the branching model for a repository. You can use the branching model to define a branch based workflow for your repositories. When you map your workflow to branch types, you can ensure that branches are named consistently by configuring which branch types to make available.

GET/repositories/{workspace}/{repo_slug}/branching-modelGet the branching model for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The branching model objectbranching_model
401If the request was not authenticatederror
403If the authenticated user does not have read access to the repositoryerror
404If the repository does not existerror
GET/repositories/{workspace}/{repo_slug}/branching-model/settingsGet the branching model config for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The branching model configurationbranching_model_settings
401If the request was not authenticatederror
403If the authenticated user does not have admin access to the repositoryerror
404If the repository does not existerror
PUT/repositories/{workspace}/{repo_slug}/branching-model/settingsUpdate the branching model config for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The updated branching model configurationbranching_model_settings
400If the request contains invalid branching model configurationerror
401If the request was not authenticatederror
403If the authenticated user does not have admin access to the repositoryerror
404If the repository does not existerror
GET/repositories/{workspace}/{repo_slug}/effective-branching-modelGet the effective, or currently applied, branching model for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The effective branching model objecteffective_repo_branching_model
401If the request was not authenticatederror
403If the authenticated user does not have read access to the repositoryerror
404If the repository does not existerror
GET/workspaces/{workspace}/projects/{project_key}/branching-modelGet the branching model for a project
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The branching model objectproject_branching_model
401If the request was not authenticatederror
403If the authenticated user does not have read access to the projecterror
404If the project does not existerror
GET/workspaces/{workspace}/projects/{project_key}/branching-model/settingsGet the branching model config for a project
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The branching model configurationbranching_model_settings
401If the request was not authenticatederror
403If the authenticated user does not have admin access to the projecterror
404If the project does not existerror
PUT/workspaces/{workspace}/projects/{project_key}/branching-model/settingsUpdate the branching model config for a project
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The updated branching model configurationbranching_model_settings
400If the request contains an invalid branching model configurationerror
401If the request was not authenticatederror
403If the authenticated user does not have admin access to the projecterror
404If the project does not existerror
Commit statuses4

Commit statuses provide a way to tag commits with meta data, like automated build results.

GET/repositories/{workspace}/{repo_slug}/commit/{commit}/statusesList commit statuses for a commit
Parameters
NameInRequiredType
commitpathyesstring
repo_slugpathyesstring
workspacepathyesstring
refnamequerynostring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200A paginated list of all commit statuses for this commit.paginated_commitstatuses
401If the repository is private and the request was not authenticated.
404If the repository or commit does not existerror
POST/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/buildCreate a build status for a commit
Parameters
NameInRequiredType
commitpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsoncommitstatus

Responses
StatusDescriptionSchema
201The newly created build status object.commitstatus
401If the repository is private and the request was not authenticated.
404If the repository, commit, or build status key does not existerror
GET/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}Get a build status for a commit
Parameters
NameInRequiredType
commitpathyesstring
keypathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The build status object with the specified key.commitstatus
401If the repository is private and the request was not authenticated.
404If the repository, commit, or build status key does not existerror
PUT/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}Update a build status for a commit
Parameters
NameInRequiredType
commitpathyesstring
keypathyesstring
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsoncommitstatus

Responses
StatusDescriptionSchema
200The updated build status object.commitstatus
401If the repository is private and the request was not authenticated.
404If the repository or build does not existerror
Commits17

These are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of git log.

GET/repositories/{workspace}/{repo_slug}/commit/{commit}Get a commit
Parameters
NameInRequiredType
commitpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The commit objectcommit
404If the specified commit or repository does not exist.error
POST/repositories/{workspace}/{repo_slug}/commit/{commit}/approveApprove a commit
Parameters
NameInRequiredType
commitpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The `participant` object recording that the authenticated user approved the commit.participant
404If the specified commit, or the repository does not exist.error
DELETE/repositories/{workspace}/{repo_slug}/commit/{commit}/approveUnapprove a commit
Parameters
NameInRequiredType
commitpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204An empty response indicating the authenticated user's approval has been withdrawn.
404If the specified commit, or the repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/commit/{commit}/commentsList a commit's comments
Parameters
NameInRequiredType
commitpathyesstring
repo_slugpathyesstring
workspacepathyesstring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200A paginated list of commit comments.paginated_commit_comments
POST/repositories/{workspace}/{repo_slug}/commit/{commit}/commentsCreate comment for a commit
Parameters
NameInRequiredType
commitpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsoncommit_comment (required)

Responses
StatusDescriptionSchema
201The newly created comment.
400If the comment was detected as spam, or if the parent comment is not attached to the same node as the new comment
404If a parent ID was passed in that cannot be found
GET/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}Get a commit comment
Parameters
NameInRequiredType
comment_idpathyesinteger
commitpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The commit comment.commit_comment
PUT/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}Update a commit comment
Parameters
NameInRequiredType
comment_idpathyesinteger
commitpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsoncommit_comment (required)

Responses
StatusDescriptionSchema
201The newly updated comment.
400If the comment update was detected as spam
DELETE/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}Delete a commit comment
Parameters
NameInRequiredType
comment_idpathyesinteger
commitpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates the comment was deleted by this action or a previous delete.
404If the comment doesn't exist
GET/repositories/{workspace}/{repo_slug}/commitsList commits
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of commitspaginated_changeset
404If the specified repository does not exist.error
POST/repositories/{workspace}/{repo_slug}/commitsList commits with include/exclude
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of commitspaginated_changeset
404If the specified repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/commits/{revision}List commits for revision
Parameters
NameInRequiredType
repo_slugpathyesstring
revisionpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of commitspaginated_changeset
404If the specified revision does not exist.error
POST/repositories/{workspace}/{repo_slug}/commits/{revision}List commits for revision using include/exclude
Parameters
NameInRequiredType
repo_slugpathyesstring
revisionpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of commitspaginated_changeset
404If the specified revision does not exist.error
GET/repositories/{workspace}/{repo_slug}/diff/{spec}Compare two commits
Parameters
NameInRequiredType
repo_slugpathyesstring
specpathyesstring
workspacepathyesstring
contextquerynointeger
pathquerynostring
ignore_whitespacequerynoboolean
binaryquerynoboolean
renamesquerynoboolean
mergequerynoboolean
topicquerynoboolean
Responses
StatusDescriptionSchema
200The raw diff
555If the diff was too large and timed out. Since this endpoint does not employ any form of pagination, but instead returns the diff as a single document, it can run into trouble on very large diffs. If Bitbucket times out in cases like these, a 555 status code is returned.error
GET/repositories/{workspace}/{repo_slug}/diffstat/{spec}Compare two commit diff stats
Parameters
NameInRequiredType
ignore_whitespacequerynoboolean
mergequerynoboolean
pathquerynostring
renamesquerynoboolean
repo_slugpathyesstring
specpathyesstring
topicquerynoboolean
workspacepathyesstring
Responses
StatusDescriptionSchema
200The diff statspaginated_diffstats
555If generating the diffstat timed out.error
GET/repositories/{workspace}/{repo_slug}/file-conflicts/{spec}Get file conflicts for a commit spec
Parameters
NameInRequiredType
repo_slugpathyesstring
specpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of file conflictspaginated_file_conflicts
404If the spec cannot be resolved, which may be due to an invalid spec, or commits/refs not present in the repositoryerror
GET/repositories/{workspace}/{repo_slug}/merge-base/{revspec}Get the common ancestor between two commits
Parameters
NameInRequiredType
repo_slugpathyesstring
revspecpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The merge base of the provided spec.commit
401If the request was not authenticated.error
403If the authenticated user does not have access to any of the repositories specified.error
404If the repository or ref in the spec does not exist.error
GET/repositories/{workspace}/{repo_slug}/patch/{spec}Get a patch for two commits
Parameters
NameInRequiredType
repo_slugpathyesstring
specpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The raw patches
555If the diff was too large and timed out. Since this endpoint does not employ any form of pagination, but instead returns the diff as a single document, it can run into trouble on very large diffs. If Bitbucket times out in cases like these, a 555 status code is returned.error
Deployments16

Teams are deploying code faster than ever, thanks to continuous delivery practices and tools like Bitbucket Pipelines. Bitbucket Deployments gives teams visibility into their deployment environments and helps teams to track how far changes have progressed in their deployment pipeline.

GET/repositories/{workspace}/{repo_slug}/deploy-keysList repository deploy keys
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Deploy keys matching the repositorypaginated_deploy_keys
403If the specified user or repository is not accessible to the current user
404If the specified user or repository does not existerror
POST/repositories/{workspace}/{repo_slug}/deploy-keysAdd a repository deploy key
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The deploy key that was createddeploy_key
400Invalid deploy key inputs
403If the specified user or repository is not accessible to the current user
404If the specified user or repository does not existerror
GET/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}Get a repository deploy key
Parameters
NameInRequiredType
key_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Deploy key matching the key IDdeploy_key
403If the specified user or repository is not accessible to the current user
404If the specified user or repository does not existerror
PUT/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}Update a repository deploy key
Parameters
NameInRequiredType
key_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The newly updated deploy key.deploy_key
400If the submitted key or related value is invaliderror
403If the current user does not have permission to add a key for the specified user
404If the specified user, repository, or deploy key does not existerror
DELETE/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}Delete a repository deploy key
Parameters
NameInRequiredType
key_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204The key has been deleted
403If the current user does not have permission to delete a key for the specified user
404If the specified user, repository, or deploy key does not existerror
GET/repositories/{workspace}/{repo_slug}/deploymentsList deployments
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
200The matching deployments.paginated_deployments
GET/repositories/{workspace}/{repo_slug}/deployments/{deployment_uuid}Get a deployment
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
deployment_uuidpathyesstring
Responses
StatusDescriptionSchema
200The deployment.deployment
404No account, repository or deployment with the UUID provided exists.error
GET/repositories/{workspace}/{repo_slug}/environmentsList environments
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
200The matching environments.paginated_environments
POST/repositories/{workspace}/{repo_slug}/environmentsCreate an environment
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Request body

application/jsondeployment_environment (required)

Responses
StatusDescriptionSchema
201The environment was created.deployment_environment
404The account or repository does not exist.error
409An environment host with the provided name already exists.error
GET/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}Get an environment
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
environment_uuidpathyesstring
Responses
StatusDescriptionSchema
200The environment.deployment_environment
404No account, repository or environment with the UUID provided exists.error
DELETE/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}Delete an environment
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
environment_uuidpathyesstring
Responses
StatusDescriptionSchema
204The environment was deleted.
404No account or repository with the UUID provided exists.error
POST/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}/changesUpdate an environment
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
environment_uuidpathyesstring
Responses
StatusDescriptionSchema
202The environment update request was accepted.
404No account, repository or environment with the UUID provided exists.error
GET/workspaces/{workspace}/projects/{project_key}/deploy-keysList project deploy keys
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Deploy keys matching the projectpaginated_project_deploy_keys
403If the specified workspace or project is not accessible to the current usererror
404If the specified workspace or project does not existerror
POST/workspaces/{workspace}/projects/{project_key}/deploy-keysCreate a project deploy key
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The project deploy key that was createdproject_deploy_key
400Invalid deploy key inputserror
403If the specified workspace or project is not accessible to the current usererror
404If the specified workspace or project does not existerror
GET/workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id}Get a project deploy key
Parameters
NameInRequiredType
key_idpathyesstring
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Project deploy key matching the key IDproject_deploy_key
403If the specified workspace or project is not accessible to the current usererror
404If the specified workspace or project does not existerror
DELETE/workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id}Delete a deploy key from a project
Parameters
NameInRequiredType
key_idpathyesstring
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204The project deploy key has been deleted
403If the current user does not have permission to delete a key for the specified projecterror
404If the specified workspace, project, or project deploy key does not existerror
Downloads4

Access the list of download links associated with the repository.

GET/repositories/{workspace}/{repo_slug}/downloadsList download artifacts
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Returns a paginated list of the downloads associated with the repository.
403User is not authorized to read from the repository.error
POST/repositories/{workspace}/{repo_slug}/downloadsUpload a download artifact
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
201The artifact was uploaded sucessfully.
400Bad Request.error
403User is not authorized to write to the repository.error
406Unsupported Content-Type. Use multiplart/form-data.error
GET/repositories/{workspace}/{repo_slug}/downloads/{filename}Get a download artifact link
Parameters
NameInRequiredType
filenamepathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
302Redirects to the url of the specified download artifact.
403User is not authorized to read from the repository.error
404The specified download artifact does not exist.error
DELETE/repositories/{workspace}/{repo_slug}/downloads/{filename}Delete a download artifact
Parameters
NameInRequiredType
filenamepathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204The specified download artifact was deleted.
403User is not authorized to write to the repository.error
404The specified download does not exist.error
GPG4

The GPG resource allows you to manage GPG keys.

GET/users/{selected_user}/gpg-keysList GPG keys
Parameters
NameInRequiredType
selected_userpathyesstring
Responses
StatusDescriptionSchema
200A list of the GPG keys associated with the account.paginated_gpg_user_keys
403If the specified user's keys are not accessible to the current user
404If the specified user does not existerror
POST/users/{selected_user}/gpg-keysAdd a new GPG key
Parameters
NameInRequiredType
selected_userpathyesstring
Request body

application/jsonGPG_account_key

Responses
StatusDescriptionSchema
201The newly created GPG key.GPG_account_key
400If the submitted key or related value is invaliderror
403If the current user does not have permission to add a key for the specified user
404If the specified user does not existerror
GET/users/{selected_user}/gpg-keys/{fingerprint}Get a GPG key
Parameters
NameInRequiredType
fingerprintpathyesstring
selected_userpathyesstring
Responses
StatusDescriptionSchema
200The specific GPG key matching the user and fingerprint.GPG_account_key
403If the specified user's keys are not accessible to the current user
404If the specified user does not existerror
DELETE/users/{selected_user}/gpg-keys/{fingerprint}Delete a GPG key
Parameters
NameInRequiredType
fingerprintpathyesstring
selected_userpathyesstring
Responses
StatusDescriptionSchema
204The key has been deleted
400If the submitted key or related value is invaliderror
403If the current user does not have permission to delete a key for the specified user, or the submitted key is a subkey
404If the specified key does not existerror
Issue tracker33

The issue resources provide functionality for getting information on issues in an issue tracker, creating new issues, updating them and deleting them. You can access public issues without authentication, but you can't gain access to private repositories' issues. By authenticating, you will get the ability to create issues, as well as access to updating data or deleting issues you have access to. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.

GET/repositories/{workspace}/{repo_slug}/componentsList components
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The components that have been defined in the issue tracker.paginated_components
404The specified repository does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/components/{component_id}Get a component for issues
Parameters
NameInRequiredType
component_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The specified component object.component
404The specified repository or component does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/issuesList issues
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of the issues matching any filter criteria that were provided.paginated_issues
404The specified repository does not exist or does not have the issue tracker enabled.error
POST/repositories/{workspace}/{repo_slug}/issuesCreate an issue
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonissue (required)

Responses
StatusDescriptionSchema
201The newly created issue.issue
401When the request wasn't authenticated.error
403When the authenticated user isn't authorized to create the issue.error
404The specified repository does not exist or does not have the issue tracker enabled.error
POST/repositories/{workspace}/{repo_slug}/issues/exportExport issues
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonexport_options

Responses
StatusDescriptionSchema
202The export job has been accepted
401The request wasn't authenticated properlyerror
403When the authenticated user does not have admin permission on the repoerror
404The repo does not exist or does not have an issue trackererror
GET/repositories/{workspace}/{repo_slug}/issues/export/{repo_name}-issues-{task_id}.zipCheck issue export status
Parameters
NameInRequiredType
repo_namepathyesstring
repo_slugpathyesstring
task_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
202Export job acceptedissue_job_status
401The request wasn't authenticated properlyerror
403When the authenticated user does not have admin permission on the repoerror
404No export job has begunerror
GET/repositories/{workspace}/{repo_slug}/issues/importCheck issue import status
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Import job complete with either FAILURE or SUCCESS statusissue_job_status
202Import job startedissue_job_status
401The request wasn't authenticated properlyerror
403When the authenticated user does not have admin permission on the repoerror
404No export job has begunerror
POST/repositories/{workspace}/{repo_slug}/issues/importImport issues
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
202Import job acceptedissue_job_status
401The request wasn't authenticated properlyerror
403When the authenticated user does not have admin permission on the repoerror
404No export job has begunerror
409Import already runningerror
GET/repositories/{workspace}/{repo_slug}/issues/{issue_id}Get an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The issue object.issue
403When the authenticated user isn't authorized to access the issue.error
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
410The specified issue is unavailable.error
PUT/repositories/{workspace}/{repo_slug}/issues/{issue_id}Update an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The updated issue object.issue
403When the authenticated user isn't authorized to access the issue.error
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
DELETE/repositories/{workspace}/{repo_slug}/issues/{issue_id}Delete an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates the issue was deleted successfully.
403When the authenticated user isn't authorized to delete the issue.error
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachmentsList attachments for an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of all attachments for this issue.paginated_issue_attachments
401If the issue tracker is private and the request was not authenticated.
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
POST/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachmentsUpload an attachment to an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
201An empty response document.
400If no files were uploaded, or if the wrong `Content-Type` was used.
401If the issue tracker is private and the request was not authenticated.
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}Get attachment for an issue
Parameters
NameInRequiredType
issue_idpathyesstring
pathpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
302A redirect to the file's contents
401If the issue tracker is private and the request was not authenticated.
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
DELETE/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}Delete an attachment for an issue
Parameters
NameInRequiredType
issue_idpathyesstring
pathpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates that the deletion was successful
401If the issue tracker is private and the request was not authenticated.
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changesList changes on an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200Returns all the issue changes that were made on the specified issue.paginated_log_entries
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
POST/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changesModify the state of an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonissue_change (required)

Responses
StatusDescriptionSchema
201The newly created issue change.issue_change
401When the request wasn't authenticated.error
403When the authenticated user isn't authorized to modify the issue.error
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes/{change_id}Get issue change object
Parameters
NameInRequiredType
change_idpathyesstring
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The specified issue change object.issue_change
404The specified repository or issue change does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/issues/{issue_id}/commentsList comments on an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
qquerynostring
Responses
StatusDescriptionSchema
200A paginated list of issue comments.paginated_issue_comments
POST/repositories/{workspace}/{repo_slug}/issues/{issue_id}/commentsCreate a comment on an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonissue_comment (required)

Responses
StatusDescriptionSchema
201The newly created comment.
400If the input was invalid, or if the comment being created is detected as spam error
GET/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}Get a comment on an issue
Parameters
NameInRequiredType
comment_idpathyesinteger
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The issue comment.issue_comment
PUT/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}Update a comment on an issue
Parameters
NameInRequiredType
comment_idpathyesinteger
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonissue_comment (required)

Responses
StatusDescriptionSchema
200The updated issue comment.issue_comment
400If the input was invalid, or if the update to the comment is detected as spam error
DELETE/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}Delete a comment on an issue
Parameters
NameInRequiredType
comment_idpathyesinteger
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates successful deletion.
GET/repositories/{workspace}/{repo_slug}/issues/{issue_id}/voteCheck if current user voted for an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204If the authenticated user has not voted for this issue.error
401When the request wasn't authenticated.error
404If the authenticated user has not voted for this issue, or when the repo does not exist, or does not have an issue tracker.error
PUT/repositories/{workspace}/{repo_slug}/issues/{issue_id}/voteVote for an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicating the authenticated user has cast their vote successfully.error
401When the request wasn't authenticated.error
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
DELETE/repositories/{workspace}/{repo_slug}/issues/{issue_id}/voteRemove vote for an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
defaultUnexpected error.error
GET/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watchCheck if current user is watching a issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204If the authenticated user is watching this issue.error
401When the request wasn't authenticated.error
404If the authenticated user is not watching this issue, or when the repo does not exist, or does not have an issue tracker.error
PUT/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watchWatch an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates that the authenticated user successfully started watching this issue.error
401When the request wasn't authenticated.error
404If the authenticated user is not watching this issue, or when the repo does not exist, or does not have an issue tracker.error
DELETE/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watchStop watching an issue
Parameters
NameInRequiredType
issue_idpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates that the authenticated user successfully stopped watching this issue.error
401When the request wasn't authenticated.error
404The specified repository or issue does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/milestonesList milestones
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The milestones that have been defined in the issue tracker.paginated_milestones
404The specified repository does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/milestones/{milestone_id}Get a milestone
Parameters
NameInRequiredType
milestone_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The specified milestone object.milestone
404The specified repository or milestone does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/versionsList defined versions for issues
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The versions that have been defined in the issue tracker.paginated_versions
404The specified repository does not exist or does not have the issue tracker enabled.error
GET/repositories/{workspace}/{repo_slug}/versions/{version_id}Get a defined version for issues
Parameters
NameInRequiredType
repo_slugpathyesstring
version_idpathyesinteger
workspacepathyesstring
Responses
StatusDescriptionSchema
200The specified version object.version
404The specified repository or version does not exist or does not have the issue tracker enabled.error
Pipelines68

Bitbucket Pipelines brings continuous delivery to Bitbucket Cloud, empowering teams with full branching to deployment visibility and faster feedback loops.

GET/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variablesList variables for an environment
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
environment_uuidpathyesstring
Responses
StatusDescriptionSchema
200The retrieved deployment variables.paginated_deployment_variable
POST/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variablesCreate a variable for an environment
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
environment_uuidpathyesstring
Request body

application/jsondeployment_variable (required)

Responses
StatusDescriptionSchema
201The variable was created.deployment_variable
404The account, repository, environment or variable with the given UUID was not found.error
409A variable with the provided key already exists.error
PUT/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}Update a variable for an environment
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
environment_uuidpathyesstring
variable_uuidpathyesstring
Request body

application/jsondeployment_variable (required)

Responses
StatusDescriptionSchema
200The deployment variable was updated.deployment_variable
404The account, repository, environment or variable with the given UUID was not found.error
DELETE/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}Delete a variable for an environment
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
environment_uuidpathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
204The variable was deleted.
404The account, repository, environment or variable with given UUID was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelinesList pipelines
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
creator.uuidquerynostring
target.ref_typequerynostring
target.ref_namequerynostring
target.branchquerynostring
target.commit.hashquerynostring
target.selector.patternquerynostring
target.selector.typequerynostring
created_onquerynostring
trigger_typequerynostring
statusquerynostring
sortquerynostring
pagequerynointeger
pagelenquerynointeger
Responses
StatusDescriptionSchema
200The matching pipelines.paginated_pipelines
POST/repositories/{workspace}/{repo_slug}/pipelinesRun a pipeline
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Request body

application/jsonpipeline (required)

Responses
StatusDescriptionSchema
201The initiated pipeline.pipeline
400The account or repository is not enabled, the yml file does not exist in the repository for the given revision, or the request body contained invalid properties.error
404The account or repository was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelines-config/cachesList caches
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
200The list of caches for the given repository.paginated_pipeline_caches
404The account or repository was not found.error
DELETE/repositories/{workspace}/{repo_slug}/pipelines-config/cachesDelete caches
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
namequeryyesstring
Responses
StatusDescriptionSchema
204The caches were deleted.
404The workspace, repository or cache name was not found.error
DELETE/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}Delete a cache
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
cache_uuidpathyesstring
Responses
StatusDescriptionSchema
204The cache was deleted.
404The workspace, repository or cache_uuid with given UUID was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uriGet cache content URI
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
cache_uuidpathyesstring
Responses
StatusDescriptionSchema
200The cache content uri.pipeline_cache_content_uri
404The workspace, repository or cache_uuid with given UUID was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelines-config/runnersGet repository runners
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
200The repository runners.paginated_pipeline_runners
POST/repositories/{workspace}/{repo_slug}/pipelines-config/runnersCreate repository runner
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
200The repository runner.pipeline_runner
400The request body contained invalid properties or runner limit exceeded.error
409The repository runner with the provided UUID already exists.error
GET/repositories/{workspace}/{repo_slug}/pipelines-config/runners/{runner_uuid}Get repository runner
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
runner_uuidpathyesstring
Responses
StatusDescriptionSchema
200The repository runner.pipeline_runner
404The repository runner was not found.error
PUT/repositories/{workspace}/{repo_slug}/pipelines-config/runners/{runner_uuid}Update repository runner
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
runner_uuidpathyesstring
Responses
StatusDescriptionSchema
200The repository runner.pipeline_runner
404The repository runner was not found.error
DELETE/repositories/{workspace}/{repo_slug}/pipelines-config/runners/{runner_uuid}Delete repository runner
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
runner_uuidpathyesstring
Responses
StatusDescriptionSchema
204The repository runner was deleted.
404The repository runner was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}Get a pipeline
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pipeline_uuidpathyesstring
Responses
StatusDescriptionSchema
200The pipeline.pipeline
404No account, repository or pipeline with the UUID provided exists.error
GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/stepsList steps for a pipeline
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pipeline_uuidpathyesstring
Responses
StatusDescriptionSchema
200The steps.paginated_pipeline_steps
GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}Get a step of a pipeline
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pipeline_uuidpathyesstring
step_uuidpathyesstring
Responses
StatusDescriptionSchema
200The step.pipeline_step
404No account, repository, pipeline or step with the UUID provided exists for the pipeline with the UUID provided.error
GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logGet log file for a step
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pipeline_uuidpathyesstring
step_uuidpathyesstring
Responses
StatusDescriptionSchema
200The raw log file for this pipeline step.
304The log has the same etag as the provided If-None-Match header.error
307After the step is completed, the log is moved to long term storage and a redirection to the log file is returned.
404A pipeline with the given UUID does not exist, a step with the given UUID does not exist in the pipeline or a log file does not exist for the given step.error
416The requested range does not exist for requests that specified the [HTTP Range header](https://tools.ietf.org/html/rfc7233#section-3.1).error
GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}Get the logs for the build container or a service container for a given step of a pipeline.
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pipeline_uuidpathyesstring
step_uuidpathyesstring
log_uuidpathyesstring
Responses
StatusDescriptionSchema
200The raw log file for the build container or service container.
307After the step is completed, the log is moved to long term storage and a redirection to the log file is returned.
404No account, repository, pipeline, step or log exist for the provided path.error
GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reportsGet a summary of test reports for a given step of a pipeline.
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pipeline_uuidpathyesstring
step_uuidpathyesstring
Responses
StatusDescriptionSchema
200A summary of test reports for this pipeline step.
404No account, repository, pipeline, step or test reports exist for the provided path.error
GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_casesGet test cases for a given step of a pipeline.
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pipeline_uuidpathyesstring
step_uuidpathyesstring
Responses
StatusDescriptionSchema
200Test cases for this pipeline step.
404No account, repository, pipeline, step or test reports exist for the provided path.error
GET/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasonsGet test case reasons (output) for a given test case in a step of a pipeline.
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pipeline_uuidpathyesstring
step_uuidpathyesstring
test_case_uuidpathyesstring
Responses
StatusDescriptionSchema
200Test case reasons (output).
404No account, repository, pipeline, step or test case with the UUID provided exists for the pipeline with the UUID provided.error
POST/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/stopPipelineStop a pipeline
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pipeline_uuidpathyesstring
Responses
StatusDescriptionSchema
204The pipeline has been signaled to stop.
400The specified pipeline has already completed.error
404Either the account, repository or pipeline with the given UUID does not exist.error
GET/repositories/{workspace}/{repo_slug}/pipelines_configGet configuration
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
200The repository pipelines configuration.pipelines_config
PUT/repositories/{workspace}/{repo_slug}/pipelines_configUpdate configuration
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Request body

application/jsonpipelines_config (required)

Responses
StatusDescriptionSchema
200The repository pipelines configuration was updated.pipelines_config
PUT/repositories/{workspace}/{repo_slug}/pipelines_config/build_numberUpdate the next build number
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Request body

application/jsonpipeline_build_number (required)

Responses
StatusDescriptionSchema
200The build number has been configured.pipeline_build_number
400The update failed because the next number was invalid (it should be higher than the current number).error
404The account or repository was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelines_config/schedulesList schedules
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
200The list of schedules.paginated_pipeline_schedules
404The account or repository was not found.error
POST/repositories/{workspace}/{repo_slug}/pipelines_config/schedulesCreate a schedule
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Request body

application/jsonpipeline_schedule_post_request_body (required)

Responses
StatusDescriptionSchema
201The created schedule.pipeline_schedule
400There were errors validating the request.error
401The maximum limit of schedules for this repository was reached.error
404The account or repository was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}Get a schedule
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
schedule_uuidpathyesstring
Responses
StatusDescriptionSchema
200The requested schedule.pipeline_schedule
404The account, repository or schedule was not found.error
PUT/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}Update a schedule
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
schedule_uuidpathyesstring
Request body

application/jsonpipeline_schedule_put_request_body (required)

Responses
StatusDescriptionSchema
200The schedule is updated.pipeline_schedule
404The account, repository or schedule was not found.error
DELETE/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}Delete a schedule
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
schedule_uuidpathyesstring
Responses
StatusDescriptionSchema
204The schedule was deleted.
404The account, repository or schedule was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executionsList executions of a schedule
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
schedule_uuidpathyesstring
Responses
StatusDescriptionSchema
200The list of executions of a schedule.paginated_pipeline_schedule_executions
404The account or repository was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pairGet SSH key pair
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
200The SSH key pair.pipeline_ssh_key_pair
404The account, repository or SSH key pair was not found.error
PUT/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pairUpdate SSH key pair
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Request body

application/jsonpipeline_ssh_key_pair (required)

Responses
StatusDescriptionSchema
200The SSH key pair was created or updated.pipeline_ssh_key_pair
404The account, repository or SSH key pair was not found.error
DELETE/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pairDelete SSH key pair
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
204The SSH key pair was deleted.
404The account, repository or SSH key pair was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hostsList known hosts
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
200The retrieved known hosts.paginated_pipeline_known_hosts
POST/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hostsCreate a known host
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Request body

application/jsonpipeline_known_host (required)

Responses
StatusDescriptionSchema
201The known host was created.pipeline_known_host
404The account or repository does not exist.error
409A known host with the provided hostname already exists.error
GET/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}Get a known host
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
known_host_uuidpathyesstring
Responses
StatusDescriptionSchema
200The known host.pipeline_known_host
404The account, repository or known host with the specified UUID was not found.error
PUT/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}Update a known host
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
known_host_uuidpathyesstring
Request body

application/jsonpipeline_known_host (required)

Responses
StatusDescriptionSchema
200The known host was updated.pipeline_known_host
404The account, repository or known host with the given UUID was not found.error
DELETE/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}Delete a known host
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
known_host_uuidpathyesstring
Responses
StatusDescriptionSchema
204The known host was deleted.
404The account, repository or known host with given UUID was not found.error
GET/repositories/{workspace}/{repo_slug}/pipelines_config/variablesList variables for a repository
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Responses
StatusDescriptionSchema
200The retrieved variables.paginated_pipeline_variables
POST/repositories/{workspace}/{repo_slug}/pipelines_config/variablesCreate a variable for a repository
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
Request body

application/jsonpipeline_variable (required)

Responses
StatusDescriptionSchema
201The variable was created.pipeline_variable
404The account or repository does not exist.error
409A variable with the provided key already exists.error
GET/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}Get a variable for a repository
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
200The variable.pipeline_variable
404The account, repository or variable with the specified UUID was not found.error
PUT/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}Update a variable for a repository
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
variable_uuidpathyesstring
Request body

application/jsonpipeline_variable (required)

Responses
StatusDescriptionSchema
200The variable was updated.pipeline_variable
404The account, repository or variable with the given UUID was not found.error
DELETE/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}Delete a variable for a repository
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
204The variable was deleted.
404The account, repository or variable with given UUID was not found.error
GET/teams/{username}/pipelines_config/variablesList variables for an account
Parameters
NameInRequiredType
usernamepathyesstring
Responses
StatusDescriptionSchema
200The found account level variables.paginated_pipeline_variables
POST/teams/{username}/pipelines_config/variablesCreate a variable for a user
Parameters
NameInRequiredType
usernamepathyesstring
Responses
StatusDescriptionSchema
201The created variable.pipeline_variable
404The account does not exist.error
409A variable with the provided key already exists.error
GET/teams/{username}/pipelines_config/variables/{variable_uuid}Get a variable for a team
Parameters
NameInRequiredType
usernamepathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
200The variable.pipeline_variable
404The account or variable with the given UUID was not found.error
PUT/teams/{username}/pipelines_config/variables/{variable_uuid}Update a variable for a team
Parameters
NameInRequiredType
usernamepathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
200The variable was updated.pipeline_variable
404The account or the variable was not found.error
DELETE/teams/{username}/pipelines_config/variables/{variable_uuid}Delete a variable for a team
Parameters
NameInRequiredType
usernamepathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
204The variable was deleted
404The account or the variable with the provided UUID does not exist.error
GET/users/{selected_user}/pipelines_config/variablesList variables for a user
Parameters
NameInRequiredType
selected_userpathyesstring
Responses
StatusDescriptionSchema
200The found user level variables.paginated_pipeline_variables
POST/users/{selected_user}/pipelines_config/variablesCreate a variable for a user
Parameters
NameInRequiredType
selected_userpathyesstring
Responses
StatusDescriptionSchema
201The created variable.pipeline_variable
404The account does not exist.error
409A variable with the provided key already exists.error
GET/users/{selected_user}/pipelines_config/variables/{variable_uuid}Get a variable for a user
Parameters
NameInRequiredType
selected_userpathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
200The variable.pipeline_variable
404The account or variable with the given UUID was not found.error
PUT/users/{selected_user}/pipelines_config/variables/{variable_uuid}Update a variable for a user
Parameters
NameInRequiredType
selected_userpathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
200The variable was updated.pipeline_variable
404The account or the variable was not found.error
DELETE/users/{selected_user}/pipelines_config/variables/{variable_uuid}Delete a variable for a user
Parameters
NameInRequiredType
selected_userpathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
204The variable was deleted
404The account or the variable with the provided UUID does not exist.error
GET/workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configurationGet OpenID configuration for OIDC in Pipelines
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The OpenID configuration
404The workspace was not found.error
GET/workspaces/{workspace}/pipelines-config/identity/oidc/keys.jsonGet keys for OIDC in Pipelines
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The keys in JSON web key format
404The workspace was not found.error
GET/workspaces/{workspace}/pipelines-config/runnersGet workspace runners
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The workspace runners.paginated_pipeline_runners
POST/workspaces/{workspace}/pipelines-config/runnersCreate workspace runner
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The workspace runner.pipeline_runner
400The request body contained invalid properties or runner limit exceeded.error
409The workspace runner with the provided UUID already exists.error
GET/workspaces/{workspace}/pipelines-config/runners/{runner_uuid}Get workspace runner
Parameters
NameInRequiredType
workspacepathyesstring
runner_uuidpathyesstring
Responses
StatusDescriptionSchema
200The workspace runner.pipeline_runner
404The workspace runner was not found.error
PUT/workspaces/{workspace}/pipelines-config/runners/{runner_uuid}Update workspace runner
Parameters
NameInRequiredType
workspacepathyesstring
runner_uuidpathyesstring
Responses
StatusDescriptionSchema
200The workspace runner.pipeline_runner
404The workspace runner was not found.error
DELETE/workspaces/{workspace}/pipelines-config/runners/{runner_uuid}Delete workspace runner
Parameters
NameInRequiredType
workspacepathyesstring
runner_uuidpathyesstring
Responses
StatusDescriptionSchema
204The workspace runner was deleted.
404The workspace runner was not found.error
GET/workspaces/{workspace}/pipelines-config/variablesList variables for a workspace
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The found workspace level variables.paginated_pipeline_variables
POST/workspaces/{workspace}/pipelines-config/variablesCreate a variable for a workspace
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
201The created variable.pipeline_variable
404The workspace does not exist.error
409A variable with the provided key already exists.error
GET/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}Get variable for a workspace
Parameters
NameInRequiredType
workspacepathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
200The variable.pipeline_variable
404The workspace or variable with the given UUID was not found.error
PUT/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}Update variable for a workspace
Parameters
NameInRequiredType
workspacepathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
200The variable was updated.pipeline_variable
404The workspace or the variable was not found.error
DELETE/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}Delete a variable for a workspace
Parameters
NameInRequiredType
workspacepathyesstring
variable_uuidpathyesstring
Responses
StatusDescriptionSchema
204The variable was deleted
404The workspace or the variable with the provided UUID does not exist.error
Projects16

Bitbucket Cloud projects make it easier for teams to focus on a goal, product, or process by organizing their repositories.

POST/workspaces/{workspace}/projectsCreate a project in a workspace
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
201A new project has been created.project
403The user requesting to create a project does not have the necessary permissions.error
404A workspace doesn't exist at this location.error
GET/workspaces/{workspace}/projects/{project_key}Get a project for a workspace
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The project that is part of a workspace.project
401The request wasn't authenticated.error
403The requesting user isn't authorized to access the project.error
404A project isn't hosted at this location.error
PUT/workspaces/{workspace}/projects/{project_key}Update a project for a workspace
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The existing project is has been updated.project
201A new project has been created.project
403The requesting user isn't authorized to update or create the project.error
404A workspace doesn't exist at the location. Note that the project's absence from this location doesn't raise a 404, since a PUT at a non-existent location can be used to create a new project.error
DELETE/workspaces/{workspace}/projects/{project_key}Delete a project for a workspace
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Successful deletion.
403The requesting user isn't authorized to delete the project or the project isn't empty.error
404A project isn't hosted at this location.error
GET/workspaces/{workspace}/projects/{project_key}/default-reviewersList the default reviewers in a project
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The list of project default reviewerspaginated_default_reviewer_and_type
403If the authenticated user does not have admin access to the projecterror
404If the workspace or project does not exist at this locationerror
GET/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}Get a default reviewer
Parameters
NameInRequiredType
project_keypathyesstring
selected_userpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The specified user that is a default revieweruser
400If the specified user is not a default reviewer for the projecterror
403If the authenticated user does not have admin access to the projecterror
404If the specified user, project, or workspace does not existerror
PUT/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}Add the specific user as a default reviewer for the project
Parameters
NameInRequiredType
project_keypathyesstring
selected_userpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The specified user was added as a project default revieweruser
400If the specified user cannot be added as a default reviewer for the projecterror
403If the authenticated user does not have admin access to the projecterror
404If the specified user, project, or workspace does not existerror
DELETE/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}Remove the specific user from the project's default reviewers
Parameters
NameInRequiredType
project_keypathyesstring
selected_userpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204The specified user was removed from the list of project default reviewers
400If the specified user is not a default reviewer for the projecterror
403If the authenticated user does not have admin access to the projecterror
404If the specified user, project, or workspace does not existerror
GET/workspaces/{workspace}/projects/{project_key}/permissions-config/groupsList explicit group permissions for a project
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Paginated list of project group permissionspaginated_project_group_permissions
401The user couldn't be authenticated.error
403The user doesn't have admin access to the project.error
404One or both of the workspace and project don't exist for the given identifiers or the requesting user is not authenticatederror
GET/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}Get an explicit group permission for a project
Parameters
NameInRequiredType
group_slugpathyesstring
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Project group permissionproject_group_permission
401The user couldn't be authenticated.error
403The user doesn't have admin access to the project.error
404One or more of the workspace, project, and group doesn't exist for the given identifiers or the requesting user is not authenticatederror
PUT/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}Update an explicit group permission for a project
Parameters
NameInRequiredType
group_slugpathyesstring
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Project group permission updated.project_group_permission
400No permission value was provided or the value is invalid(not one of read, write, create-repo, or admin).error
401The user couldn't be authenticated.error
402You have reached your plan's user limit and must upgrade before giving access to additional users.error
403The requesting user isn't an admin of the project, or the authentication method was not via app password.error
404One or more of the workspace, project, and group doesn't exist for the given identifiers or the requesting user is not authenticatederror
DELETE/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}Delete an explicit group permission for a project
Parameters
NameInRequiredType
group_slugpathyesstring
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204The project group permission was deleted and no content returned.
401The user couldn't be authenticated.error
403The requesting user isn't an admin of the project, or the authentication method was not via app password.error
404One or more of the workspace, project, and group doesn't exist for the given identifiers or the requesting user is not authenticatederror
GET/workspaces/{workspace}/projects/{project_key}/permissions-config/usersList explicit user permissions for a project
Parameters
NameInRequiredType
project_keypathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Paginated list of explicit user permissions.paginated_project_user_permissions
401The user couldn't be authenticated.error
403The user doesn't have admin access to the project.error
404One or both of the workspace and project don't exist for the given identifiers or the requesting user is not authenticatederror
GET/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}Get an explicit user permission for a project
Parameters
NameInRequiredType
project_keypathyesstring
selected_user_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Explicit user permission for user and projectproject_user_permission
401The user couldn't be authenticated.error
403The requesting user isn't an admin of the project.error
404One or more of the workspace, project, and selected user doesn't exist for the given identifiers or the requesting user is not authenticatederror
PUT/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}Update an explicit user permission for a project
Parameters
NameInRequiredType
project_keypathyesstring
selected_user_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Explicit user permission updatedproject_user_permission
400No permission value was provided or the value is invalid (not one of read, write, create-repo, or admin)error
401The user couldn't be authenticated.error
402You have reached your plan's user limit and must upgrade before giving access to additional users.error
403The requesting user isn't an admin of the project, or the authentication method was not via app password.error
404One or more of the workspace, project, and selected user doesn't exist for the given identifiers or the requesting user is not authenticatederror
DELETE/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}Delete an explicit user permission for a project
Parameters
NameInRequiredType
project_keypathyesstring
selected_user_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204The project user permission was deleted and no content returned.
401The user couldn't be authenticated.error
403The requesting user isn't an admin of the project, or the authentication method was not via app password.error
404One or more of the workspace, project, and selected user doesn't exist for the given identifiers or the requesting user is not authenticatederror
Pullrequests37

Pull requests are a feature that makes it easier for developers to collaborate using Bitbucket. They provide a user-friendly web interface for discussing proposed changes before integrating them into the official project.

GET/repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequestsList pull requests that contain a commit
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
pagequerynointeger
pagelenquerynointeger
Responses
StatusDescriptionSchema
200The paginated list of pull requests.paginated_pullrequests
202The repository's pull requests are still being indexed.paginated_pullrequests
404Either the repository does not exist, or pull request commit links have not yet been indexed.error
GET/repositories/{workspace}/{repo_slug}/default-reviewersList default reviewers
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The paginated list of default reviewerspaginated_accounts
403If the authenticated user does not have access to view the default reviewerserror
GET/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}Get a default reviewer
Parameters
NameInRequiredType
repo_slugpathyesstring
target_usernamepathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The specified user is a default revieweraccount
403If the authenticated user does not have access to check if the specified user is a default reviewererror
404If the specified user does not exist or is not a default reviewererror
PUT/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}Add a user to the default reviewers
Parameters
NameInRequiredType
repo_slugpathyesstring
target_usernamepathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The specified user was successfully added to the default reviewersaccount
400If the authenticated user tried to add a team, bot user, or user without access to the repository to the default reviewerserror
403If the authenticated user does not have permission to modify the default reviewerserror
404If the specified user does not existerror
DELETE/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}Remove a user from the default reviewers
Parameters
NameInRequiredType
repo_slugpathyesstring
target_usernamepathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204The specified user successfully removed from the default reviewers
403If the authenticated user does not have access modify the default reviewerserror
404If the specified user does not existerror
GET/repositories/{workspace}/{repo_slug}/effective-default-reviewersList effective default reviewers
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The paginated list of effective default reviewerspaginated_default_reviewer_and_type
403If the authenticated user does not have access to view the default reviewerserror
GET/repositories/{workspace}/{repo_slug}/pullrequestsList pull requests
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
statequerynostring
Responses
StatusDescriptionSchema
200All pull requests on the specified repository.paginated_pullrequests
401If the repository is private and the request was not authenticated.
404If the specified repository does not exist.error
POST/repositories/{workspace}/{repo_slug}/pullrequestsCreate a pull request
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonpullrequest

Responses
StatusDescriptionSchema
201The newly created pull request.pullrequest
400If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.error
401If the request was not authenticated.error
GET/repositories/{workspace}/{repo_slug}/pullrequests/activityList a pull request activity log
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The pull request activity log
401If the repository is private and the request was not authenticated.
404If the specified repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}Get a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The pull request objectpullrequest
401If the repository is private and the request was not authenticated.
404If the repository or pull request does not existerror
PUT/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}Update a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonpullrequest

Responses
StatusDescriptionSchema
200The updated pull requestpullrequest
400If the input document was invalid.error
401If the request was not authenticated.error
404If the repository or pull request id does not existerror
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/activityList a pull request activity log
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The pull request activity log
401If the repository is private and the request was not authenticated.
404If the specified repository does not exist.error
POST/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approveApprove a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The `participant` object recording that the authenticated user approved the pull request.participant
401The request wasn't authenticated.error
404The specified pull request or the repository does not exist.error
DELETE/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approveUnapprove a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204An empty response indicating the authenticated user's approval has been withdrawn.
400Pull request cannot be unapproved because the pull request has already been merged.error
401The request wasn't authenticated.error
404The specified pull request or the repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commentsList comments on a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of comments made on the given pull request, in chronological order.paginated_pullrequest_comments
403If the authenticated user does not have access to the pull request.error
404If the pull request does not exist.error
POST/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commentsCreate a comment on a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonpullrequest_comment (required)

Responses
StatusDescriptionSchema
201The newly created comment.pullrequest_comment
403If the authenticated user does not have access to the pull request.error
404If the pull request does not exist.error
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}Get a comment on a pull request
Parameters
NameInRequiredType
comment_idpathyesinteger
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The comment.pullrequest_comment
403If the authenticated user does not have access to the pull request.error
404If the comment does not exist.error
PUT/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}Update a comment on a pull request
Parameters
NameInRequiredType
comment_idpathyesinteger
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonpullrequest_comment (required)

Responses
StatusDescriptionSchema
200The updated comment.pullrequest_comment
403If the authenticated user does not have access to the comment.error
404If the comment does not exist.error
DELETE/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}Delete a comment on a pull request
Parameters
NameInRequiredType
comment_idpathyesinteger
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Successful deletion.
403If the authenticated user does not have access to delete the comment.error
404If the comment does not exist.error
POST/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolveResolve a comment thread
Parameters
NameInRequiredType
comment_idpathyesinteger
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The comment resolution details.comment_resolution
403If the authenticated user does not have access to the pull request, if the provided comment is not a top-level comment, or if the comment is not on the diff.error
404If the comment does not exist.error
409If the comment has already been resolved.error
DELETE/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolveReopen a comment thread
Parameters
NameInRequiredType
comment_idpathyesinteger
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204The comment is reopened.
403If the authenticated user does not have access to the pull request, or if the provided comment is not a top-level comment.error
404If the comment does not exist, or if the comment has not been resolvederror
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commitsList commits on a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of commits made on the given pull request, in chronological order. This list will be empty if the source branch no longer exists.
403If the authenticated user does not have access to the pull request.error
404If the pull request does not exist or the source branch is from a forked repository which no longer exists.error
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/conflictsGet file conflicts for a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
302Redirects to the [repository file conflicts](/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-file-conflicts-spec-get) with the revspec that corresponds to the pull request.
POST/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/declineDecline a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The pull request was successfully declined.pullrequest
555If the decline took too long and timed out. In this case the caller should retry the request later.error
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffList changes in a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
302Redirects to the [repository diff](/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diff-spec-get) with the revspec that corresponds to the pull request.
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstatGet the diff stat for a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
302Redirects to the [repository diffstat](/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get) with the revspec that corresponds to pull request.
POST/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/mergeMerge a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
asyncquerynoboolean
Request body

application/jsonpullrequest_merge_parameters

Responses
StatusDescriptionSchema
200The pull request object.pullrequest
202In the Location header, the URL to poll for the pull request merge status
409Unable to merge because one of the refs involved changed while attempting to merge
555If the merge took too long and timed out. In this case the caller should retry the request latererror
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge/task-status/{task_id}Get the merge task status for a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
task_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Returns a task status if the merge is either pending or successful, and if it is successful, a pull request
400If the provided task ID does not relate to this pull request, or if something went wrong during the merge operation
403The user making the request does not have permission to the repo and is different from the user who queued the task
409Unable to merge because one of the refs involved changed while attempting to merge
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/patchGet the patch for a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
302Redirects to the [repository patch](/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-patch-spec-get) with the revspec that corresponds to pull request.
POST/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changesRequest changes for a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The `participant` object recording that the authenticated user requested changes on the pull request.participant
400Pull request changes cannot be requested because the pull request has already been merged.error
401The request wasn't authenticated.error
404The specified pull request or the repository does not exist.error
DELETE/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changesRemove change request for a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204An empty response indicating the authenticated user's request for change has been withdrawn.
400Pull request requested changes cannot be removed because the pull request has already been merged.error
401The request wasn't authenticated.error
404The specified pull request or the repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statusesList commit statuses for a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200A paginated list of all commit statuses for this pull request.paginated_commitstatuses
401If the repository is private and the request was not authenticated.
404If the specified repository or pull request does not exist.error
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasksList tasks on a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
qquerynostring
sortquerynostring
pagelenquerynointeger
Responses
StatusDescriptionSchema
200A paginated list of pull request tasks for the given pull request.paginated_tasks
400If the user provides an invalid filter, sort, or fields query parameter.error
403If the authenticated user does not have access to the pull request.error
404If the pull request does not exist.error
POST/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasksCreate a task on a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonpullrequest_task_create (required)

Responses
StatusDescriptionSchema
201The newly created task.pullrequest_comment_task
400There is a missing required field in the request or the task content is blank.error
403If the authenticated user does not have access to the pull request.error
404If the pull request does not exist.error
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}Get a task on a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
task_idpathyesinteger
workspacepathyesstring
Responses
StatusDescriptionSchema
200The task.pullrequest_comment_task
403If the authenticated user does not have access to the pull request.error
404If the task does not exist.error
PUT/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}Update a task on a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
task_idpathyesinteger
workspacepathyesstring
Request body

application/jsonpullrequest_task_update (required)

Responses
StatusDescriptionSchema
200The updated task.pullrequest_comment_task
400There is a missing required field in the request or the task content is blank.error
403If the authenticated user does not have access to the pull request.error
404If the task does not exist.error
DELETE/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}Delete a task on a pull request
Parameters
NameInRequiredType
pull_request_idpathyesinteger
repo_slugpathyesstring
task_idpathyesinteger
workspacepathyesstring
Responses
StatusDescriptionSchema
204Successful deletion.
403If the authenticated user does not have access to delete the task.error
404If the task does not exist.error
Refs9

The refs resource allows you access branches and tags in a repository. By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running "$ git show-ref". Note that this follows simple lexical ordering of the ref names.

GET/repositories/{workspace}/{repo_slug}/refsList branches and tags
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200A paginated list of refs matching any filter criteria that were provided.paginated_refs
403If the repository is private and the authenticated user does not have access to it. error
404The specified repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/refs/branchesList open branches
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200A paginated list of branches matching any filter criteria that were provided.paginated_branches
403If the repository is private and the authenticated user does not have access to it. error
404The specified repository does not exist.error
POST/repositories/{workspace}/{repo_slug}/refs/branchesCreate a branch
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
201The newly created branch object.branch
403If the repository is private and the authenticated user does not have access to it. error
404The specified repository or branch does not exist.error
GET/repositories/{workspace}/{repo_slug}/refs/branches/{name}Get a branch
Parameters
NameInRequiredType
namepathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The branch object.branch
403If the repository is private and the authenticated user does not have access to it. error
404The specified repository or branch does not exist.error
DELETE/repositories/{workspace}/{repo_slug}/refs/branches/{name}Delete a branch
Parameters
NameInRequiredType
namepathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates that the specified branch was successfully deleted.
403If the repository is private and the authenticated user does not have access to it. error
404The specified repository or branch does not exist.error
GET/repositories/{workspace}/{repo_slug}/refs/tagsList tags
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200A paginated list of tags matching any filter criteria that were provided.paginated_tags
403If the repository is private and the authenticated user does not have access to it. error
404The specified repository does not exist.error
POST/repositories/{workspace}/{repo_slug}/refs/tagsCreate a tag
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsontag (required)

Responses
StatusDescriptionSchema
201The newly created tag.tag
400If the target hash is missing, ambiguous, or invalid, or if the name is not provided.error
GET/repositories/{workspace}/{repo_slug}/refs/tags/{name}Get a tag
Parameters
NameInRequiredType
namepathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The tag object.tag
403If the repository is private and the authenticated user does not have access to it. error
404The specified repository or tag does not exist.error
DELETE/repositories/{workspace}/{repo_slug}/refs/tags/{name}Delete a tag
Parameters
NameInRequiredType
namepathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates the specified tag was successfully deleted.
403If the repository is private and the authenticated user does not have access to it. error
404The specified repository or tag does not exist.error
Reports9

Code insights provides reports, annotations, and metrics to help you and your team improve code quality in pull requests throughout the code review process. Some of the available code insights are static analysis reports, security scan results, artifact links, unit tests, and build status.

GET/repositories/{workspace}/{repo_slug}/commit/{commit}/reportsList reports
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
Responses
StatusDescriptionSchema
200OKpaginated_reports
GET/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}Get a report
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
reportIdpathyesstring
Responses
StatusDescriptionSchema
200OKreport
404The report with the given ID was not found.error
PUT/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}Create or update a report
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
reportIdpathyesstring
Request body

application/jsonreport (required)

Responses
StatusDescriptionSchema
200OKreport
400The provided Report object is malformed or incomplete.error
DELETE/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}Delete a report
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
reportIdpathyesstring
Responses
StatusDescriptionSchema
204No content
GET/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotationsList annotations
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
reportIdpathyesstring
Responses
StatusDescriptionSchema
200OKpaginated_annotations
POST/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotationsBulk create or update annotations
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
reportIdpathyesstring
Request body

application/json (required)

Responses
StatusDescriptionSchema
200OK
GET/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}Get an annotation
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
reportIdpathyesstring
annotationIdpathyesstring
Responses
StatusDescriptionSchema
200OKreport_annotation
404The annotation with the given ID was not found.error
PUT/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}Create or update an annotation
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
reportIdpathyesstring
annotationIdpathyesstring
Request body

application/jsonreport_annotation (required)

Responses
StatusDescriptionSchema
200OKreport_annotation
400The provided Annotation object is malformed or incomplete.error
DELETE/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}Delete an annotation
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
reportIdpathyesstring
annotationIdpathyesstring
Responses
StatusDescriptionSchema
204No content
Repositories26

A Git repository is a virtual storage of your project. It allows you to save versions of your code, which you can access when needed. The repo resource allows you to access public repos, or repos that belong to a specific workspace.

GET/repositoriesList public repositories
Parameters
NameInRequiredType
afterquerynostring
rolequerynostring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200All public repositories.paginated_repositories
GET/repositories/{workspace}List repositories in a workspace
Parameters
NameInRequiredType
workspacepathyesstring
rolequerynostring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200The repositories owned by the specified account.paginated_repositories
404If the specified account does not exist.error
410If the specified account marked as spam.error
GET/repositories/{workspace}/{repo_slug}Get a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The repository object.repository
403If the repository is private and the authenticated user does not have access to it.error
404If no repository exists at this location.error
POST/repositories/{workspace}/{repo_slug}Create a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonrepository

Responses
StatusDescriptionSchema
200The newly created repository.repository
400If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.error
401If the request was not authenticated.error
PUT/repositories/{workspace}/{repo_slug}Update a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonrepository

Responses
StatusDescriptionSchema
200The existing repository has been updatedrepository
201A new repository has been createdrepository
400If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.error
401If the request was not authenticated.error
DELETE/repositories/{workspace}/{repo_slug}Delete a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
redirect_toquerynostring
Responses
StatusDescriptionSchema
204Indicates successful deletion.
403If the caller either does not have admin access to the repository, or the repository is set to read-only.error
404If the repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/forksList repository forks
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
rolequerynostring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200All forks.paginated_repositories
POST/repositories/{workspace}/{repo_slug}/forksFork a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Request body

application/jsonrepository

Responses
StatusDescriptionSchema
201The newly created fork.repository
GET/repositories/{workspace}/{repo_slug}/hooksList webhooks for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The paginated list of installed webhooks.paginated_webhook_subscriptions
403If the authenticated user does not have permission to access the webhooks.error
404If the repository does not exist.error
POST/repositories/{workspace}/{repo_slug}/hooksCreate a webhook for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
201If the webhook was registered successfully.webhook_subscription
403If the authenticated user does not have permission to install webhooks on the specified repository.error
404If the repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/hooks/{uid}Get a webhook for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
uidpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The webhook subscription object.webhook_subscription
404If the webhook or repository does not exist.error
PUT/repositories/{workspace}/{repo_slug}/hooks/{uid}Update a webhook for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
uidpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The webhook subscription object.webhook_subscription
403If the authenticated user does not have permission to update the webhook.error
404If the webhook or repository does not exist.error
DELETE/repositories/{workspace}/{repo_slug}/hooks/{uid}Delete a webhook for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
uidpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204When the webhook was deleted successfully
403If the authenticated user does not have permission to delete the webhook.error
404If the webhook or repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/override-settingsRetrieve the inheritance state for repository settings
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The repository setting inheritance staterepository_inheritance_state
404If no repository exists at this locationerror
PUT/repositories/{workspace}/{repo_slug}/override-settingsSet the inheritance state for repository settings
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204The repository setting inheritance state was set and no content returned
404If no repository exists at this locationerror
GET/repositories/{workspace}/{repo_slug}/permissions-config/groupsList explicit group permissions for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Paginated of explicit group permissions on the repository.paginated_repository_group_permissions
401The user couldn't be authenticated.error
403The requesting user isn't an admin of the repository.error
404One or both of the workspace and repository doesn't exist for the given identifiers.error
GET/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}Get an explicit group permission for a repository
Parameters
NameInRequiredType
group_slugpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Group permission for group slug and repositoryrepository_group_permission
401The user couldn't be authenticated.error
403The requesting user isn't an admin of the repository.error
404The given user, workspace, and/or repository could not be founderror
PUT/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}Update an explicit group permission for a repository
Parameters
NameInRequiredType
group_slugpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Group permission updatedrepository_group_permission
400No permission value was provided or the value is invalid(not one of read, write, or admin)error
401The user couldn't be authenticated.error
402You have reached your plan's user limit and must upgrade before giving access to additional users.error
403The requesting user isn't an admin of the repository, or the authentication method was not via app password.error
404The workspace does not exist, the repository does not exist, or the group does not exist.error
DELETE/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}Delete an explicit group permission for a repository
Parameters
NameInRequiredType
group_slugpathyesstring
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Group permission deleted
401The user couldn't be authenticated.error
403The requesting user isn't an admin of the repository, or the authentication method was not via app password.error
404The workspace does not exist, the repository does not exist, or the group does not exist.error
GET/repositories/{workspace}/{repo_slug}/permissions-config/usersList explicit user permissions for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Paginated of explicit user permissions on the repository.paginated_repository_user_permissions
401The user couldn't be authenticated.error
403The requesting user isn't an admin of the repository.error
404No repository exists for the given repository slug and workspace.error
GET/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}Get an explicit user permission for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
selected_user_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Explicit user permission for user and repositoryrepository_user_permission
401The user couldn't be authenticated.error
403The requesting user isn't an admin of the repository.error
404One or both of the workspace and repository doesn't exist for the given identifiers.error
PUT/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}Update an explicit user permission for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
selected_user_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Explicit user permission updatedrepository_user_permission
400No permission value was provided or the value is invalid (not one of read, write, or admin), or the selected user is not a valid user to update.error
401The user couldn't be authenticated.error
402You have reached your plan's user limit and must upgrade before giving access to additional users.error
403The requesting user isn't an admin of the repository, or the authentication method was not via app password.error
404One or more of the workspace, repository, and selected user doesn't exist for the given identifiers.error
DELETE/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}Delete an explicit user permission for a repository
Parameters
NameInRequiredType
repo_slugpathyesstring
selected_user_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204The repository user permission was deleted and no content returned.
401The user couldn't be authenticated.error
403The requesting user isn't an admin of the repository, or the authentication method was not via app password.error
404One or more of the workspace, repository, and user doesn't exist for the given identifiers.error
GET/repositories/{workspace}/{repo_slug}/watchersList repositories watchers
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of all the watchers on the specified repository.paginated_accounts
GET/user/permissions/repositoriesList repository permissions for a user
Parameters
NameInRequiredType
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200Repository permissions for the repositories a caller has explicit access to.paginated_repository_permissions
GET/user/workspaces/{workspace}/permissions/repositoriesList repository permissions in a workspace for a user
Parameters
NameInRequiredType
workspacepathyesstring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200The list of repository permissions for the authenticated user in the specified workspace.paginated_repository_permissions
400The request was invalid.error
401The request wasn't authenticated.error
403The requesting user does not have access to the workspace.error
SSH5

The SSH resource allows you to manage SSH keys.

GET/users/{selected_user}/ssh-keysList SSH keys
Parameters
NameInRequiredType
selected_userpathyesstring
Responses
StatusDescriptionSchema
200A list of the SSH keys associated with the account.paginated_ssh_user_keys
403If the specified user's keys are not accessible to the current user
404If the specified user does not existerror
POST/users/{selected_user}/ssh-keysAdd a new SSH key
Parameters
NameInRequiredType
selected_userpathyesstring
expires_onquerynostring
Request body

application/jsonssh_account_key

Responses
StatusDescriptionSchema
201The newly created SSH key.ssh_account_key
400If the submitted key or related value is invaliderror
403If the current user does not have permission to add a key for the specified user
404If the specified user does not existerror
GET/users/{selected_user}/ssh-keys/{key_id}Get a SSH key
Parameters
NameInRequiredType
key_idpathyesstring
selected_userpathyesstring
Responses
StatusDescriptionSchema
200The specific SSH key matching the user and UUIDssh_account_key
403If the specified user or key is not accessible to the current user
404If the specified user or key does not existerror
PUT/users/{selected_user}/ssh-keys/{key_id}Update a SSH key
Parameters
NameInRequiredType
key_idpathyesstring
selected_userpathyesstring
Request body

application/jsonssh_account_key

Responses
StatusDescriptionSchema
200The newly updated SSH key.ssh_account_key
400If the submitted key or related value is invaliderror
403If the current user does not have permission to add a key for the specified user
404If the specified user does not existerror
DELETE/users/{selected_user}/ssh-keys/{key_id}Delete a SSH key
Parameters
NameInRequiredType
key_idpathyesstring
selected_userpathyesstring
Responses
StatusDescriptionSchema
204The key has been deleted
400If the submitted key or related value is invaliderror
403If the current user does not have permission to add a key for the specified user
404If the specified user does not existerror
Snippets25

Snippets allow you share code segments or files with yourself, members of your workspace, or the world. Like pull requests, repositories and workspaces, the full set of snippets is defined by what the current user has access to. This includes all snippets owned by any of the workspaces the user is a member of, or snippets by other users that the current user is either watching or has collaborated on (for instance by commenting on it).

GET/snippetsList snippets
Parameters
NameInRequiredType
rolequerynostring
Responses
StatusDescriptionSchema
200A paginated list of snippets.paginated_snippets
404If the snippet does not exist.error
POST/snippetsCreate a snippet
Responses
StatusDescriptionSchema
201The newly created snippet object.snippet
401If the request was not authenticatederror
GET/snippets/{workspace}List snippets in a workspace
Parameters
NameInRequiredType
workspacepathyesstring
rolequerynostring
Responses
StatusDescriptionSchema
200A paginated list of snippets.paginated_snippets
404If the user does not exist.error
POST/snippets/{workspace}Create a snippet for a workspace
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
201The newly created snippet object.snippet
401If the request was not authenticatederror
403If the authenticated user does not have permission to create snippets in the specified workspace.error
GET/snippets/{workspace}/{encoded_id}Get a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The snippet object.snippet
401If the snippet is private and the request was not authenticated.error
403If authenticated user does not have access to the private snippet.error
404If the snippet does not exist.error
410If the snippet marked as spam.error
PUT/snippets/{workspace}/{encoded_id}Update a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The updated snippet object.snippet
401If the snippet is private and the request was not authenticated.error
403If authenticated user does not have permission to update the private snippet.error
404If the snippet does not exist.error
DELETE/snippets/{workspace}/{encoded_id}Delete a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204If the snippet was deleted successfully.
401If the snippet is private and the request was not authenticated.error
403If authenticated user does not have permission to delete the private snippet.error
404If the snippet does not exist.error
GET/snippets/{workspace}/{encoded_id}/commentsList comments on a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of snippet comments, ordered by creation date.paginated_snippet_comments
403If the authenticated user does not have access to the snippet.error
404If the snippet does not exist.error
POST/snippets/{workspace}/{encoded_id}/commentsCreate a comment on a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
workspacepathyesstring
Request body

application/jsonsnippet_comment (required)

Responses
StatusDescriptionSchema
201The newly created comment.snippet_comment
403If the authenticated user does not have access to the snippet.error
404If the snippet does not exist.error
GET/snippets/{workspace}/{encoded_id}/comments/{comment_id}Get a comment on a snippet
Parameters
NameInRequiredType
comment_idpathyesinteger
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The specified comment.snippet_comment
403If the authenticated user does not have access to the snippet.error
404If the comment or snippet does not exist.error
PUT/snippets/{workspace}/{encoded_id}/comments/{comment_id}Update a comment on a snippet
Parameters
NameInRequiredType
comment_idpathyesinteger
encoded_idpathyesstring
workspacepathyesstring
Request body

application/jsonsnippet_comment (required)

Responses
StatusDescriptionSchema
200The updated comment object.snippet_comment
403If the authenticated user does not have access to the snippet.error
404If the comment or snippet does not exist.error
DELETE/snippets/{workspace}/{encoded_id}/comments/{comment_id}Delete a comment on a snippet
Parameters
NameInRequiredType
comment_idpathyesinteger
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates the comment was deleted successfully.
403If the authenticated user is not the author of the comment.error
404If the comment or the snippet does not exist.error
GET/snippets/{workspace}/{encoded_id}/commitsList snippet changes
Parameters
NameInRequiredType
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The paginated list of snippet commits.paginated_snippet_commit
403If the authenticated user does not have access to the snippet.error
404If the snippet does not exist.error
GET/snippets/{workspace}/{encoded_id}/commits/{revision}Get a previous snippet change
Parameters
NameInRequiredType
encoded_idpathyesstring
revisionpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The specified snippet commit.snippet_commit
403If the authenticated user does not have access to the snippet.error
404If the commit or the snippet does not exist.error
GET/snippets/{workspace}/{encoded_id}/files/{path}Get a snippet's raw file at HEAD
Parameters
NameInRequiredType
encoded_idpathyesstring
pathpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
302A redirect to the most recent revision of the specified file.
403If the authenticated user does not have access to the snippet.error
404If the snippet does not exist.error
GET/snippets/{workspace}/{encoded_id}/watchCheck if the current user is watching a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204If the authenticated user is watching the snippet.
404If the snippet does not exist, or if the authenticated user is not watching the snippet.error
PUT/snippets/{workspace}/{encoded_id}/watchWatch a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates the authenticated user is now watching the snippet.
401If the request was not authenticated.error
404If the snippet does not exist.error
DELETE/snippets/{workspace}/{encoded_id}/watchStop watching a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204Indicates the user stopped watching the snippet successfully.
401If the request was not authenticated.error
404If the snippet does not exist.error
GET/snippets/{workspace}/{encoded_id}/watchersList users watching a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The paginated list of users watching this snippetpaginated_accounts
404If the snippet does not exist.error
GET/snippets/{workspace}/{encoded_id}/{node_id}Get a previous revision of a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
node_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The snippet object.snippet
401If the snippet is private and the request was not authenticated.error
403If authenticated user does not have access to the private snippet.error
404If the snippet, or the revision does not exist.error
PUT/snippets/{workspace}/{encoded_id}/{node_id}Update a previous revision of a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
node_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The updated snippet object.snippet
401If the snippet is private and the request was not authenticated.error
403If authenticated user does not have permission to update the private snippet.error
404If the snippet or the revision does not exist.error
405If `{node_id}` is not the latest revision.error
DELETE/snippets/{workspace}/{encoded_id}/{node_id}Delete a previous revision of a snippet
Parameters
NameInRequiredType
encoded_idpathyesstring
node_idpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204If the snippet was deleted successfully.
401If the snippet is private and the request was not authenticated.error
403If authenticated user does not have permission to delete the private snippet.error
404If the snippet does not exist.error
405If `{node_id}` is not the latest revision.error
GET/snippets/{workspace}/{encoded_id}/{node_id}/files/{path}Get a snippet's raw file
Parameters
NameInRequiredType
encoded_idpathyesstring
node_idpathyesstring
pathpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200Returns the contents of the specified file.
403If the authenticated user does not have access to the snippet.error
404If the file or snippet does not exist.error
GET/snippets/{workspace}/{encoded_id}/{revision}/diffGet snippet changes between versions
Parameters
NameInRequiredType
encoded_idpathyesstring
revisionpathyesstring
workspacepathyesstring
pathquerynostring
Responses
StatusDescriptionSchema
200The raw diff contents.
403If the authenticated user does not have access to the snippet.error
404If the snippet does not exist.error
GET/snippets/{workspace}/{encoded_id}/{revision}/patchGet snippet patch between versions
Parameters
NameInRequiredType
encoded_idpathyesstring
revisionpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The raw patch contents.
403If the authenticated user does not have access to the snippet.error
404If the snippet does not exist.error
Source4

Browse the source code in the repository and create new commits by uploading.

GET/repositories/{workspace}/{repo_slug}/filehistory/{commit}/{path}List commits that modified a file
Parameters
NameInRequiredType
commitpathyesstring
pathpathyesstring
repo_slugpathyesstring
workspacepathyesstring
renamesquerynostring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200A paginated list of commits that modified the specified filepaginated_files
404If the repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/srcGet the root directory of the main branch
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
formatquerynostring
Responses
StatusDescriptionSchema
200If the path matches a file, then the raw contents of the file are returned (unless the `format=meta` query parameter was provided, in which case a json document containing the file's meta data is returned). If the path matches a directory, then a paginated list of file and directory entries is returned (if the `format=meta` query parameter was provided, then the json document containing the directory's meta data is returned). paginated_treeentries
404If the path or commit in the URL does not exist.error
POST/repositories/{workspace}/{repo_slug}/srcCreate a commit by uploading a file
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
messagequerynostring
authorquerynostring
parentsquerynostring
filesquerynostring
branchquerynostring
Responses
StatusDescriptionSchema
201
403If the authenticated user does not have write or admin accesserror
404If the repository does not exist.error
GET/repositories/{workspace}/{repo_slug}/src/{commit}/{path}Get file or directory contents
Parameters
NameInRequiredType
commitpathyesstring
pathpathyesstring
repo_slugpathyesstring
workspacepathyesstring
formatquerynostring
qquerynostring
sortquerynostring
max_depthquerynointeger
Responses
StatusDescriptionSchema
200If the path matches a file, then the raw contents of the file are returned. If the `format=meta` query parameter is provided, a json document containing the file's meta data is returned. If the `format=rendered` query parameter is provided, the contents of the file in HTML-formated rendered markup is returned. If the path matches a directory, then a paginated list of file and directory entries is returned (if the `format=meta` query parameter was provided, then the json document containing the directory's meta data is returned.) paginated_treeentries
404If the path or commit in the URL does not exist.error
555If the call times out, possibly because the specified recursion depth is too large.error
Users4

The users resource allows you to access public information associated with a user account. Most resources in the users endpoint have been deprecated in favor of workspaces.

GET/userGet current user
Responses
StatusDescriptionSchema
200The current user.account
401When the request wasn't authenticated.error
GET/user/emailsList email addresses for current user
Responses
StatusDescriptionSchema
defaultUnexpected error.error
GET/user/emails/{email}Get an email address for current user
Parameters
NameInRequiredType
emailpathyesstring
Responses
StatusDescriptionSchema
defaultUnexpected error.error
GET/users/{selected_user}Get a user
Parameters
NameInRequiredType
selected_userpathyesstring
Responses
StatusDescriptionSchema
200The user objectaccount
404If no user exists for the specified UUID, or if the specified account is a team account, not a personal account.error
Webhooks2

Webhooks provide a way to configure Bitbucket Cloud to make requests to your server (or another external service) whenever certain events occur in Bitbucket Cloud. A webhook consists of: * A subject -- The resource that generates the events. Currently, this resource is the repository, user account, or team where you create the webhook. * One or more event -- The default event is a repository push, but you can select multiple events that can trigger the webhook. * A URL -- The endpoint where you want Bitbucket to send the event payloads when a matching event happens. There are two parts to getting a webhook to work: creating the webhook and triggering the webhook. After you create a webhook for an event, every time that event occurs, Bitbucket sends a payload request that describes the event to the specified URL. Thus, you can think of webhooks as a kind of notification system. Use webhooks to integrate applications with Bitbucket Cloud. The following use cases provides examples of when you would want to use webhooks: * Every time a user pushes commits in a repository, you may want to notify your CI server to start a build. * Every time a user pushes commits or creates a pull request, you may want to display a notification in your application.

GET/hook_eventsGet a webhook resource
Responses
StatusDescriptionSchema
200A mapping of resource/subject types pointing to their individual event types.subject_types
GET/hook_events/{subject_type}List subscribable webhook types
Parameters
NameInRequiredType
subject_typepathyesstring
Responses
StatusDescriptionSchema
200A paginated list of webhook types available to subscribe on.paginated_hook_events
404If an invalid `{subject_type}` value was specified.error
Workspaces18

A workspace is where you create repositories, collaborate on your code, and organize different streams of work in your Bitbucket Cloud account. Workspaces replace the use of teams and users in API calls.

GET/user/permissions/workspacesList workspaces for the current user
Parameters
NameInRequiredType
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200All of the workspace memberships for the authenticated user.paginated_workspace_memberships
401The request wasn't authenticated.error
GET/user/workspacesList workspaces for the current user
Parameters
NameInRequiredType
sortquerynostring
administratorquerynoboolean
Responses
StatusDescriptionSchema
200The list of workspaces accessible by the authenticated user.paginated_workspace_access
400The request was invalid.error
401The request wasn't authenticated.error
GET/user/workspaces/{workspace}/permissionGet user permission on a workspace
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The user that is part of a workspace.workspace_membership
401The request wasn't authenticated.error
403The requesting user does not have access to the workspace.error
GET/workspacesList workspaces for user
Parameters
NameInRequiredType
rolequerynostring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200The list of workspaces accessible by the authenticated user.paginated_workspaces
401The request wasn't authenticated.error
GET/workspaces/{workspace}Get a workspace
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The workspace.workspace
404If no workspace exists for the specified name or UUID.error
GET/workspaces/{workspace}/hooksList webhooks for a workspace
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The paginated list of installed webhooks.paginated_webhook_subscriptions
403If the authenticated user is not an owner on the specified workspace.error
404If the specified workspace does not exist.error
POST/workspaces/{workspace}/hooksCreate a webhook for a workspace
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
201If the webhook was registered successfully.webhook_subscription
403If the authenticated user does not have permission to install webhooks on the specified workspace.error
404If the specified workspace does not exist.error
GET/workspaces/{workspace}/hooks/{uid}Get a webhook for a workspace
Parameters
NameInRequiredType
uidpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The webhook subscription object.webhook_subscription
404If the webhook or workspace does not exist.error
PUT/workspaces/{workspace}/hooks/{uid}Update a webhook for a workspace
Parameters
NameInRequiredType
uidpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The webhook subscription object.webhook_subscription
403If the authenticated user does not have permission to update the webhook.error
404If the webhook or workspace does not exist.error
DELETE/workspaces/{workspace}/hooks/{uid}Delete a webhook for a workspace
Parameters
NameInRequiredType
uidpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
204When the webhook was deleted successfully
403If the authenticated user does not have permission to delete the webhook.error
404If the webhook or workspace does not exist.error
GET/workspaces/{workspace}/membersList users in a workspace
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The list of users that are part of a workspace.paginated_workspace_memberships
400When more than 90 emails were provided when querying by email.error
401The request wasn't authenticated.error
GET/workspaces/{workspace}/members/{member}Get user membership for a workspace
Parameters
NameInRequiredType
memberpathyesstring
workspacepathyesstring
Responses
StatusDescriptionSchema
200The user that is part of a workspace.workspace_membership
401The request wasn't authenticated.error
404A workspace cannot be found, or a user cannot be found, or the user is not a a member of the workspace.error
GET/workspaces/{workspace}/permissionsList user permissions in a workspace
Parameters
NameInRequiredType
workspacepathyesstring
qquerynostring
Responses
StatusDescriptionSchema
200The list of users that are part of a workspace, along with their permission.paginated_workspace_memberships
401The request wasn't authenticated.error
GET/workspaces/{workspace}/permissions/repositoriesList all repository permissions for a workspace
Parameters
NameInRequiredType
workspacepathyesstring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200List of workspace's repository permissions.paginated_repository_permissions
403The requesting user isn't an admin of the workspace.error
GET/workspaces/{workspace}/permissions/repositories/{repo_slug}List a repository permissions for a workspace
Parameters
NameInRequiredType
repo_slugpathyesstring
workspacepathyesstring
qquerynostring
sortquerynostring
Responses
StatusDescriptionSchema
200The repository permission for all users in this repository.paginated_repository_permissions
403The requesting user isn't an admin of the repository.error
GET/workspaces/{workspace}/projectsList projects in a workspace
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The list of projects in this workspace.paginated_projects
404A workspace doesn't exist at this location.error
GET/workspaces/{workspace}/pullrequests/{selected_user}List workspace pull requests for a user
Parameters
NameInRequiredType
selected_userpathyesstring
workspacepathyesstring
statequerynostring
Responses
StatusDescriptionSchema
200All pull requests authored by the specified user.paginated_pullrequests
404If the specified user does not exist.error
GET/workspaces/{workspace}/settings/gpg/public-keyGet the workspace system GPG public key(s)
Parameters
NameInRequiredType
workspacepathyesstring
Responses
StatusDescriptionSchema
200The system public GPG key(s).
401The request wasn't authenticated.error
403The requesting user is not a workspace member.error
404The workspace does not exist.error
Search3
GET/teams/{username}/search/codeSearch for code in a team's repositories
Parameters
NameInRequiredType
usernamepathyesstring
search_queryqueryyesstring
pagequerynointeger
pagelenquerynointeger
Responses
StatusDescriptionSchema
200Successful searchsearch_result_page
400If the search request was invalid due to one of the following reasons: * the specified type of target account doesn''t match the actual account type; * malformed pagination properties; * missing or malformed search query, in the latter case an error key will be returned in `error.data.key` property. error
404Search is not enabled for the requested team, navigate to [https://bitbucket.org/search](https://bitbucket.org/search) to turn it onerror
429Too many requests, try again latererror
GET/users/{selected_user}/search/codeSearch for code in a user's repositories
Parameters
NameInRequiredType
selected_userpathyesstring
search_queryqueryyesstring
pagequerynointeger
pagelenquerynointeger
Responses
StatusDescriptionSchema
200Successful searchsearch_result_page
400If the search request was invalid due to one of the following reasons: * the specified type of target account doesn''t match the actual account type; * malformed pagination properties; * missing or malformed search query, in the latter case an error key will be returned in `error.data.key` property. error
404Search is not enabled for the requested user, navigate to [https://bitbucket.org/search](https://bitbucket.org/search) to turn it onerror
429Too many requests, try again latererror
GET/workspaces/{workspace}/search/codeSearch for code in a workspace
Parameters
NameInRequiredType
workspacepathyesstring
search_queryqueryyesstring
pagequerynointeger
pagelenquerynointeger
Responses
StatusDescriptionSchema
200Successful searchsearch_result_page
400If the search request was invalid due to one of the following reasons: * the specified type of target account doesn''t match the actual account type; * malformed pagination properties; * missing or malformed search query, in the latter case an error key will be returned in `error.data.key` property. error
404Search is not enabled for the requested workspace, navigate to [https://bitbucket.org/search](https://bitbucket.org/search) to turn it onerror
429Too many requests, try again latererror
properties12
GET/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}Get a commit application property
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
200The value of the property.application_property
PUT/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}Update a commit application property
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
204An empty response.
DELETE/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}Delete a commit application property
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
commitpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
204An empty response.
GET/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}Get a repository application property
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
200The value of the property.application_property
PUT/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}Update a repository application property
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
204An empty response.
DELETE/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}Delete a repository application property
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
204An empty response.
GET/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}Get a pull request application property
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pullrequest_idpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
200The value of the property.application_property
PUT/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}Update a pull request application property
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pullrequest_idpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
204An empty response.
DELETE/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}Delete a pull request application property
Parameters
NameInRequiredType
workspacepathyesstring
repo_slugpathyesstring
pullrequest_idpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
204An empty response.
GET/users/{selected_user}/properties/{app_key}/{property_name}Get a user application property
Parameters
NameInRequiredType
selected_userpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
200The value of the property.application_property
PUT/users/{selected_user}/properties/{app_key}/{property_name}Update a user application property
Parameters
NameInRequiredType
selected_userpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
204An empty response.
DELETE/users/{selected_user}/properties/{app_key}/{property_name}Delete a user application property
Parameters
NameInRequiredType
selected_userpathyesstring
app_keypathyesstring
property_namepathyesstring
Responses
StatusDescriptionSchema
204An empty response.

Try it

Developer reference

Base URLhttps://api.bitbucket.org/2.0
Rate limit

Bitbucket Cloud tracks usage on a rolling one-hour window, by IP for anonymous calls and by user for authenticated ones, with limits that vary by operation rather than one flat cap: anonymous requests are capped at 60/hour across all resources, while authenticated traffic gets 60,000/hour for Git operations over HTTPS or SSH, 5,000/hour for raw file downloads, 1,500 files/hour for repository archive downloads, 1,000-10,000/hour for general repository-data endpoints (e.g. commits), 1,000/hour for webhook data, 2,000/hour for application-property calls, and 100/minute for sending invitations. Workspaces with 100+ paid Standard or Premium seats get scaled capacity beyond the defaults, capped at a 10,000/hour maximum.

Key endpoints
  • GET/repositories/{workspace}/{repo_slug}
  • GET/repositories/{workspace}/{repo_slug}/pullrequests
  • POST/repositories/{workspace}/{repo_slug}/pullrequests
  • GET/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}
  • GET/repositories/{workspace}/{repo_slug}/commits