Bitbucket API client

Bitbucket API client for Browser and Node.js

branching model

branching_model - get

Return the branching model as applied to the repository. This view is read-only. The branching model settings can be changed using the settings API. [API Docs]

get
/repositories/{workspace}/{repo_slug}/branching-model
const { data, headers } = await bitbucket.branching_model.get({ repo_slug, workspace, fields })
bitbucket.branching_model.get({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

branching_model - getForProject

Return the branching model set at the project level. This view is read-only. The branching model settings can be changed using the settings API. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/branching-model
const { data, headers } = await bitbucket.branching_model.getForProject({ project_key, workspace, fields })
bitbucket.branching_model.getForProject({ project_key, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

branching_model - getSettings

Return the branching model configuration for a repository. The returned object: [API Docs]

get
/repositories/{workspace}/{repo_slug}/branching-model/settings
const { data, headers } = await bitbucket.branching_model.getSettings({ repo_slug, workspace, fields })
bitbucket.branching_model.getSettings({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

branching_model - getSettingsForProject

Return the branching model configuration for a project. The returned object: [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/branching-model/settings
const { data, headers } = await bitbucket.branching_model.getSettingsForProject({ project_key, workspace, fields })
bitbucket.branching_model.getSettingsForProject({ project_key, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

branching_model - updateSettings

Update the branching model configuration for a repository. [API Docs]

put
/repositories/{workspace}/{repo_slug}/branching-model/settings
const { data, headers } = await bitbucket.branching_model.updateSettings({ _body, repo_slug, workspace })
bitbucket.branching_model.updateSettings({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

branching_model - updateSettingsForProject

Update the branching model configuration for a project. [API Docs]

put
/workspaces/{workspace}/projects/{project_key}/branching-model/settings
const { data, headers } = await bitbucket.branching_model.updateSettingsForProject({ project_key, workspace })
bitbucket.branching_model.updateSettingsForProject({ project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

branchrestrictions

branchrestrictions - create

Creates a new branch restriction rule for a repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/branch-restrictions
const { data, headers } = await bitbucket.branchrestrictions.create({ _body, repo_slug, workspace })
bitbucket.branchrestrictions.create({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new rule

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

branchrestrictions - delete

Deletes an existing branch restriction rule. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
const { data, headers } = await bitbucket.branchrestrictions.delete({ id, repo_slug, workspace })
bitbucket.branchrestrictions.delete({ id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
id string

The restriction rule's id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

branchrestrictions - get

Returns a specific branch restriction rule. [API Docs]

get
/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
const { data, headers } = await bitbucket.branchrestrictions.get({ id, repo_slug, workspace, fields })
bitbucket.branchrestrictions.get({ id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
id string

The restriction rule's id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

branchrestrictions - list

Returns a paginated list of all branch restrictions on the repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/branch-restrictions
const { data, headers } = await bitbucket.branchrestrictions.list({ kind, pattern, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.branchrestrictions.list({ kind, pattern, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
kind optional string

Branch restrictions of this type

pattern optional string

Branch restrictions applied to branches of this pattern

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

branchrestrictions - update

Updates an existing branch restriction rule. [API Docs]

put
/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
const { data, headers } = await bitbucket.branchrestrictions.update({ _body, id, repo_slug, workspace })
bitbucket.branchrestrictions.update({ _body, id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new version of the existing rule

id string

The restriction rule's id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

commits

commits - bulkCreateOrUpdateAnnotations

Bulk upload of annotations. Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations. [API Docs]

post
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations
const { data, headers } = await bitbucket.commits.bulkCreateOrUpdateAnnotations({ _body, commit, repo_slug, reportId, workspace })
bitbucket.commits.bulkCreateOrUpdateAnnotations({ _body, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The annotations to create or update

commit string

The commit for which to retrieve reports.

repo_slug string

The repository.

reportId string

Uuid or external-if of the report for which to get annotations for.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

commits - createApproval

Approve the specified commit as the authenticated user. [API Docs]

post
/repositories/{workspace}/{repo_slug}/commit/{commit}/approve
const { data, headers } = await bitbucket.commits.createApproval({ commit, repo_slug, workspace })
bitbucket.commits.createApproval({ commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

commits - createComment

Creates new comment on the specified commit. [API Docs]

post
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments
const { data, headers } = await bitbucket.commits.createComment({ _body, commit, repo_slug, workspace })
bitbucket.commits.createComment({ _body, commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The specified comment.

commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

commits - createOrUpdateAnnotation

Creates or updates an individual annotation for the specified report. Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
const { data, headers } = await bitbucket.commits.createOrUpdateAnnotation({ _body, annotationId, commit, repo_slug, reportId, workspace })
bitbucket.commits.createOrUpdateAnnotation({ _body, annotationId, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The annotation to create or update

annotationId string

Either the uuid or external-id of the annotation.

commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

commits - createOrUpdateReport

Creates or updates a report for the specified commit. To upload a report, make sure to generate an ID that is unique across all reports for that commit. If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-001. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
const { data, headers } = await bitbucket.commits.createOrUpdateReport({ _body, commit, repo_slug, reportId, workspace })
bitbucket.commits.createOrUpdateReport({ _body, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The report to create or update

commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

commits - deleteAnnotation

Deletes a single Annotation matching the provided ID. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
const { data, headers } = await bitbucket.commits.deleteAnnotation({ annotationId, commit, repo_slug, reportId, workspace })
bitbucket.commits.deleteAnnotation({ annotationId, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
annotationId string

Either the uuid or external-id of the annotation.

commit string

The commit the annotation belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the annotation.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

commits - deleteApproval

Redact the authenticated user's approval of the specified commit. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/approve
const { data, headers } = await bitbucket.commits.deleteApproval({ commit, repo_slug, workspace })
bitbucket.commits.deleteApproval({ commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

commits - deleteComment

Deletes the specified commit comment. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
const { data, headers } = await bitbucket.commits.deleteComment({ comment_id, commit, repo_slug, workspace })
bitbucket.commits.deleteComment({ comment_id, commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

commits - deleteReport

Deletes a single Report matching the provided ID. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
const { data, headers } = await bitbucket.commits.deleteReport({ commit, repo_slug, reportId, workspace })
bitbucket.commits.deleteReport({ commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

commits - get

Returns the specified commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}
const { data, headers } = await bitbucket.commits.get({ commit, repo_slug, workspace, fields })
bitbucket.commits.get({ commit, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

commits - getAnnotation

Returns a single Annotation matching the provided ID. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
const { data, headers } = await bitbucket.commits.getAnnotation({ annotationId, commit, repo_slug, reportId, workspace, fields })
bitbucket.commits.getAnnotation({ annotationId, commit, repo_slug, reportId, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
annotationId string

Either the uuid or external-id of the annotation.

commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

commits - getAnnotationsForReport

Returns a paginated list of Annotations for a specified report. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations
const { data, headers } = await bitbucket.commits.getAnnotationsForReport({ commit, repo_slug, reportId, workspace, page, pagelen, q, sort, fields })
bitbucket.commits.getAnnotationsForReport({ commit, repo_slug, reportId, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit for which to retrieve reports.

repo_slug string

The repository.

reportId string

Uuid or external-if of the report for which to get annotations for.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

commits - getComment

Returns the specified commit comment. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
const { data, headers } = await bitbucket.commits.getComment({ comment_id, commit, repo_slug, workspace, fields })
bitbucket.commits.getComment({ comment_id, commit, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

commits - getDiff

Produces a raw git-style diff. [API Docs]

get
/repositories/{workspace}/{repo_slug}/diff/{spec}
const { data, headers } = await bitbucket.commits.getDiff({ binary, context, ignore_whitespace, merge, path, renames, repo_slug, spec, topic, workspace, fields })
bitbucket.commits.getDiff({ binary, context, ignore_whitespace, merge, path, renames, repo_slug, spec, topic, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
binary optional boolean

Generate diffs that include binary files, true if omitted.

context optional integer

Generate diffs with lines of context instead of the usual three.

ignore_whitespace optional boolean

Generate diffs that ignore whitespace.

merge optional boolean

This parameter is deprecated. The 'topic' parameter should be used instead. The 'merge' and 'topic' parameters cannot be both used at the same time.

path optional string

Limit the diff to a particular file (this parameter can be repeated for multiple paths).

renames optional boolean

Whether to perform rename detection, true if omitted.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

spec string

A commit SHA (e.g. 3a8b42) or a commit range using double dot notation (e.g. 3a8b42..9ff173).

topic optional boolean

If true, returns 2-way 'three-dot' diff. This is a diff between the source commit and the merge base of the source commit and the destination commit. If false, a simple 'two dot' diff between the source and destination is returned.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

commits - getPatch

Produces a raw patch for a single commit (diffed against its first parent), or a patch-series for a revspec of 2 commits (e.g. 3a8b42..9ff173 where the first commit represents the source and the second commit the destination). [API Docs]

get
/repositories/{workspace}/{repo_slug}/patch/{spec}
const { data, headers } = await bitbucket.commits.getPatch({ repo_slug, spec, workspace, fields })
bitbucket.commits.getPatch({ repo_slug, spec, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

spec string

A commit SHA (e.g. 3a8b42) or a commit range using double dot notation (e.g. 3a8b42..9ff173).

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

commits - getReport

Returns a single Report matching the provided ID. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
const { data, headers } = await bitbucket.commits.getReport({ commit, repo_slug, reportId, workspace, fields })
bitbucket.commits.getReport({ commit, repo_slug, reportId, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

commits - getReportsForCommit

Returns a paginated list of Reports linked to this commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports
const { data, headers } = await bitbucket.commits.getReportsForCommit({ commit, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.commits.getReportsForCommit({ commit, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit for which to retrieve reports.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

commits - list

These are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of git log. Like these tools, the DAG can be filtered. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commits
const { data, headers } = await bitbucket.commits.list({ exclude, include, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.commits.list({ exclude, include, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
exclude optional string
include optional string
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

commits - listAlt

[API Docs]

post
/repositories/{workspace}/{repo_slug}/commits{?page,pagelen,q,sort}
const { data, headers } = await bitbucket.commits.listAlt({ exclude, include, repo_slug, workspace, page, pagelen, q, sort })
bitbucket.commits.listAlt({ exclude, include, repo_slug, workspace, page, pagelen, q, sort }).then(({ data, headers }) => {})

Parameters

Field Type Description
exclude optional string
include optional string
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string

commits - listAt

These are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of git log. Like these tools, the DAG can be filtered. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commits/{revision}
const { data, headers } = await bitbucket.commits.listAt({ exclude, include, repo_slug, revision, workspace, page, pagelen, q, sort, fields })
bitbucket.commits.listAt({ exclude, include, repo_slug, revision, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
exclude optional string
include optional string
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

revision string

A commit SHA1 or ref name.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

commits - listAtAlt

[API Docs]

post
/repositories/{workspace}/{repo_slug}/commits/{revision}{?page,pagelen,q,sort}
const { data, headers } = await bitbucket.commits.listAtAlt({ exclude, include, repo_slug, revision, workspace, page, pagelen, q, sort })
bitbucket.commits.listAtAlt({ exclude, include, repo_slug, revision, workspace, page, pagelen, q, sort }).then(({ data, headers }) => {})

Parameters

Field Type Description
exclude optional string
include optional string
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

revision string

A commit SHA1 or ref name.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string

commits - listComments

Returns the commit's comments. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments
const { data, headers } = await bitbucket.commits.listComments({ commit, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.commits.listComments({ commit, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting.

fields optional string

commits - updateComment

Used to update the contents of a comment. Only the content of the comment can be updated. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
const { data, headers } = await bitbucket.commits.updateComment({ _body, comment_id, commit, repo_slug, workspace })
bitbucket.commits.updateComment({ _body, comment_id, commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated comment.

comment_id integer

The id of the comment.

commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

commitstatuses

commitstatuses - createBuildStatus

Creates a new build status against the specified commit. [API Docs]

post
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build
const { data, headers } = await bitbucket.commitstatuses.createBuildStatus({ _body, commit, repo_slug, workspace })
bitbucket.commitstatuses.createBuildStatus({ _body, commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The new commit status object.

commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

commitstatuses - getBuildStatus

Returns the specified build status for a commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}
const { data, headers } = await bitbucket.commitstatuses.getBuildStatus({ commit, key, repo_slug, workspace, fields })
bitbucket.commitstatuses.getBuildStatus({ commit, key, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

key string

The build status' unique key

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

commitstatuses - list

Returns all statuses (e.g. build results) for a specific commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses
const { data, headers } = await bitbucket.commitstatuses.list({ commit, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.commitstatuses.list({ commit, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. Defaults to created_on.

fields optional string

commitstatuses - listPullRequestStatuses

Returns all statuses (e.g. build results) for the given pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses
const { data, headers } = await bitbucket.commitstatuses.listPullRequestStatuses({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.commitstatuses.listPullRequestStatuses({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. Defaults to created_on.

fields optional string

commitstatuses - updateBuildStatus

Used to update the current status of a build status object on the specific commit. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}
const { data, headers } = await bitbucket.commitstatuses.updateBuildStatus({ _body, commit, key, repo_slug, workspace })
bitbucket.commitstatuses.updateBuildStatus({ _body, commit, key, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The updated build status object

commit string

The commit's SHA1.

key string

The build status' unique key

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

deploy

deploy - createKey

Create a new deploy key in a repository. Note: If authenticating a deploy key with an OAuth consumer, any changes to the OAuth consumer will subsequently invalidate the deploy key. [API Docs]

post
/repositories/{workspace}/{repo_slug}/deploy-keys
const { data, headers } = await bitbucket.deploy.createKey({ key, label, repo_slug, workspace })
bitbucket.deploy.createKey({ key, label, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
key string
label string
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

deploy - deleteKey

This deletes a deploy key from a repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
const { data, headers } = await bitbucket.deploy.deleteKey({ key_id, repo_slug, workspace })
bitbucket.deploy.deleteKey({ key_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The key ID matching the deploy key.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

deploy - getKey

Returns the deploy key belonging to a specific key. [API Docs]

get
/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
const { data, headers } = await bitbucket.deploy.getKey({ key_id, repo_slug, workspace, fields })
bitbucket.deploy.getKey({ key_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The key ID matching the deploy key.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

deploy - listKeys

Returns all deploy-keys belonging to a repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/deploy-keys
const { data, headers } = await bitbucket.deploy.listKeys({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.deploy.listKeys({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

deploy - updateKey

Create a new deploy key in a repository. [API Docs]

put
/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
const { data, headers } = await bitbucket.deploy.updateKey({ key_id, repo_slug, workspace })
bitbucket.deploy.updateKey({ key_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The key ID matching the deploy key.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

deployments

deployments - createEnvironment

Create an environment. [API Docs]

post
/repositories/{workspace}/{repo_slug}/environments
const { data, headers } = await bitbucket.deployments.createEnvironment({ _body, repo_slug, workspace })
bitbucket.deployments.createEnvironment({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The environment to create.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

deployments - createProjectDeployKey

Create a new deploy key in a project. [API Docs]

post
/workspaces/{workspace}/projects/{project_key}/deploy-keys
const { data, headers } = await bitbucket.deployments.createProjectDeployKey({ project_key, workspace })
bitbucket.deployments.createProjectDeployKey({ project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

deployments - deleteEnvironmentForRepository

Delete an environment [API Docs]

delete
/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}
const { data, headers } = await bitbucket.deployments.deleteEnvironmentForRepository({ environment_uuid, repo_slug, workspace })
bitbucket.deployments.deleteEnvironmentForRepository({ environment_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
environment_uuid string

The environment UUID.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

deployments - deleteProjectDeployKey

This deletes a deploy key from a project. [API Docs]

delete
/workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id}
const { data, headers } = await bitbucket.deployments.deleteProjectDeployKey({ key_id, project_key, workspace })
bitbucket.deployments.deleteProjectDeployKey({ key_id, project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The key ID matching the project deploy key.

project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

deployments - get

Retrieve a deployment [API Docs]

get
/repositories/{workspace}/{repo_slug}/deployments/{deployment_uuid}
const { data, headers } = await bitbucket.deployments.get({ deployment_uuid, repo_slug, workspace, fields })
bitbucket.deployments.get({ deployment_uuid, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
deployment_uuid string

The deployment UUID.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

deployments - getEnvironment

Retrieve an environment [API Docs]

get
/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}
const { data, headers } = await bitbucket.deployments.getEnvironment({ environment_uuid, repo_slug, workspace, fields })
bitbucket.deployments.getEnvironment({ environment_uuid, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
environment_uuid string

The environment UUID.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

deployments - getProjectDeployKey

Returns the deploy key belonging to a specific key ID. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id}
const { data, headers } = await bitbucket.deployments.getProjectDeployKey({ key_id, project_key, workspace, fields })
bitbucket.deployments.getProjectDeployKey({ key_id, project_key, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The key ID matching the project deploy key.

project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

deployments - list

Find deployments [API Docs]

get
/repositories/{workspace}/{repo_slug}/deployments
const { data, headers } = await bitbucket.deployments.list({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.deployments.list({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

deployments - listEnvironments

Find environments [API Docs]

get
/repositories/{workspace}/{repo_slug}/environments
const { data, headers } = await bitbucket.deployments.listEnvironments({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.deployments.listEnvironments({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

deployments - listProjectDeployKeys

Returns all deploy keys belonging to a project. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/deploy-keys
const { data, headers } = await bitbucket.deployments.listProjectDeployKeys({ project_key, workspace, page, pagelen, q, sort, fields })
bitbucket.deployments.listProjectDeployKeys({ project_key, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

deployments - updateEnvironment

Update an environment [API Docs]

post
/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}/changes
const { data, headers } = await bitbucket.deployments.updateEnvironment({ environment_uuid, repo_slug, workspace })
bitbucket.deployments.updateEnvironment({ environment_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
environment_uuid string

The environment UUID.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

downloads

downloads - create

Upload new download artifacts. [API Docs]

post
/repositories/{workspace}/{repo_slug}/downloads
const { data, headers } = await bitbucket.downloads.create({ _body, repo_slug, workspace })
bitbucket.downloads.create({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

downloads - delete

Deletes the specified download artifact from the repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/downloads/{filename}
const { data, headers } = await bitbucket.downloads.delete({ filename, repo_slug, workspace })
bitbucket.downloads.delete({ filename, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
filename string

Name of the file.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

downloads - get

Return a redirect to the contents of a download artifact. [API Docs]

get
/repositories/{workspace}/{repo_slug}/downloads/{filename}
const { data, headers } = await bitbucket.downloads.get({ filename, repo_slug, workspace, fields })
bitbucket.downloads.get({ filename, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
filename string

Name of the file.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

downloads - list

Returns a list of download links associated with the repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/downloads
const { data, headers } = await bitbucket.downloads.list({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.downloads.list({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

hook events

hook_events - getAllSubjectTypes

Returns the webhook resource or subject types on which webhooks can be registered. [API Docs]

get
/hook_events
const { data, headers } = await bitbucket.hook_events.getAllSubjectTypes({ fields })
bitbucket.hook_events.getAllSubjectTypes({ fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
fields optional string

hook_events - list

Returns a paginated list of all valid webhook events for the specified entity. The team and user webhooks are deprecated, and you should use workspace instead. For more information, see the announcement.* [API Docs]

get
/hook_events/{subject_type}
const { data, headers } = await bitbucket.hook_events.list({ subject_type, page, pagelen, q, sort, fields })
bitbucket.hook_events.list({ subject_type, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
subject_type string

A resource or subject type.

Allowed values: repository, workspace

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

issue tracker

issue_tracker - create

Creates a new issue. [API Docs]

post
/repositories/{workspace}/{repo_slug}/issues
const { data, headers } = await bitbucket.issue_tracker.create({ _body, repo_slug, workspace })
bitbucket.issue_tracker.create({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new issue. The only required element is title. All other elements can be omitted from the body.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - createAttachments

Upload new issue attachments. [API Docs]

post
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments
const { data, headers } = await bitbucket.issue_tracker.createAttachments({ _body, issue_id, repo_slug, workspace })
bitbucket.issue_tracker.createAttachments({ _body, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - createChange

Makes a change to the specified issue. [API Docs]

post
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes
const { data, headers } = await bitbucket.issue_tracker.createChange({ _body, issue_id, repo_slug, workspace })
bitbucket.issue_tracker.createChange({ _body, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new issue state change. The only required elements are changes.[].new. All other elements can be omitted from the body.

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - createComment

Creates a new issue comment. [API Docs]

post
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments
const { data, headers } = await bitbucket.issue_tracker.createComment({ _body, issue_id, repo_slug, workspace })
bitbucket.issue_tracker.createComment({ _body, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new issue comment object.

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - createVote

Vote for this issue. [API Docs]

put
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote
const { data, headers } = await bitbucket.issue_tracker.createVote({ issue_id, repo_slug, workspace })
bitbucket.issue_tracker.createVote({ issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - createWatch

Start watching this issue. [API Docs]

put
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch
const { data, headers } = await bitbucket.issue_tracker.createWatch({ issue_id, repo_slug, workspace })
bitbucket.issue_tracker.createWatch({ issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - delete

Deletes the specified issue. This requires write access to the repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/issues/{issue_id}
const { data, headers } = await bitbucket.issue_tracker.delete({ issue_id, repo_slug, workspace })
bitbucket.issue_tracker.delete({ issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - deleteAttachment

Deletes an attachment. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}
const { data, headers } = await bitbucket.issue_tracker.deleteAttachment({ issue_id, path, repo_slug, workspace })
bitbucket.issue_tracker.deleteAttachment({ issue_id, path, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

path string

Path to the file.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - deleteComment

Deletes the specified comment. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}
const { data, headers } = await bitbucket.issue_tracker.deleteComment({ comment_id, issue_id, repo_slug, workspace })
bitbucket.issue_tracker.deleteComment({ comment_id, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - deleteVote

Retract your vote. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote
const { data, headers } = await bitbucket.issue_tracker.deleteVote({ issue_id, repo_slug, workspace })
bitbucket.issue_tracker.deleteVote({ issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - deleteWatch

Stop watching this issue. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch
const { data, headers } = await bitbucket.issue_tracker.deleteWatch({ issue_id, repo_slug, workspace })
bitbucket.issue_tracker.deleteWatch({ issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - get

Returns the specified issue. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}
const { data, headers } = await bitbucket.issue_tracker.get({ issue_id, repo_slug, workspace, fields })
bitbucket.issue_tracker.get({ issue_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

issue_tracker - getAttachment

Returns the contents of the specified file attachment. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}
const { data, headers } = await bitbucket.issue_tracker.getAttachment({ issue_id, path, repo_slug, workspace, fields })
bitbucket.issue_tracker.getAttachment({ issue_id, path, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

path string

Path to the file.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

issue_tracker - getChange

Returns the specified issue change object. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes/{change_id}
const { data, headers } = await bitbucket.issue_tracker.getChange({ change_id, issue_id, repo_slug, workspace, fields })
bitbucket.issue_tracker.getChange({ change_id, issue_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
change_id string

The issue change id

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

issue_tracker - getComment

Returns the specified issue comment object. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}
const { data, headers } = await bitbucket.issue_tracker.getComment({ comment_id, issue_id, repo_slug, workspace, fields })
bitbucket.issue_tracker.getComment({ comment_id, issue_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

issue_tracker - getComponent

Returns the specified issue tracker component object. [API Docs]

get
/repositories/{workspace}/{repo_slug}/components/{component_id}
const { data, headers } = await bitbucket.issue_tracker.getComponent({ component_id, repo_slug, workspace, fields })
bitbucket.issue_tracker.getComponent({ component_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
component_id integer

The component's id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

issue_tracker - getMilestone

Returns the specified issue tracker milestone object. [API Docs]

get
/repositories/{workspace}/{repo_slug}/milestones/{milestone_id}
const { data, headers } = await bitbucket.issue_tracker.getMilestone({ milestone_id, repo_slug, workspace, fields })
bitbucket.issue_tracker.getMilestone({ milestone_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
milestone_id integer

The milestone's id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

issue_tracker - getVersion

Returns the specified issue tracker version object. [API Docs]

get
/repositories/{workspace}/{repo_slug}/versions/{version_id}
const { data, headers } = await bitbucket.issue_tracker.getVersion({ repo_slug, version_id, workspace, fields })
bitbucket.issue_tracker.getVersion({ repo_slug, version_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

version_id integer

The version's id

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

issue_tracker - getVote

Check whether the authenticated user has voted for this issue. A 204 status code indicates that the user has voted, while a 404 implies they haven't. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote
const { data, headers } = await bitbucket.issue_tracker.getVote({ issue_id, repo_slug, workspace, fields })
bitbucket.issue_tracker.getVote({ issue_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

issue_tracker - getWatch

Indicated whether or not the authenticated user is watching this issue. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch
const { data, headers } = await bitbucket.issue_tracker.getWatch({ issue_id, repo_slug, workspace, fields })
bitbucket.issue_tracker.getWatch({ issue_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

issue_tracker - list

Returns the issues in the issue tracker. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues
const { data, headers } = await bitbucket.issue_tracker.list({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.issue_tracker.list({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

issue_tracker - listAttachments

Returns all attachments for this issue. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments
const { data, headers } = await bitbucket.issue_tracker.listAttachments({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.issue_tracker.listAttachments({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

issue_tracker - listChanges

Returns the list of all changes that have been made to the specified issue. Changes are returned in chronological order with the oldest change first. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes
const { data, headers } = await bitbucket.issue_tracker.listChanges({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.issue_tracker.listChanges({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response. See filtering and sorting for details.

sort optional string

Name of a response property to sort results. See filtering and sorting for details.

fields optional string

issue_tracker - listComments

Returns a paginated list of all comments that were made on the specified issue. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments
const { data, headers } = await bitbucket.issue_tracker.listComments({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.issue_tracker.listComments({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string
fields optional string

issue_tracker - listComponents

Returns the components that have been defined in the issue tracker. [API Docs]

get
/repositories/{workspace}/{repo_slug}/components
const { data, headers } = await bitbucket.issue_tracker.listComponents({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.issue_tracker.listComponents({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

issue_tracker - listMilestones

Returns the milestones that have been defined in the issue tracker. [API Docs]

get
/repositories/{workspace}/{repo_slug}/milestones
const { data, headers } = await bitbucket.issue_tracker.listMilestones({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.issue_tracker.listMilestones({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

issue_tracker - listVersions

Returns the versions that have been defined in the issue tracker. [API Docs]

get
/repositories/{workspace}/{repo_slug}/versions
const { data, headers } = await bitbucket.issue_tracker.listVersions({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.issue_tracker.listVersions({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

issue_tracker - update

Modifies the issue. [API Docs]

put
/repositories/{workspace}/{repo_slug}/issues/{issue_id}
const { data, headers } = await bitbucket.issue_tracker.update({ _body, issue_id, repo_slug, workspace })
bitbucket.issue_tracker.update({ _body, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

issue_tracker - updateComment

Updates the content of the specified issue comment. Note that only the content.raw field can be modified. [API Docs]

put
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}
const { data, headers } = await bitbucket.issue_tracker.updateComment({ _body, comment_id, issue_id, repo_slug, workspace })
bitbucket.issue_tracker.updateComment({ _body, comment_id, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated comment.

comment_id integer

The id of the comment.

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pipelines

pipelines - create

Endpoint to create and initiate a pipeline. There are a couple of different options to initiate a pipeline, where the payload of the request will determine which type of pipeline will be instantiated.

Trigger a Pipeline for a branch

One way to trigger pipelines is by specifying the branch for which you want to trigger a pipeline. The specified branch will be used to determine which pipeline definition from the bitbucket-pipelines.yml file will be applied to initiate the pipeline. The pipeline will then do a clone of the repository and checkout the latest revision of the specified branch. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pipelines
const { data, headers } = await bitbucket.pipelines.create({ _body, repo_slug, workspace })
bitbucket.pipelines.create({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The pipeline to initiate.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - createDeploymentVariable

Create a deployment environment level variable. [API Docs]

post
/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables
const { data, headers } = await bitbucket.pipelines.createDeploymentVariable({ _body, environment_uuid, repo_slug, workspace })
bitbucket.pipelines.createDeploymentVariable({ _body, environment_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The variable to create

environment_uuid string

The environment.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - createKnownHost

Create a repository level known host. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
const { data, headers } = await bitbucket.pipelines.createKnownHost({ _body, repo_slug, workspace })
bitbucket.pipelines.createKnownHost({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The known host to create.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - createPipelineVariableForWorkspace

Create a workspace level variable. [API Docs]

post
/workspaces/{workspace}/pipelines-config/variables
const { data, headers } = await bitbucket.pipelines.createPipelineVariableForWorkspace({ _body, workspace })
bitbucket.pipelines.createPipelineVariableForWorkspace({ _body, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The variable to create.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - createSchedule

Create a schedule for the given repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules
const { data, headers } = await bitbucket.pipelines.createSchedule({ _body, repo_slug, workspace })
bitbucket.pipelines.createSchedule({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The schedule to create.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - createVariable

Create a repository level variable. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pipelines_config/variables
const { data, headers } = await bitbucket.pipelines.createVariable({ _body, repo_slug, workspace })
bitbucket.pipelines.createVariable({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The variable to create.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - createVariableForTeam

Create an account level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

post
/teams/{username}/pipelines_config/variables
const { data, headers } = await bitbucket.pipelines.createVariableForTeam({ _body, username })
bitbucket.pipelines.createVariableForTeam({ _body, username }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The variable to create.

username string

The account.

pipelines - createVariableForUser

Create a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

post
/users/{selected_user}/pipelines_config/variables
const { data, headers } = await bitbucket.pipelines.createVariableForUser({ _body, selected_user })
bitbucket.pipelines.createVariableForUser({ _body, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The variable to create.

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

pipelines - deleteDeploymentVariable

Delete a deployment environment level variable. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.deleteDeploymentVariable({ environment_uuid, repo_slug, variable_uuid, workspace })
bitbucket.pipelines.deleteDeploymentVariable({ environment_uuid, repo_slug, variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
environment_uuid string

The environment.

repo_slug string

The repository.

variable_uuid string

The UUID of the variable to delete.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - deleteKnownHost

Delete a repository level known host. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
const { data, headers } = await bitbucket.pipelines.deleteKnownHost({ known_host_uuid, repo_slug, workspace })
bitbucket.pipelines.deleteKnownHost({ known_host_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
known_host_uuid string

The UUID of the known host to delete.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - deletePipelineVariableForWorkspace

Delete a workspace level variable. [API Docs]

delete
/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.deletePipelineVariableForWorkspace({ variable_uuid, workspace })
bitbucket.pipelines.deletePipelineVariableForWorkspace({ variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
variable_uuid string

The UUID of the variable to delete.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - deleteRepositoryPipelineCache

Delete a repository cache. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}
const { data, headers } = await bitbucket.pipelines.deleteRepositoryPipelineCache({ cache_uuid, repo_slug, workspace })
bitbucket.pipelines.deleteRepositoryPipelineCache({ cache_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
cache_uuid string

The UUID of the cache to delete.

repo_slug string

The repository.

workspace string

The account.

pipelines - deleteRepositoryPipelineCaches

Delete repository cache versions by name. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines-config/caches
const { data, headers } = await bitbucket.pipelines.deleteRepositoryPipelineCaches({ name, repo_slug, workspace })
bitbucket.pipelines.deleteRepositoryPipelineCaches({ name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
name string

The cache name.

repo_slug string

The repository.

workspace string

The account.

pipelines - deleteSchedule

Delete a schedule. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
const { data, headers } = await bitbucket.pipelines.deleteSchedule({ repo_slug, schedule_uuid, workspace })
bitbucket.pipelines.deleteSchedule({ repo_slug, schedule_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

schedule_uuid string

The uuid of the schedule.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - deleteSshKeyPair

Delete the repository SSH key pair. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
const { data, headers } = await bitbucket.pipelines.deleteSshKeyPair({ repo_slug, workspace })
bitbucket.pipelines.deleteSshKeyPair({ repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - deleteVariable

Delete a repository level variable. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.deleteVariable({ repo_slug, variable_uuid, workspace })
bitbucket.pipelines.deleteVariable({ repo_slug, variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

variable_uuid string

The UUID of the variable to delete.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - deleteVariableForTeam

Delete a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

delete
/teams/{username}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.deleteVariableForTeam({ username, variable_uuid })
bitbucket.pipelines.deleteVariableForTeam({ username, variable_uuid }).then(({ data, headers }) => {})

Parameters

Field Type Description
username string

The account.

variable_uuid string

The UUID of the variable to delete.

pipelines - deleteVariableForUser

Delete an account level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

delete
/users/{selected_user}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.deleteVariableForUser({ selected_user, variable_uuid })
bitbucket.pipelines.deleteVariableForUser({ selected_user, variable_uuid }).then(({ data, headers }) => {})

Parameters

Field Type Description
selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

variable_uuid string

The UUID of the variable to delete.

pipelines - get

Retrieve a specified pipeline [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}
const { data, headers } = await bitbucket.pipelines.get({ pipeline_uuid, repo_slug, workspace, fields })
bitbucket.pipelines.get({ pipeline_uuid, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The pipeline UUID.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getConfig

Retrieve the repository pipelines configuration. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config
const { data, headers } = await bitbucket.pipelines.getConfig({ repo_slug, workspace, fields })
bitbucket.pipelines.getConfig({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

The account.

fields optional string

pipelines - getKnownHost

Retrieve a repository level known host. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
const { data, headers } = await bitbucket.pipelines.getKnownHost({ known_host_uuid, repo_slug, workspace, fields })
bitbucket.pipelines.getKnownHost({ known_host_uuid, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
known_host_uuid string

The UUID of the known host to retrieve.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getOIDCConfiguration

This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/ [API Docs]

get
/workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configuration
const { data, headers } = await bitbucket.pipelines.getOIDCConfiguration({ workspace, fields })
bitbucket.pipelines.getOIDCConfiguration({ workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getOIDCKeys

This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/ [API Docs]

get
/workspaces/{workspace}/pipelines-config/identity/oidc/keys.json
const { data, headers } = await bitbucket.pipelines.getOIDCKeys({ workspace, fields })
bitbucket.pipelines.getOIDCKeys({ workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getPipelineContainerLog

Retrieve the log file for a build container or service container. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}
const { data, headers } = await bitbucket.pipelines.getPipelineContainerLog({ log_uuid, pipeline_uuid, repo_slug, step_uuid, workspace, fields })
bitbucket.pipelines.getPipelineContainerLog({ log_uuid, pipeline_uuid, repo_slug, step_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
log_uuid string

For the main build container specify the step UUID; for a service container specify the service container UUID

pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getPipelineTestReportTestCaseReasons

Get test case reasons (output) for a given test case in a step of a pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasons
const { data, headers } = await bitbucket.pipelines.getPipelineTestReportTestCaseReasons({ pipeline_uuid, repo_slug, step_uuid, test_case_uuid, workspace, fields })
bitbucket.pipelines.getPipelineTestReportTestCaseReasons({ pipeline_uuid, repo_slug, step_uuid, test_case_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

test_case_uuid string

The UUID of the test case.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getPipelineTestReportTestCases

Get test cases for a given step of a pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases
const { data, headers } = await bitbucket.pipelines.getPipelineTestReportTestCases({ pipeline_uuid, repo_slug, step_uuid, workspace, fields })
bitbucket.pipelines.getPipelineTestReportTestCases({ pipeline_uuid, repo_slug, step_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getPipelineTestReports

Get a summary of test reports for a given step of a pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports
const { data, headers } = await bitbucket.pipelines.getPipelineTestReports({ pipeline_uuid, repo_slug, step_uuid, workspace, fields })
bitbucket.pipelines.getPipelineTestReports({ pipeline_uuid, repo_slug, step_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getPipelineVariableForWorkspace

Retrieve a workspace level variable. [API Docs]

get
/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.getPipelineVariableForWorkspace({ variable_uuid, workspace, fields })
bitbucket.pipelines.getPipelineVariableForWorkspace({ variable_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
variable_uuid string

The UUID of the variable to retrieve.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getPipelineVariablesForWorkspace

Find workspace level variables. [API Docs]

get
/workspaces/{workspace}/pipelines-config/variables
const { data, headers } = await bitbucket.pipelines.getPipelineVariablesForWorkspace({ workspace, page, pagelen, q, sort, fields })
bitbucket.pipelines.getPipelineVariablesForWorkspace({ workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - getRepositoryPipelineCacheContentURI

Retrieve the URI of the content of the specified cache. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uri
const { data, headers } = await bitbucket.pipelines.getRepositoryPipelineCacheContentURI({ cache_uuid, repo_slug, workspace, fields })
bitbucket.pipelines.getRepositoryPipelineCacheContentURI({ cache_uuid, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
cache_uuid string

The UUID of the cache.

repo_slug string

The repository.

workspace string

The account.

fields optional string

pipelines - getRepositoryPipelineCaches

Retrieve the repository pipelines caches. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines-config/caches
const { data, headers } = await bitbucket.pipelines.getRepositoryPipelineCaches({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pipelines.getRepositoryPipelineCaches({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

The account.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - getSchedule

Retrieve a schedule by its UUID. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
const { data, headers } = await bitbucket.pipelines.getSchedule({ repo_slug, schedule_uuid, workspace, fields })
bitbucket.pipelines.getSchedule({ repo_slug, schedule_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

schedule_uuid string

The uuid of the schedule.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getSshKeyPair

Retrieve the repository SSH key pair excluding the SSH private key. The private key is a write only field and will never be exposed in the logs or the REST API. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
const { data, headers } = await bitbucket.pipelines.getSshKeyPair({ repo_slug, workspace, fields })
bitbucket.pipelines.getSshKeyPair({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getStep

Retrieve a given step of a pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}
const { data, headers } = await bitbucket.pipelines.getStep({ pipeline_uuid, repo_slug, step_uuid, workspace, fields })
bitbucket.pipelines.getStep({ pipeline_uuid, repo_slug, step_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getStepLog

Retrieve the log file for a given step of a pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/log
const { data, headers } = await bitbucket.pipelines.getStepLog({ pipeline_uuid, repo_slug, step_uuid, workspace, fields })
bitbucket.pipelines.getStepLog({ pipeline_uuid, repo_slug, step_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getVariable

Retrieve a repository level variable. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.getVariable({ repo_slug, variable_uuid, workspace, fields })
bitbucket.pipelines.getVariable({ repo_slug, variable_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

variable_uuid string

The UUID of the variable to retrieve.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

pipelines - getVariableForTeam

Retrieve a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

get
/teams/{username}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.getVariableForTeam({ username, variable_uuid, fields })
bitbucket.pipelines.getVariableForTeam({ username, variable_uuid, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
username string

The account.

variable_uuid string

The UUID of the variable to retrieve.

fields optional string

pipelines - getVariableForUser

Retrieve a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

get
/users/{selected_user}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.getVariableForUser({ selected_user, variable_uuid, fields })
bitbucket.pipelines.getVariableForUser({ selected_user, variable_uuid, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

variable_uuid string

The UUID of the variable to retrieve.

fields optional string

pipelines - list

Find pipelines [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines
const { data, headers } = await bitbucket.pipelines.list({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pipelines.list({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - listDeploymentVariables

Find deployment environment level variables. [API Docs]

get
/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables
const { data, headers } = await bitbucket.pipelines.listDeploymentVariables({ environment_uuid, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pipelines.listDeploymentVariables({ environment_uuid, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
environment_uuid string

The environment.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - listKnownHosts

Find repository level known hosts. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
const { data, headers } = await bitbucket.pipelines.listKnownHosts({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pipelines.listKnownHosts({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - listScheduleExecutions

Retrieve the executions of a given schedule. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executions
const { data, headers } = await bitbucket.pipelines.listScheduleExecutions({ repo_slug, schedule_uuid, workspace, page, pagelen, q, sort, fields })
bitbucket.pipelines.listScheduleExecutions({ repo_slug, schedule_uuid, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

schedule_uuid string

The uuid of the schedule.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - listSchedules

Retrieve the configured schedules for the given repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules
const { data, headers } = await bitbucket.pipelines.listSchedules({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pipelines.listSchedules({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - listSteps

Find steps for the given pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps
const { data, headers } = await bitbucket.pipelines.listSteps({ pipeline_uuid, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pipelines.listSteps({ pipeline_uuid, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - listVariablesForRepo

Find repository level variables. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/variables
const { data, headers } = await bitbucket.pipelines.listVariablesForRepo({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pipelines.listVariablesForRepo({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - listVariablesForTeam

Find account level variables. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

get
/teams/{username}/pipelines_config/variables
const { data, headers } = await bitbucket.pipelines.listVariablesForTeam({ username, page, pagelen, q, sort, fields })
bitbucket.pipelines.listVariablesForTeam({ username, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
username string

The account.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - listVariablesForUser

Find user level variables. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

get
/users/{selected_user}/pipelines_config/variables
const { data, headers } = await bitbucket.pipelines.listVariablesForUser({ selected_user, page, pagelen, q, sort, fields })
bitbucket.pipelines.listVariablesForUser({ selected_user, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pipelines - stop

Signal the stop of a pipeline and all of its steps that not have completed yet. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/stopPipeline
const { data, headers } = await bitbucket.pipelines.stop({ pipeline_uuid, repo_slug, workspace })
bitbucket.pipelines.stop({ pipeline_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - updateBuildNumber

Update the next build number that should be assigned to a pipeline. The next build number that will be configured has to be strictly higher than the current latest build number for this repository. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config/build_number
const { data, headers } = await bitbucket.pipelines.updateBuildNumber({ _body, repo_slug, workspace })
bitbucket.pipelines.updateBuildNumber({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The build number to update.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - updateConfig

Update the pipelines configuration for a repository. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config
const { data, headers } = await bitbucket.pipelines.updateConfig({ _body, repo_slug, workspace })
bitbucket.pipelines.updateConfig({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated repository pipelines configuration.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - updateDeploymentVariable

Update a deployment environment level variable. [API Docs]

put
/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.updateDeploymentVariable({ _body, environment_uuid, repo_slug, variable_uuid, workspace })
bitbucket.pipelines.updateDeploymentVariable({ _body, environment_uuid, repo_slug, variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated deployment variable.

environment_uuid string

The environment.

repo_slug string

The repository.

variable_uuid string

The UUID of the variable to update.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - updateKnownHost

Update a repository level known host. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
const { data, headers } = await bitbucket.pipelines.updateKnownHost({ _body, known_host_uuid, repo_slug, workspace })
bitbucket.pipelines.updateKnownHost({ _body, known_host_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated known host.

known_host_uuid string

The UUID of the known host to update.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - updatePipelineVariableForWorkspace

Update a workspace level variable. [API Docs]

put
/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.updatePipelineVariableForWorkspace({ _body, variable_uuid, workspace })
bitbucket.pipelines.updatePipelineVariableForWorkspace({ _body, variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated variable.

variable_uuid string

The UUID of the variable.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - updateSchedule

Update a schedule. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
const { data, headers } = await bitbucket.pipelines.updateSchedule({ _body, repo_slug, schedule_uuid, workspace })
bitbucket.pipelines.updateSchedule({ _body, repo_slug, schedule_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The schedule to update.

repo_slug string

The repository.

schedule_uuid string

The uuid of the schedule.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - updateSshKeyPair

Create or update the repository SSH key pair. The private key will be set as a default SSH identity in your build container. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
const { data, headers } = await bitbucket.pipelines.updateSshKeyPair({ _body, repo_slug, workspace })
bitbucket.pipelines.updateSshKeyPair({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The created or updated SSH key pair.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - updateVariable

Update a repository level variable. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.updateVariable({ _body, repo_slug, variable_uuid, workspace })
bitbucket.pipelines.updateVariable({ _body, repo_slug, variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated variable

repo_slug string

The repository.

variable_uuid string

The UUID of the variable to update.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

pipelines - updateVariableForTeam

Update a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

put
/teams/{username}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.updateVariableForTeam({ _body, username, variable_uuid })
bitbucket.pipelines.updateVariableForTeam({ _body, username, variable_uuid }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated variable.

username string

The account.

variable_uuid string

The UUID of the variable.

pipelines - updateVariableForUser

Update a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

put
/users/{selected_user}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.pipelines.updateVariableForUser({ _body, selected_user, variable_uuid })
bitbucket.pipelines.updateVariableForUser({ _body, selected_user, variable_uuid }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated variable.

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

variable_uuid string

The UUID of the variable.

projects

projects - addDefaultReviewer

Adds the specified user to the project's list of default reviewers. The method is idempotent. Accepts an optional body containing the uuid of the user to be added. [API Docs]

put
/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
const { data, headers } = await bitbucket.projects.addDefaultReviewer({ project_key, selected_user, workspace })
bitbucket.projects.addDefaultReviewer({ project_key, selected_user, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This can either be the actual key assigned to the project or the UUID (surrounded by curly-braces ({})).

selected_user string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

projects - createOrUpdateProject

Since this endpoint can be used to both update and to create a project, the request body depends on the intent. [API Docs]

put
/workspaces/{workspace}/projects/{project_key}
const { data, headers } = await bitbucket.projects.createOrUpdateProject({ _body, project_key, workspace })
bitbucket.projects.createOrUpdateProject({ _body, project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

projects - createProject

Creates a new project. [API Docs]

post
/workspaces/{workspace}/projects
const { data, headers } = await bitbucket.projects.createProject({ _body, workspace })
bitbucket.projects.createProject({ _body, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

projects - deleteDefaultReviewer

Removes a default reviewer from the project. [API Docs]

delete
/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
const { data, headers } = await bitbucket.projects.deleteDefaultReviewer({ project_key, selected_user, workspace })
bitbucket.projects.deleteDefaultReviewer({ project_key, selected_user, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This can either be the actual key assigned to the project or the UUID (surrounded by curly-braces ({})).

selected_user string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

projects - deleteGroupPermission

Deletes the project group permission between the requested project and group, if one exists. [API Docs]

delete
/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
const { data, headers } = await bitbucket.projects.deleteGroupPermission({ group_slug, project_key, workspace })
bitbucket.projects.deleteGroupPermission({ group_slug, project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
group_slug string

Slug of the requested group.

project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

projects - deleteProject

Deletes this project. This is an irreversible operation. [API Docs]

delete
/workspaces/{workspace}/projects/{project_key}
const { data, headers } = await bitbucket.projects.deleteProject({ project_key, workspace })
bitbucket.projects.deleteProject({ project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

projects - deleteUserPermission

Deletes the project user permission between the requested project and user, if one exists. [API Docs]

delete
/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
const { data, headers } = await bitbucket.projects.deleteUserPermission({ project_key, selected_user_id, workspace })
bitbucket.projects.deleteUserPermission({ project_key, selected_user_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

selected_user_id string

This can either be the username, the user's UUID surrounded by curly-braces, for example: {account UUID}, or the user's Atlassian ID.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

projects - getDefaultReviewer

Returns the specified default reviewer. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
const { data, headers } = await bitbucket.projects.getDefaultReviewer({ project_key, selected_user, workspace, fields })
bitbucket.projects.getDefaultReviewer({ project_key, selected_user, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This can either be the actual key assigned to the project or the UUID (surrounded by curly-braces ({})).

selected_user string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

projects - getGroupPermission

Returns the group permission for a given group and project. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
const { data, headers } = await bitbucket.projects.getGroupPermission({ group_slug, project_key, workspace, fields })
bitbucket.projects.getGroupPermission({ group_slug, project_key, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
group_slug string

Slug of the requested group.

project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

projects - getProject

Returns the requested project. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}
const { data, headers } = await bitbucket.projects.getProject({ project_key, workspace, fields })
bitbucket.projects.getProject({ project_key, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

projects - getUserPermission

Returns the explicit user permission for a given user and project. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
const { data, headers } = await bitbucket.projects.getUserPermission({ project_key, selected_user_id, workspace, fields })
bitbucket.projects.getUserPermission({ project_key, selected_user_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

selected_user_id string

This can either be the username, the user's UUID surrounded by curly-braces, for example: {account UUID}, or the user's Atlassian ID.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

projects - listDefaultReviewers

Return a list of all default reviewers for a project. This is a list of users that will be added as default reviewers to pull requests for any repository within the project. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/default-reviewers
const { data, headers } = await bitbucket.projects.listDefaultReviewers({ project_key, workspace, page, pagelen, q, sort, fields })
bitbucket.projects.listDefaultReviewers({ project_key, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

projects - listGroupPermissions

Returns a paginated list of explicit group permissions for the given project. This endpoint does not support BBQL features. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/permissions-config/groups
const { data, headers } = await bitbucket.projects.listGroupPermissions({ project_key, workspace, page, pagelen, q, sort, fields })
bitbucket.projects.listGroupPermissions({ project_key, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

projects - listUserPermissions

Returns a paginated list of explicit user permissions for the given project. This endpoint does not support BBQL features. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/permissions-config/users
const { data, headers } = await bitbucket.projects.listUserPermissions({ project_key, workspace, page, pagelen, q, sort, fields })
bitbucket.projects.listUserPermissions({ project_key, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

projects - updateGroupPermission

Updates the group permission, or grants a new permission if one does not already exist. [API Docs]

put
/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
const { data, headers } = await bitbucket.projects.updateGroupPermission({ _body, group_slug, project_key, workspace })
bitbucket.projects.updateGroupPermission({ _body, group_slug, project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The permission to grant

group_slug string

Slug of the requested group.

project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

projects - updateUserPermission

Updates the explicit user permission for a given user and project. The selected user must be a member of the workspace, and cannot be the workspace owner. [API Docs]

put
/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
const { data, headers } = await bitbucket.projects.updateUserPermission({ _body, project_key, selected_user_id, workspace })
bitbucket.projects.updateUserPermission({ _body, project_key, selected_user_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The permission to grant

project_key string

The project in question. This is the actual key assigned to the project.

selected_user_id string

This can either be the username, the user's UUID surrounded by curly-braces, for example: {account UUID}, or the user's Atlassian ID.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

properties

properties - deleteCommitHostedPropertyValue

Delete an application property value stored against a commit. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.deleteCommitHostedPropertyValue({ app_key, commit, property_name, repo_slug, workspace })
bitbucket.properties.deleteCommitHostedPropertyValue({ app_key, commit, property_name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

commit string

The commit.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

properties - deletePullRequestHostedPropertyValue

Delete an application property value stored against a pull request. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.deletePullRequestHostedPropertyValue({ app_key, property_name, pullrequest_id, repo_slug, workspace })
bitbucket.properties.deletePullRequestHostedPropertyValue({ app_key, property_name, pullrequest_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

pullrequest_id string

The pull request ID.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

properties - deleteRepositoryHostedPropertyValue

Delete an application property value stored against a repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.deleteRepositoryHostedPropertyValue({ app_key, property_name, repo_slug, workspace })
bitbucket.properties.deleteRepositoryHostedPropertyValue({ app_key, property_name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

properties - deleteUserHostedPropertyValue

Delete an application property value stored against a user. [API Docs]

delete
/users/{selected_user}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.deleteUserHostedPropertyValue({ app_key, property_name, selected_user })
bitbucket.properties.deleteUserHostedPropertyValue({ app_key, property_name, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

properties - getCommitHostedPropertyValue

Retrieve an application property value stored against a commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.getCommitHostedPropertyValue({ app_key, commit, property_name, repo_slug, workspace, fields })
bitbucket.properties.getCommitHostedPropertyValue({ app_key, commit, property_name, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

commit string

The commit.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

fields optional string

properties - getPullRequestHostedPropertyValue

Retrieve an application property value stored against a pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.getPullRequestHostedPropertyValue({ app_key, property_name, pullrequest_id, repo_slug, workspace, fields })
bitbucket.properties.getPullRequestHostedPropertyValue({ app_key, property_name, pullrequest_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

pullrequest_id string

The pull request ID.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

fields optional string

properties - getRepositoryHostedPropertyValue

Retrieve an application property value stored against a repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.getRepositoryHostedPropertyValue({ app_key, property_name, repo_slug, workspace, fields })
bitbucket.properties.getRepositoryHostedPropertyValue({ app_key, property_name, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

fields optional string

properties - retrieveUserHostedPropertyValue

Retrieve an application property value stored against a user. [API Docs]

get
/users/{selected_user}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.retrieveUserHostedPropertyValue({ app_key, property_name, selected_user, fields })
bitbucket.properties.retrieveUserHostedPropertyValue({ app_key, property_name, selected_user, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

fields optional string

properties - updateCommitHostedPropertyValue

Update an application property value stored against a commit. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.updateCommitHostedPropertyValue({ _body, app_key, commit, property_name, repo_slug, workspace })
bitbucket.properties.updateCommitHostedPropertyValue({ _body, app_key, commit, property_name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The application property to create or update.

app_key string

The key of the Connect app.

commit string

The commit.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

properties - updatePullRequestHostedPropertyValue

Update an application property value stored against a pull request. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.updatePullRequestHostedPropertyValue({ _body, app_key, property_name, pullrequest_id, repo_slug, workspace })
bitbucket.properties.updatePullRequestHostedPropertyValue({ _body, app_key, property_name, pullrequest_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The application property to create or update.

app_key string

The key of the Connect app.

property_name string

The name of the property.

pullrequest_id string

The pull request ID.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

properties - updateRepositoryHostedPropertyValue

Update an application property value stored against a repository. [API Docs]

put
/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.updateRepositoryHostedPropertyValue({ _body, app_key, property_name, repo_slug, workspace })
bitbucket.properties.updateRepositoryHostedPropertyValue({ _body, app_key, property_name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The application property to create or update.

app_key string

The key of the Connect app.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

properties - updateUserHostedPropertyValue

Update an application property value stored against a user. [API Docs]

put
/users/{selected_user}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.properties.updateUserHostedPropertyValue({ _body, app_key, property_name, selected_user })
bitbucket.properties.updateUserHostedPropertyValue({ _body, app_key, property_name, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The application property to create or update.

app_key string

The key of the Connect app.

property_name string

The name of the property.

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

pullrequests

pullrequests - addChangeRequest

[API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes
const { data, headers } = await bitbucket.pullrequests.addChangeRequest({ pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.addChangeRequest({ pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - addDefaultReviewer

Adds the specified user to the repository's list of default reviewers. [API Docs]

put
/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
const { data, headers } = await bitbucket.pullrequests.addDefaultReviewer({ repo_slug, target_username, workspace })
bitbucket.pullrequests.addDefaultReviewer({ repo_slug, target_username, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

target_username string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - create

Creates a new pull request where the destination repository is this repository and the author is the authenticated user. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests
const { data, headers } = await bitbucket.pullrequests.create({ _body, repo_slug, workspace })
bitbucket.pullrequests.create({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The new pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - createApproval

Approve the specified pull request as the authenticated user. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve
const { data, headers } = await bitbucket.pullrequests.createApproval({ pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.createApproval({ pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - createComment

Creates a new pull request comment. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments
const { data, headers } = await bitbucket.pullrequests.createComment({ _body, pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.createComment({ _body, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The comment object.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - createTask

Creates a new pull request task. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks
const { data, headers } = await bitbucket.pullrequests.createTask({ _body, pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.createTask({ _body, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The contents of the task

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - decline

Declines the pull request. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/decline
const { data, headers } = await bitbucket.pullrequests.decline({ pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.decline({ pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - deleteApproval

Redact the authenticated user's approval of the specified pull request. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve
const { data, headers } = await bitbucket.pullrequests.deleteApproval({ pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.deleteApproval({ pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - deleteChangeRequest

[API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes
const { data, headers } = await bitbucket.pullrequests.deleteChangeRequest({ pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.deleteChangeRequest({ pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - deleteComment

Deletes a specific pull request comment. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
const { data, headers } = await bitbucket.pullrequests.deleteComment({ comment_id, pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.deleteComment({ comment_id, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - deleteDefaultReviewer

Removes a default reviewer from the repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
const { data, headers } = await bitbucket.pullrequests.deleteDefaultReviewer({ repo_slug, target_username, workspace })
bitbucket.pullrequests.deleteDefaultReviewer({ repo_slug, target_username, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

target_username string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - deleteTask

Deletes a specific pull request task. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
const { data, headers } = await bitbucket.pullrequests.deleteTask({ pull_request_id, repo_slug, task_id, workspace })
bitbucket.pullrequests.deleteTask({ pull_request_id, repo_slug, task_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

task_id integer

The ID of the task.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - get

Returns the specified pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}
const { data, headers } = await bitbucket.pullrequests.get({ pull_request_id, repo_slug, workspace, fields })
bitbucket.pullrequests.get({ pull_request_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

pullrequests - getComment

Returns a specific pull request comment. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
const { data, headers } = await bitbucket.pullrequests.getComment({ comment_id, pull_request_id, repo_slug, workspace, fields })
bitbucket.pullrequests.getComment({ comment_id, pull_request_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

pullrequests - getDefaultReviewer

Returns the specified reviewer. [API Docs]

get
/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
const { data, headers } = await bitbucket.pullrequests.getDefaultReviewer({ repo_slug, target_username, workspace, fields })
bitbucket.pullrequests.getDefaultReviewer({ repo_slug, target_username, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

target_username string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

pullrequests - getDiff

Redirects to the repository diff with the revspec that corresponds to the pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diff
const { data, headers } = await bitbucket.pullrequests.getDiff({ pull_request_id, repo_slug, workspace, fields })
bitbucket.pullrequests.getDiff({ pull_request_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

pullrequests - getDiffStat

Redirects to the repository diffstat with the revspec that corresponds to the pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstat
const { data, headers } = await bitbucket.pullrequests.getDiffStat({ pull_request_id, repo_slug, workspace, fields })
bitbucket.pullrequests.getDiffStat({ pull_request_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

pullrequests - getMergeTaskStatus

When merging a pull request takes too long, the client receives a task ID along with a 202 status code. The task ID can be used in a call to this endpoint to check the status of a merge task. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge/task-status/{task_id}
const { data, headers } = await bitbucket.pullrequests.getMergeTaskStatus({ pull_request_id, repo_slug, task_id, workspace, fields })
bitbucket.pullrequests.getMergeTaskStatus({ pull_request_id, repo_slug, task_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

task_id string

ID of the merge task

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

pullrequests - getPatch

Redirects to the repository patch with the revspec that corresponds to pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/patch
const { data, headers } = await bitbucket.pullrequests.getPatch({ pull_request_id, repo_slug, workspace, fields })
bitbucket.pullrequests.getPatch({ pull_request_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

pullrequests - getTask

Returns a specific pull request task. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
const { data, headers } = await bitbucket.pullrequests.getTask({ pull_request_id, repo_slug, task_id, workspace, fields })
bitbucket.pullrequests.getTask({ pull_request_id, repo_slug, task_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

task_id integer

The ID of the task.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

pullrequests - list

Returns all pull requests on the specified repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests
const { data, headers } = await bitbucket.pullrequests.list({ repo_slug, state, workspace, page, pagelen, q, sort, fields })
bitbucket.pullrequests.list({ repo_slug, state, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

state optional string

Only return pull requests that are in this state. This parameter can be repeated.

Allowed values: OPEN, MERGED, DECLINED, SUPERSEDED

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pullrequests - listActivities

Returns a paginated list of the pull request's activity log. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/activity
const { data, headers } = await bitbucket.pullrequests.listActivities({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pullrequests.listActivities({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pullrequests - listActivitiesForRepo

Returns a paginated list of the pull request's activity log. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/activity
const { data, headers } = await bitbucket.pullrequests.listActivitiesForRepo({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pullrequests.listActivitiesForRepo({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pullrequests - listComments

Returns a paginated list of the pull request's comments. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments
const { data, headers } = await bitbucket.pullrequests.listComments({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pullrequests.listComments({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pullrequests - listCommits

Returns a paginated list of the pull request's commits. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits
const { data, headers } = await bitbucket.pullrequests.listCommits({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pullrequests.listCommits({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pullrequests - listDefaultReviewers

Returns the repository's default reviewers. [API Docs]

get
/repositories/{workspace}/{repo_slug}/default-reviewers
const { data, headers } = await bitbucket.pullrequests.listDefaultReviewers({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pullrequests.listDefaultReviewers({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pullrequests - listForCommit

Returns a paginated list of all pull requests as part of which this commit was reviewed. Pull Request Commit Links app must be installed first before using this API; installation automatically occurs when 'Go to pull request' is clicked from the web interface for a commit's details. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests
const { data, headers } = await bitbucket.pullrequests.listForCommit({ commit, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pullrequests.listForCommit({ commit, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The SHA1 of the commit

repo_slug string

The repository; either the UUID in curly braces, or the slug

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces

page optional string

Which page to retrieve

Default value: 1

pagelen optional integer

How many pull requests to retrieve per page

Default value: 30

q optional string
sort optional string
fields optional string

pullrequests - listPullrequestsForUser

Returns all pull requests authored by the specified user. [API Docs]

get
/pullrequests/{selected_user}
const { data, headers } = await bitbucket.pullrequests.listPullrequestsForUser({ selected_user, state, page, pagelen, q, sort, fields })
bitbucket.pullrequests.listPullrequestsForUser({ selected_user, state, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
selected_user string

This can either be the username of the pull request author, the author's UUID surrounded by curly-braces, for example: {account UUID}, or the author's Atlassian ID.

state optional string

Only return pull requests that are in this state. This parameter can be repeated.

Allowed values: OPEN, MERGED, DECLINED, SUPERSEDED

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

pullrequests - listStatuses

Returns all statuses (e.g. build results) for the given pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses
const { data, headers } = await bitbucket.pullrequests.listStatuses({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pullrequests.listStatuses({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. Defaults to created_on.

fields optional string

pullrequests - listTasks

Returns a paginated list of the pull request's tasks. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks
const { data, headers } = await bitbucket.pullrequests.listTasks({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.pullrequests.listTasks({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer

Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.

q optional string

Query string to narrow down the response. See filtering and sorting for details.

sort optional string

Field by which the results should be sorted as per filtering and sorting. Defaults to created_on.

fields optional string

pullrequests - merge

[API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge{?async}
const { data, headers } = await bitbucket.pullrequests.merge({ _body, async, pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.merge({ _body, async, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any
async optional boolean

Default value is false.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - reopenComment

[API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve
const { data, headers } = await bitbucket.pullrequests.reopenComment({ comment_id, pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.reopenComment({ comment_id, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - resolveComment

[API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve
const { data, headers } = await bitbucket.pullrequests.resolveComment({ comment_id, pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.resolveComment({ comment_id, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - update

Mutates the specified pull request. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}
const { data, headers } = await bitbucket.pullrequests.update({ _body, pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.update({ _body, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The pull request that is to be updated.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - updateComment

Updates a specific pull request comment. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
const { data, headers } = await bitbucket.pullrequests.updateComment({ _body, comment_id, pull_request_id, repo_slug, workspace })
bitbucket.pullrequests.updateComment({ _body, comment_id, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The contents of the updated comment.

comment_id integer

The id of the comment.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

pullrequests - updateTask

Updates a specific pull request task. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
const { data, headers } = await bitbucket.pullrequests.updateTask({ _body, pull_request_id, repo_slug, task_id, workspace })
bitbucket.pullrequests.updateTask({ _body, pull_request_id, repo_slug, task_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated state and content of the task.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

task_id integer

The ID of the task.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

refs

refs - createBranch

Creates a new branch in the specified repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/refs/branches
const { data, headers } = await bitbucket.refs.createBranch({ _body, repo_slug, workspace })
bitbucket.refs.createBranch({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

refs - createTag

Creates a new tag in the specified repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/refs/tags
const { data, headers } = await bitbucket.refs.createTag({ _body, repo_slug, workspace })
bitbucket.refs.createTag({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

refs - deleteBranch

Delete a branch in the specified repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/refs/branches/{name}
const { data, headers } = await bitbucket.refs.deleteBranch({ name, repo_slug, workspace })
bitbucket.refs.deleteBranch({ name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
name string

The name of the branch.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

refs - deleteTag

Delete a tag in the specified repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/refs/tags/{name}
const { data, headers } = await bitbucket.refs.deleteTag({ name, repo_slug, workspace })
bitbucket.refs.deleteTag({ name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
name string

The name of the tag.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

refs - getBranch

Returns a branch object within the specified repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/refs/branches/{name}
const { data, headers } = await bitbucket.refs.getBranch({ name, repo_slug, workspace, fields })
bitbucket.refs.getBranch({ name, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
name string

The name of the branch.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

refs - getTag

Returns the specified tag. [API Docs]

get
/repositories/{workspace}/{repo_slug}/refs/tags/{name}
const { data, headers } = await bitbucket.refs.getTag({ name, repo_slug, workspace, fields })
bitbucket.refs.getTag({ name, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
name string

The name of the tag.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

refs - list

Returns the branches and tags in the repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/refs
const { data, headers } = await bitbucket.refs.list({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.refs.list({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. The name field is handled specially for refs in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2'].

fields optional string

refs - listBranches

Returns a list of all open branches within the specified repository. Results will be in the order the source control manager returns them. [API Docs]

get
/repositories/{workspace}/{repo_slug}/refs/branches
const { data, headers } = await bitbucket.refs.listBranches({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.refs.listBranches({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. The name field is handled specially for branches in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return ['branch1', 'branch2', 'branch10'] instead of ['branch1', 'branch10', 'branch2'].

fields optional string

refs - listTags

Returns the tags in the repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/refs/tags
const { data, headers } = await bitbucket.refs.listTags({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.refs.listTags({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. The name field is handled specially for tags in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2'].

fields optional string

reports

reports - bulkCreateOrUpdateAnnotations

Bulk upload of annotations. Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations. [API Docs]

post
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations
const { data, headers } = await bitbucket.reports.bulkCreateOrUpdateAnnotations({ _body, commit, repo_slug, reportId, workspace })
bitbucket.reports.bulkCreateOrUpdateAnnotations({ _body, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The annotations to create or update

commit string

The commit for which to retrieve reports.

repo_slug string

The repository.

reportId string

Uuid or external-if of the report for which to get annotations for.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

reports - createOrUpdateAnnotation

Creates or updates an individual annotation for the specified report. Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
const { data, headers } = await bitbucket.reports.createOrUpdateAnnotation({ _body, annotationId, commit, repo_slug, reportId, workspace })
bitbucket.reports.createOrUpdateAnnotation({ _body, annotationId, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The annotation to create or update

annotationId string

Either the uuid or external-id of the annotation.

commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

reports - createOrUpdateReport

Creates or updates a report for the specified commit. To upload a report, make sure to generate an ID that is unique across all reports for that commit. If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-001. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
const { data, headers } = await bitbucket.reports.createOrUpdateReport({ _body, commit, repo_slug, reportId, workspace })
bitbucket.reports.createOrUpdateReport({ _body, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The report to create or update

commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

reports - deleteAnnotation

Deletes a single Annotation matching the provided ID. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
const { data, headers } = await bitbucket.reports.deleteAnnotation({ annotationId, commit, repo_slug, reportId, workspace })
bitbucket.reports.deleteAnnotation({ annotationId, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
annotationId string

Either the uuid or external-id of the annotation.

commit string

The commit the annotation belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the annotation.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

reports - deleteReport

Deletes a single Report matching the provided ID. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
const { data, headers } = await bitbucket.reports.deleteReport({ commit, repo_slug, reportId, workspace })
bitbucket.reports.deleteReport({ commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

reports - getAnnotation

Returns a single Annotation matching the provided ID. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
const { data, headers } = await bitbucket.reports.getAnnotation({ annotationId, commit, repo_slug, reportId, workspace, fields })
bitbucket.reports.getAnnotation({ annotationId, commit, repo_slug, reportId, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
annotationId string

Either the uuid or external-id of the annotation.

commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

reports - getAnnotationsForReport

Returns a paginated list of Annotations for a specified report. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations
const { data, headers } = await bitbucket.reports.getAnnotationsForReport({ commit, repo_slug, reportId, workspace, page, pagelen, q, sort, fields })
bitbucket.reports.getAnnotationsForReport({ commit, repo_slug, reportId, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit for which to retrieve reports.

repo_slug string

The repository.

reportId string

Uuid or external-if of the report for which to get annotations for.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

reports - getReport

Returns a single Report matching the provided ID. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
const { data, headers } = await bitbucket.reports.getReport({ commit, repo_slug, reportId, workspace, fields })
bitbucket.reports.getReport({ commit, repo_slug, reportId, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

reports - getReportsForCommit

Returns a paginated list of Reports linked to this commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports
const { data, headers } = await bitbucket.reports.getReportsForCommit({ commit, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.reports.getReportsForCommit({ commit, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit for which to retrieve reports.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories

repositories - addChangeRequestForPullRequest

[API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes
const { data, headers } = await bitbucket.repositories.addChangeRequestForPullRequest({ pull_request_id, repo_slug, workspace })
bitbucket.repositories.addChangeRequestForPullRequest({ pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - addDefaultReviewer

Adds the specified user to the repository's list of default reviewers. [API Docs]

put
/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
const { data, headers } = await bitbucket.repositories.addDefaultReviewer({ repo_slug, target_username, workspace })
bitbucket.repositories.addDefaultReviewer({ repo_slug, target_username, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

target_username string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - bulkCreateOrUpdateAnnotations

Bulk upload of annotations. Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations. [API Docs]

post
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations
const { data, headers } = await bitbucket.repositories.bulkCreateOrUpdateAnnotations({ _body, commit, repo_slug, reportId, workspace })
bitbucket.repositories.bulkCreateOrUpdateAnnotations({ _body, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The annotations to create or update

commit string

The commit for which to retrieve reports.

repo_slug string

The repository.

reportId string

Uuid or external-if of the report for which to get annotations for.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - create

Creates a new repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}
const { data, headers } = await bitbucket.repositories.create({ _body, repo_slug, workspace })
bitbucket.repositories.create({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The repository that is to be created. Note that most object elements are optional. Elements "owner" and "full_name" are ignored as the URL implies them.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createBranch

Creates a new branch in the specified repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/refs/branches
const { data, headers } = await bitbucket.repositories.createBranch({ _body, repo_slug, workspace })
bitbucket.repositories.createBranch({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createBranchRestriction

Creates a new branch restriction rule for a repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/branch-restrictions
const { data, headers } = await bitbucket.repositories.createBranchRestriction({ _body, repo_slug, workspace })
bitbucket.repositories.createBranchRestriction({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new rule

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createCommitApproval

Approve the specified commit as the authenticated user. [API Docs]

post
/repositories/{workspace}/{repo_slug}/commit/{commit}/approve
const { data, headers } = await bitbucket.repositories.createCommitApproval({ commit, repo_slug, workspace })
bitbucket.repositories.createCommitApproval({ commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createCommitBuildStatus

Creates a new build status against the specified commit. [API Docs]

post
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build
const { data, headers } = await bitbucket.repositories.createCommitBuildStatus({ _body, commit, repo_slug, workspace })
bitbucket.repositories.createCommitBuildStatus({ _body, commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The new commit status object.

commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createCommitComment

Creates new comment on the specified commit. [API Docs]

post
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments
const { data, headers } = await bitbucket.repositories.createCommitComment({ _body, commit, repo_slug, workspace })
bitbucket.repositories.createCommitComment({ _body, commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The specified comment.

commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createDeployKey

Create a new deploy key in a repository. Note: If authenticating a deploy key with an OAuth consumer, any changes to the OAuth consumer will subsequently invalidate the deploy key. [API Docs]

post
/repositories/{workspace}/{repo_slug}/deploy-keys
const { data, headers } = await bitbucket.repositories.createDeployKey({ key, label, repo_slug, workspace })
bitbucket.repositories.createDeployKey({ key, label, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
key string
label string
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createDeploymentVariable

Create a deployment environment level variable. [API Docs]

post
/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables
const { data, headers } = await bitbucket.repositories.createDeploymentVariable({ _body, environment_uuid, repo_slug, workspace })
bitbucket.repositories.createDeploymentVariable({ _body, environment_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The variable to create

environment_uuid string

The environment.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - createDownload

Upload new download artifacts. [API Docs]

post
/repositories/{workspace}/{repo_slug}/downloads
const { data, headers } = await bitbucket.repositories.createDownload({ _body, repo_slug, workspace })
bitbucket.repositories.createDownload({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createEnvironment

Create an environment. [API Docs]

post
/repositories/{workspace}/{repo_slug}/environments
const { data, headers } = await bitbucket.repositories.createEnvironment({ _body, repo_slug, workspace })
bitbucket.repositories.createEnvironment({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The environment to create.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - createFork

Creates a new fork of the specified repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/forks
const { data, headers } = await bitbucket.repositories.createFork({ _body, repo_slug, workspace })
bitbucket.repositories.createFork({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

A repository object. This can be left blank.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createIssue

Creates a new issue. [API Docs]

post
/repositories/{workspace}/{repo_slug}/issues
const { data, headers } = await bitbucket.repositories.createIssue({ _body, repo_slug, workspace })
bitbucket.repositories.createIssue({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new issue. The only required element is title. All other elements can be omitted from the body.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createIssueAttachments

Upload new issue attachments. [API Docs]

post
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments
const { data, headers } = await bitbucket.repositories.createIssueAttachments({ _body, issue_id, repo_slug, workspace })
bitbucket.repositories.createIssueAttachments({ _body, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createIssueChange

Makes a change to the specified issue. [API Docs]

post
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes
const { data, headers } = await bitbucket.repositories.createIssueChange({ _body, issue_id, repo_slug, workspace })
bitbucket.repositories.createIssueChange({ _body, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new issue state change. The only required elements are changes.[].new. All other elements can be omitted from the body.

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createIssueComment

Creates a new issue comment. [API Docs]

post
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments
const { data, headers } = await bitbucket.repositories.createIssueComment({ _body, issue_id, repo_slug, workspace })
bitbucket.repositories.createIssueComment({ _body, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new issue comment object.

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createIssueExportJob

A POST request to this endpoint initiates a new background celery task that archives the repo's issues. [API Docs]

post
/repositories/{workspace}/{repo_slug}/issues/export
const { data, headers } = await bitbucket.repositories.createIssueExportJob({ _body, repo_slug, workspace })
bitbucket.repositories.createIssueExportJob({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The options to apply to the export. Available options include project_key and project_name which, if specified, are used as the project key and name in the exported Jira json format. Option send_email specifies whether an email should be sent upon export result. Option include_attachments specifies whether attachments are included in the export.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createIssueImportJob

A POST request to this endpoint will import the zip file given by the archive parameter into the repository. All existing issues will be deleted and replaced by the contents of the imported zip file. [API Docs]

post
/repositories/{workspace}/{repo_slug}/issues/import
const { data, headers } = await bitbucket.repositories.createIssueImportJob({ repo_slug, workspace })
bitbucket.repositories.createIssueImportJob({ repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createIssueVote

Vote for this issue. [API Docs]

put
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote
const { data, headers } = await bitbucket.repositories.createIssueVote({ issue_id, repo_slug, workspace })
bitbucket.repositories.createIssueVote({ issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createIssueWatch

Start watching this issue. [API Docs]

put
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch
const { data, headers } = await bitbucket.repositories.createIssueWatch({ issue_id, repo_slug, workspace })
bitbucket.repositories.createIssueWatch({ issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createOrUpdateAnnotation

Creates or updates an individual annotation for the specified report. Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
const { data, headers } = await bitbucket.repositories.createOrUpdateAnnotation({ _body, annotationId, commit, repo_slug, reportId, workspace })
bitbucket.repositories.createOrUpdateAnnotation({ _body, annotationId, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The annotation to create or update

annotationId string

Either the uuid or external-id of the annotation.

commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - createOrUpdateReport

Creates or updates a report for the specified commit. To upload a report, make sure to generate an ID that is unique across all reports for that commit. If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-001. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
const { data, headers } = await bitbucket.repositories.createOrUpdateReport({ _body, commit, repo_slug, reportId, workspace })
bitbucket.repositories.createOrUpdateReport({ _body, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The report to create or update

commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - createPipeline

Endpoint to create and initiate a pipeline. There are a couple of different options to initiate a pipeline, where the payload of the request will determine which type of pipeline will be instantiated.

Trigger a Pipeline for a branch

One way to trigger pipelines is by specifying the branch for which you want to trigger a pipeline. The specified branch will be used to determine which pipeline definition from the bitbucket-pipelines.yml file will be applied to initiate the pipeline. The pipeline will then do a clone of the repository and checkout the latest revision of the specified branch. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pipelines
const { data, headers } = await bitbucket.repositories.createPipeline({ _body, repo_slug, workspace })
bitbucket.repositories.createPipeline({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The pipeline to initiate.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - createPipelineKnownHost

Create a repository level known host. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
const { data, headers } = await bitbucket.repositories.createPipelineKnownHost({ _body, repo_slug, workspace })
bitbucket.repositories.createPipelineKnownHost({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The known host to create.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - createPipelineSchedule

Create a schedule for the given repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules
const { data, headers } = await bitbucket.repositories.createPipelineSchedule({ _body, repo_slug, workspace })
bitbucket.repositories.createPipelineSchedule({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The schedule to create.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - createPipelineVariable

Create a repository level variable. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pipelines_config/variables
const { data, headers } = await bitbucket.repositories.createPipelineVariable({ _body, repo_slug, workspace })
bitbucket.repositories.createPipelineVariable({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The variable to create.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - createPullRequest

Creates a new pull request where the destination repository is this repository and the author is the authenticated user. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests
const { data, headers } = await bitbucket.repositories.createPullRequest({ _body, repo_slug, workspace })
bitbucket.repositories.createPullRequest({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The new pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createPullRequestApproval

Approve the specified pull request as the authenticated user. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve
const { data, headers } = await bitbucket.repositories.createPullRequestApproval({ pull_request_id, repo_slug, workspace })
bitbucket.repositories.createPullRequestApproval({ pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createPullRequestComment

Creates a new pull request comment. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments
const { data, headers } = await bitbucket.repositories.createPullRequestComment({ _body, pull_request_id, repo_slug, workspace })
bitbucket.repositories.createPullRequestComment({ _body, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The comment object.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createPullRequestTask

Creates a new pull request task. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks
const { data, headers } = await bitbucket.repositories.createPullRequestTask({ _body, pull_request_id, repo_slug, workspace })
bitbucket.repositories.createPullRequestTask({ _body, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The contents of the task

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createSrcFileCommit

This endpoint is used to create new commits in the repository by uploading files. [API Docs]

post
/repositories/{workspace}/{repo_slug}/src
const { data, headers } = await bitbucket.repositories.createSrcFileCommit({ _body, author, branch, files, message, parents, repo_slug, workspace })
bitbucket.repositories.createSrcFileCommit({ _body, author, branch, files, message, parents, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any
author optional string

The raw string to be used as the new commit's author. This string follows the format Erik van Zijst <evzijst@atlassian.com>.

branch optional string

The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new head.

files optional string

Optional field that declares the files that the request is manipulating. When adding a new file to a repo, or when overwriting an existing file, the client can just upload the full contents of the file in a normal form field and the use of this files meta data field is redundant. However, when the files field contains a file path that does not have a corresponding, identically-named form field, then Bitbucket interprets that as the client wanting to replace the named file with the null set and the file is deleted instead.

message optional string

The commit message. When omitted, Bitbucket uses a canned string.

parents optional string

A comma-separated list of SHA1s of the commits that should be the parents of the newly created commit.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createTag

Creates a new tag in the specified repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/refs/tags
const { data, headers } = await bitbucket.repositories.createTag({ _body, repo_slug, workspace })
bitbucket.repositories.createTag({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - createWebhook

Creates a new webhook on the specified repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/hooks
const { data, headers } = await bitbucket.repositories.createWebhook({ _body, repo_slug, workspace })
bitbucket.repositories.createWebhook({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - declinePullRequest

Declines the pull request. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/decline
const { data, headers } = await bitbucket.repositories.declinePullRequest({ pull_request_id, repo_slug, workspace })
bitbucket.repositories.declinePullRequest({ pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - delete

Deletes the repository. This is an irreversible operation. [API Docs]

delete
/repositories/{workspace}/{repo_slug}
const { data, headers } = await bitbucket.repositories.delete({ redirect_to, repo_slug, workspace })
bitbucket.repositories.delete({ redirect_to, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
redirect_to optional string

If a repository has been moved to a new location, use this parameter to show users a friendly message in the Bitbucket UI that the repository has moved to a new location. However, a GET to this endpoint will still return a 404.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteAnnotation

Deletes a single Annotation matching the provided ID. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
const { data, headers } = await bitbucket.repositories.deleteAnnotation({ annotationId, commit, repo_slug, reportId, workspace })
bitbucket.repositories.deleteAnnotation({ annotationId, commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
annotationId string

Either the uuid or external-id of the annotation.

commit string

The commit the annotation belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the annotation.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - deleteBranch

Delete a branch in the specified repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/refs/branches/{name}
const { data, headers } = await bitbucket.repositories.deleteBranch({ name, repo_slug, workspace })
bitbucket.repositories.deleteBranch({ name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
name string

The name of the branch.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteBranchRestriction

Deletes an existing branch restriction rule. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
const { data, headers } = await bitbucket.repositories.deleteBranchRestriction({ id, repo_slug, workspace })
bitbucket.repositories.deleteBranchRestriction({ id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
id string

The restriction rule's id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteChangeRequestForPullRequest

[API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes
const { data, headers } = await bitbucket.repositories.deleteChangeRequestForPullRequest({ pull_request_id, repo_slug, workspace })
bitbucket.repositories.deleteChangeRequestForPullRequest({ pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteCommitApproval

Redact the authenticated user's approval of the specified commit. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/approve
const { data, headers } = await bitbucket.repositories.deleteCommitApproval({ commit, repo_slug, workspace })
bitbucket.repositories.deleteCommitApproval({ commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteCommitComment

Deletes the specified commit comment. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
const { data, headers } = await bitbucket.repositories.deleteCommitComment({ comment_id, commit, repo_slug, workspace })
bitbucket.repositories.deleteCommitComment({ comment_id, commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteCommitHostedPropertyValue

Delete an application property value stored against a commit. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.repositories.deleteCommitHostedPropertyValue({ app_key, commit, property_name, repo_slug, workspace })
bitbucket.repositories.deleteCommitHostedPropertyValue({ app_key, commit, property_name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

commit string

The commit.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

repositories - deleteDefaultReviewer

Removes a default reviewer from the repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
const { data, headers } = await bitbucket.repositories.deleteDefaultReviewer({ repo_slug, target_username, workspace })
bitbucket.repositories.deleteDefaultReviewer({ repo_slug, target_username, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

target_username string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteDeployKey

This deletes a deploy key from a repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
const { data, headers } = await bitbucket.repositories.deleteDeployKey({ key_id, repo_slug, workspace })
bitbucket.repositories.deleteDeployKey({ key_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The key ID matching the deploy key.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteDeploymentVariable

Delete a deployment environment level variable. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}
const { data, headers } = await bitbucket.repositories.deleteDeploymentVariable({ environment_uuid, repo_slug, variable_uuid, workspace })
bitbucket.repositories.deleteDeploymentVariable({ environment_uuid, repo_slug, variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
environment_uuid string

The environment.

repo_slug string

The repository.

variable_uuid string

The UUID of the variable to delete.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - deleteDownload

Deletes the specified download artifact from the repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/downloads/{filename}
const { data, headers } = await bitbucket.repositories.deleteDownload({ filename, repo_slug, workspace })
bitbucket.repositories.deleteDownload({ filename, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
filename string

Name of the file.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteEnvironment

Delete an environment [API Docs]

delete
/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}
const { data, headers } = await bitbucket.repositories.deleteEnvironment({ environment_uuid, repo_slug, workspace })
bitbucket.repositories.deleteEnvironment({ environment_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
environment_uuid string

The environment UUID.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - deleteGroupPermission

Deletes the repository group permission between the requested repository and group, if one exists. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}
const { data, headers } = await bitbucket.repositories.deleteGroupPermission({ group_slug, repo_slug, workspace })
bitbucket.repositories.deleteGroupPermission({ group_slug, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
group_slug string

Slug of the requested group.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteIssue

Deletes the specified issue. This requires write access to the repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/issues/{issue_id}
const { data, headers } = await bitbucket.repositories.deleteIssue({ issue_id, repo_slug, workspace })
bitbucket.repositories.deleteIssue({ issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteIssueAttachment

Deletes an attachment. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}
const { data, headers } = await bitbucket.repositories.deleteIssueAttachment({ issue_id, path, repo_slug, workspace })
bitbucket.repositories.deleteIssueAttachment({ issue_id, path, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

path string

Path to the file.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteIssueComment

Deletes the specified comment. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}
const { data, headers } = await bitbucket.repositories.deleteIssueComment({ comment_id, issue_id, repo_slug, workspace })
bitbucket.repositories.deleteIssueComment({ comment_id, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteIssueVote

Retract your vote. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote
const { data, headers } = await bitbucket.repositories.deleteIssueVote({ issue_id, repo_slug, workspace })
bitbucket.repositories.deleteIssueVote({ issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteIssueWatch

Stop watching this issue. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch
const { data, headers } = await bitbucket.repositories.deleteIssueWatch({ issue_id, repo_slug, workspace })
bitbucket.repositories.deleteIssueWatch({ issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deletePipelineKnownHost

Delete a repository level known host. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
const { data, headers } = await bitbucket.repositories.deletePipelineKnownHost({ known_host_uuid, repo_slug, workspace })
bitbucket.repositories.deletePipelineKnownHost({ known_host_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
known_host_uuid string

The UUID of the known host to delete.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - deletePipelineSchedule

Delete a schedule. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
const { data, headers } = await bitbucket.repositories.deletePipelineSchedule({ repo_slug, schedule_uuid, workspace })
bitbucket.repositories.deletePipelineSchedule({ repo_slug, schedule_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

schedule_uuid string

The uuid of the schedule.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - deletePipelineSshKeyPair

Delete the repository SSH key pair. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
const { data, headers } = await bitbucket.repositories.deletePipelineSshKeyPair({ repo_slug, workspace })
bitbucket.repositories.deletePipelineSshKeyPair({ repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - deletePipelineVariable

Delete a repository level variable. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.repositories.deletePipelineVariable({ repo_slug, variable_uuid, workspace })
bitbucket.repositories.deletePipelineVariable({ repo_slug, variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

variable_uuid string

The UUID of the variable to delete.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - deletePullRequestApproval

Redact the authenticated user's approval of the specified pull request. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve
const { data, headers } = await bitbucket.repositories.deletePullRequestApproval({ pull_request_id, repo_slug, workspace })
bitbucket.repositories.deletePullRequestApproval({ pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deletePullRequestComment

Deletes a specific pull request comment. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
const { data, headers } = await bitbucket.repositories.deletePullRequestComment({ comment_id, pull_request_id, repo_slug, workspace })
bitbucket.repositories.deletePullRequestComment({ comment_id, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deletePullRequestHostedPropertyValue

Delete an application property value stored against a pull request. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.repositories.deletePullRequestHostedPropertyValue({ app_key, property_name, pullrequest_id, repo_slug, workspace })
bitbucket.repositories.deletePullRequestHostedPropertyValue({ app_key, property_name, pullrequest_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

pullrequest_id string

The pull request ID.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

repositories - deletePullRequestTask

Deletes a specific pull request task. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
const { data, headers } = await bitbucket.repositories.deletePullRequestTask({ pull_request_id, repo_slug, task_id, workspace })
bitbucket.repositories.deletePullRequestTask({ pull_request_id, repo_slug, task_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

task_id integer

The ID of the task.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteReport

Deletes a single Report matching the provided ID. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
const { data, headers } = await bitbucket.repositories.deleteReport({ commit, repo_slug, reportId, workspace })
bitbucket.repositories.deleteReport({ commit, repo_slug, reportId, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - deleteRepositoryHostedPropertyValue

Delete an application property value stored against a repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.repositories.deleteRepositoryHostedPropertyValue({ app_key, property_name, repo_slug, workspace })
bitbucket.repositories.deleteRepositoryHostedPropertyValue({ app_key, property_name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

repositories - deleteRepositoryPipelineCache

Delete a repository cache. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}
const { data, headers } = await bitbucket.repositories.deleteRepositoryPipelineCache({ cache_uuid, repo_slug, workspace })
bitbucket.repositories.deleteRepositoryPipelineCache({ cache_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
cache_uuid string

The UUID of the cache to delete.

repo_slug string

The repository.

workspace string

The account.

repositories - deleteRepositoryPipelineCaches

Delete repository cache versions by name. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/pipelines-config/caches
const { data, headers } = await bitbucket.repositories.deleteRepositoryPipelineCaches({ name, repo_slug, workspace })
bitbucket.repositories.deleteRepositoryPipelineCaches({ name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
name string

The cache name.

repo_slug string

The repository.

workspace string

The account.

repositories - deleteTag

Delete a tag in the specified repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/refs/tags/{name}
const { data, headers } = await bitbucket.repositories.deleteTag({ name, repo_slug, workspace })
bitbucket.repositories.deleteTag({ name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
name string

The name of the tag.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteUserPermission

Deletes the repository user permission between the requested repository and user, if one exists. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}
const { data, headers } = await bitbucket.repositories.deleteUserPermission({ repo_slug, selected_user_id, workspace })
bitbucket.repositories.deleteUserPermission({ repo_slug, selected_user_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

selected_user_id string

This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - deleteWebhook

Deletes the specified webhook subscription from the given repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/hooks/{uid}
const { data, headers } = await bitbucket.repositories.deleteWebhook({ repo_slug, uid, workspace })
bitbucket.repositories.deleteWebhook({ repo_slug, uid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - get

Returns the object describing this repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}
const { data, headers } = await bitbucket.repositories.get({ repo_slug, workspace, fields })
bitbucket.repositories.get({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getAnnotation

Returns a single Annotation matching the provided ID. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}
const { data, headers } = await bitbucket.repositories.getAnnotation({ annotationId, commit, repo_slug, reportId, workspace, fields })
bitbucket.repositories.getAnnotation({ annotationId, commit, repo_slug, reportId, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
annotationId string

Either the uuid or external-id of the annotation.

commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getAnnotationsForReport

Returns a paginated list of Annotations for a specified report. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations
const { data, headers } = await bitbucket.repositories.getAnnotationsForReport({ commit, repo_slug, reportId, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.getAnnotationsForReport({ commit, repo_slug, reportId, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit for which to retrieve reports.

repo_slug string

The repository.

reportId string

Uuid or external-if of the report for which to get annotations for.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - getBranch

Returns a branch object within the specified repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/refs/branches/{name}
const { data, headers } = await bitbucket.repositories.getBranch({ name, repo_slug, workspace, fields })
bitbucket.repositories.getBranch({ name, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
name string

The name of the branch.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getBranchRestriction

Returns a specific branch restriction rule. [API Docs]

get
/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
const { data, headers } = await bitbucket.repositories.getBranchRestriction({ id, repo_slug, workspace, fields })
bitbucket.repositories.getBranchRestriction({ id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
id string

The restriction rule's id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getBranchingModel

Return the branching model as applied to the repository. This view is read-only. The branching model settings can be changed using the settings API. [API Docs]

get
/repositories/{workspace}/{repo_slug}/branching-model
const { data, headers } = await bitbucket.repositories.getBranchingModel({ repo_slug, workspace, fields })
bitbucket.repositories.getBranchingModel({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getBranchingModelSettings

Return the branching model configuration for a repository. The returned object: [API Docs]

get
/repositories/{workspace}/{repo_slug}/branching-model/settings
const { data, headers } = await bitbucket.repositories.getBranchingModelSettings({ repo_slug, workspace, fields })
bitbucket.repositories.getBranchingModelSettings({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getCommit

Returns the specified commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}
const { data, headers } = await bitbucket.repositories.getCommit({ commit, repo_slug, workspace, fields })
bitbucket.repositories.getCommit({ commit, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getCommitBuildStatus

Returns the specified build status for a commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}
const { data, headers } = await bitbucket.repositories.getCommitBuildStatus({ commit, key, repo_slug, workspace, fields })
bitbucket.repositories.getCommitBuildStatus({ commit, key, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

key string

The build status' unique key

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getCommitComment

Returns the specified commit comment. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
const { data, headers } = await bitbucket.repositories.getCommitComment({ comment_id, commit, repo_slug, workspace, fields })
bitbucket.repositories.getCommitComment({ comment_id, commit, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getCommitHostedPropertyValue

Retrieve an application property value stored against a commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.repositories.getCommitHostedPropertyValue({ app_key, commit, property_name, repo_slug, workspace, fields })
bitbucket.repositories.getCommitHostedPropertyValue({ app_key, commit, property_name, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

commit string

The commit.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

fields optional string

repositories - getDefaultReviewer

Returns the specified reviewer. [API Docs]

get
/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
const { data, headers } = await bitbucket.repositories.getDefaultReviewer({ repo_slug, target_username, workspace, fields })
bitbucket.repositories.getDefaultReviewer({ repo_slug, target_username, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

target_username string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getDeployKey

Returns the deploy key belonging to a specific key. [API Docs]

get
/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
const { data, headers } = await bitbucket.repositories.getDeployKey({ key_id, repo_slug, workspace, fields })
bitbucket.repositories.getDeployKey({ key_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The key ID matching the deploy key.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getDeployment

Retrieve a deployment [API Docs]

get
/repositories/{workspace}/{repo_slug}/deployments/{deployment_uuid}
const { data, headers } = await bitbucket.repositories.getDeployment({ deployment_uuid, repo_slug, workspace, fields })
bitbucket.repositories.getDeployment({ deployment_uuid, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
deployment_uuid string

The deployment UUID.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getDiff

Produces a raw git-style diff. [API Docs]

get
/repositories/{workspace}/{repo_slug}/diff/{spec}
const { data, headers } = await bitbucket.repositories.getDiff({ binary, context, ignore_whitespace, merge, path, renames, repo_slug, spec, topic, workspace, fields })
bitbucket.repositories.getDiff({ binary, context, ignore_whitespace, merge, path, renames, repo_slug, spec, topic, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
binary optional boolean

Generate diffs that include binary files, true if omitted.

context optional integer

Generate diffs with lines of context instead of the usual three.

ignore_whitespace optional boolean

Generate diffs that ignore whitespace.

merge optional boolean

This parameter is deprecated. The 'topic' parameter should be used instead. The 'merge' and 'topic' parameters cannot be both used at the same time.

path optional string

Limit the diff to a particular file (this parameter can be repeated for multiple paths).

renames optional boolean

Whether to perform rename detection, true if omitted.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

spec string

A commit SHA (e.g. 3a8b42) or a commit range using double dot notation (e.g. 3a8b42..9ff173).

topic optional boolean

If true, returns 2-way 'three-dot' diff. This is a diff between the source commit and the merge base of the source commit and the destination commit. If false, a simple 'two dot' diff between the source and destination is returned.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getDownload

Return a redirect to the contents of a download artifact. [API Docs]

get
/repositories/{workspace}/{repo_slug}/downloads/{filename}
const { data, headers } = await bitbucket.repositories.getDownload({ filename, repo_slug, workspace, fields })
bitbucket.repositories.getDownload({ filename, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
filename string

Name of the file.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getEffectiveBranchingModel

[API Docs]

get
/repositories/{workspace}/{repo_slug}/effective-branching-model
const { data, headers } = await bitbucket.repositories.getEffectiveBranchingModel({ repo_slug, workspace, fields })
bitbucket.repositories.getEffectiveBranchingModel({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getEnvironment

Retrieve an environment [API Docs]

get
/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}
const { data, headers } = await bitbucket.repositories.getEnvironment({ environment_uuid, repo_slug, workspace, fields })
bitbucket.repositories.getEnvironment({ environment_uuid, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
environment_uuid string

The environment UUID.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getGroupPermission

Returns the group permission for a given group slug and repository [API Docs]

get
/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}
const { data, headers } = await bitbucket.repositories.getGroupPermission({ group_slug, repo_slug, workspace, fields })
bitbucket.repositories.getGroupPermission({ group_slug, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
group_slug string

Slug of the requested group.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssue

Returns the specified issue. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}
const { data, headers } = await bitbucket.repositories.getIssue({ issue_id, repo_slug, workspace, fields })
bitbucket.repositories.getIssue({ issue_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssueAttachment

Returns the contents of the specified file attachment. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}
const { data, headers } = await bitbucket.repositories.getIssueAttachment({ issue_id, path, repo_slug, workspace, fields })
bitbucket.repositories.getIssueAttachment({ issue_id, path, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

path string

Path to the file.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssueChange

Returns the specified issue change object. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes/{change_id}
const { data, headers } = await bitbucket.repositories.getIssueChange({ change_id, issue_id, repo_slug, workspace, fields })
bitbucket.repositories.getIssueChange({ change_id, issue_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
change_id string

The issue change id

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssueComment

Returns the specified issue comment object. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}
const { data, headers } = await bitbucket.repositories.getIssueComment({ comment_id, issue_id, repo_slug, workspace, fields })
bitbucket.repositories.getIssueComment({ comment_id, issue_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssueComponent

Returns the specified issue tracker component object. [API Docs]

get
/repositories/{workspace}/{repo_slug}/components/{component_id}
const { data, headers } = await bitbucket.repositories.getIssueComponent({ component_id, repo_slug, workspace, fields })
bitbucket.repositories.getIssueComponent({ component_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
component_id integer

The component's id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssueExportJobStatus

This endpoint is used to poll for the progress of an issue export job and return the zip file after the job is complete. As long as the job is running, this will return a 202 response with in the response body a description of the current status. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/export/{repo_name}-issues-{task_id}.zip
const { data, headers } = await bitbucket.repositories.getIssueExportJobStatus({ repo_name, repo_slug, task_id, workspace, fields })
bitbucket.repositories.getIssueExportJobStatus({ repo_name, repo_slug, task_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_name string

The name of the repo

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

task_id string

The ID of the export task

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssueImportJobStatus

When using GET, this endpoint reports the status of the current import task. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/import
const { data, headers } = await bitbucket.repositories.getIssueImportJobStatus({ repo_slug, workspace, fields })
bitbucket.repositories.getIssueImportJobStatus({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssueMilestone

Returns the specified issue tracker milestone object. [API Docs]

get
/repositories/{workspace}/{repo_slug}/milestones/{milestone_id}
const { data, headers } = await bitbucket.repositories.getIssueMilestone({ milestone_id, repo_slug, workspace, fields })
bitbucket.repositories.getIssueMilestone({ milestone_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
milestone_id integer

The milestone's id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssueVersion

Returns the specified issue tracker version object. [API Docs]

get
/repositories/{workspace}/{repo_slug}/versions/{version_id}
const { data, headers } = await bitbucket.repositories.getIssueVersion({ repo_slug, version_id, workspace, fields })
bitbucket.repositories.getIssueVersion({ repo_slug, version_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

version_id integer

The version's id

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssueVote

Check whether the authenticated user has voted for this issue. A 204 status code indicates that the user has voted, while a 404 implies they haven't. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote
const { data, headers } = await bitbucket.repositories.getIssueVote({ issue_id, repo_slug, workspace, fields })
bitbucket.repositories.getIssueVote({ issue_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getIssueWatch

Indicated whether or not the authenticated user is watching this issue. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch
const { data, headers } = await bitbucket.repositories.getIssueWatch({ issue_id, repo_slug, workspace, fields })
bitbucket.repositories.getIssueWatch({ issue_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getMergeBase

Returns the best common ancestor between two commits, specified in a revspec of 2 commits (e.g. 3a8b42..9ff173). [API Docs]

get
/repositories/{workspace}/{repo_slug}/merge-base/{revspec}
const { data, headers } = await bitbucket.repositories.getMergeBase({ repo_slug, revspec, workspace, fields })
bitbucket.repositories.getMergeBase({ repo_slug, revspec, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

revspec string

A commit range using double dot notation (e.g. 3a8b42..9ff173).

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getMergeTaskStatusForPullRequest

When merging a pull request takes too long, the client receives a task ID along with a 202 status code. The task ID can be used in a call to this endpoint to check the status of a merge task. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge/task-status/{task_id}
const { data, headers } = await bitbucket.repositories.getMergeTaskStatusForPullRequest({ pull_request_id, repo_slug, task_id, workspace, fields })
bitbucket.repositories.getMergeTaskStatusForPullRequest({ pull_request_id, repo_slug, task_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

task_id string

ID of the merge task

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getPatch

Produces a raw patch for a single commit (diffed against its first parent), or a patch-series for a revspec of 2 commits (e.g. 3a8b42..9ff173 where the first commit represents the source and the second commit the destination). [API Docs]

get
/repositories/{workspace}/{repo_slug}/patch/{spec}
const { data, headers } = await bitbucket.repositories.getPatch({ repo_slug, spec, workspace, fields })
bitbucket.repositories.getPatch({ repo_slug, spec, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

spec string

A commit SHA (e.g. 3a8b42) or a commit range using double dot notation (e.g. 3a8b42..9ff173).

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getPipeline

Retrieve a specified pipeline [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}
const { data, headers } = await bitbucket.repositories.getPipeline({ pipeline_uuid, repo_slug, workspace, fields })
bitbucket.repositories.getPipeline({ pipeline_uuid, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The pipeline UUID.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPipelineConfig

Retrieve the repository pipelines configuration. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config
const { data, headers } = await bitbucket.repositories.getPipelineConfig({ repo_slug, workspace, fields })
bitbucket.repositories.getPipelineConfig({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

The account.

fields optional string

repositories - getPipelineContainerLog

Retrieve the log file for a build container or service container. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}
const { data, headers } = await bitbucket.repositories.getPipelineContainerLog({ log_uuid, pipeline_uuid, repo_slug, step_uuid, workspace, fields })
bitbucket.repositories.getPipelineContainerLog({ log_uuid, pipeline_uuid, repo_slug, step_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
log_uuid string

For the main build container specify the step UUID; for a service container specify the service container UUID

pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPipelineKnownHost

Retrieve a repository level known host. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
const { data, headers } = await bitbucket.repositories.getPipelineKnownHost({ known_host_uuid, repo_slug, workspace, fields })
bitbucket.repositories.getPipelineKnownHost({ known_host_uuid, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
known_host_uuid string

The UUID of the known host to retrieve.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPipelineSchedule

Retrieve a schedule by its UUID. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
const { data, headers } = await bitbucket.repositories.getPipelineSchedule({ repo_slug, schedule_uuid, workspace, fields })
bitbucket.repositories.getPipelineSchedule({ repo_slug, schedule_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

schedule_uuid string

The uuid of the schedule.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPipelineSshKeyPair

Retrieve the repository SSH key pair excluding the SSH private key. The private key is a write only field and will never be exposed in the logs or the REST API. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
const { data, headers } = await bitbucket.repositories.getPipelineSshKeyPair({ repo_slug, workspace, fields })
bitbucket.repositories.getPipelineSshKeyPair({ repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPipelineStep

Retrieve a given step of a pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}
const { data, headers } = await bitbucket.repositories.getPipelineStep({ pipeline_uuid, repo_slug, step_uuid, workspace, fields })
bitbucket.repositories.getPipelineStep({ pipeline_uuid, repo_slug, step_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPipelineStepLog

Retrieve the log file for a given step of a pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/log
const { data, headers } = await bitbucket.repositories.getPipelineStepLog({ pipeline_uuid, repo_slug, step_uuid, workspace, fields })
bitbucket.repositories.getPipelineStepLog({ pipeline_uuid, repo_slug, step_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPipelineTestReportTestCaseReasons

Get test case reasons (output) for a given test case in a step of a pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasons
const { data, headers } = await bitbucket.repositories.getPipelineTestReportTestCaseReasons({ pipeline_uuid, repo_slug, step_uuid, test_case_uuid, workspace, fields })
bitbucket.repositories.getPipelineTestReportTestCaseReasons({ pipeline_uuid, repo_slug, step_uuid, test_case_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

test_case_uuid string

The UUID of the test case.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPipelineTestReportTestCases

Get test cases for a given step of a pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases
const { data, headers } = await bitbucket.repositories.getPipelineTestReportTestCases({ pipeline_uuid, repo_slug, step_uuid, workspace, fields })
bitbucket.repositories.getPipelineTestReportTestCases({ pipeline_uuid, repo_slug, step_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPipelineTestReports

Get a summary of test reports for a given step of a pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports
const { data, headers } = await bitbucket.repositories.getPipelineTestReports({ pipeline_uuid, repo_slug, step_uuid, workspace, fields })
bitbucket.repositories.getPipelineTestReports({ pipeline_uuid, repo_slug, step_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

step_uuid string

The UUID of the step.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPipelineVariable

Retrieve a repository level variable. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.repositories.getPipelineVariable({ repo_slug, variable_uuid, workspace, fields })
bitbucket.repositories.getPipelineVariable({ repo_slug, variable_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

variable_uuid string

The UUID of the variable to retrieve.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getPullRequest

Returns the specified pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}
const { data, headers } = await bitbucket.repositories.getPullRequest({ pull_request_id, repo_slug, workspace, fields })
bitbucket.repositories.getPullRequest({ pull_request_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getPullRequestComment

Returns a specific pull request comment. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
const { data, headers } = await bitbucket.repositories.getPullRequestComment({ comment_id, pull_request_id, repo_slug, workspace, fields })
bitbucket.repositories.getPullRequestComment({ comment_id, pull_request_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getPullRequestDiff

Redirects to the repository diff with the revspec that corresponds to the pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diff
const { data, headers } = await bitbucket.repositories.getPullRequestDiff({ pull_request_id, repo_slug, workspace, fields })
bitbucket.repositories.getPullRequestDiff({ pull_request_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getPullRequestDiffStat

Redirects to the repository diffstat with the revspec that corresponds to the pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstat
const { data, headers } = await bitbucket.repositories.getPullRequestDiffStat({ pull_request_id, repo_slug, workspace, fields })
bitbucket.repositories.getPullRequestDiffStat({ pull_request_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getPullRequestHostedPropertyValue

Retrieve an application property value stored against a pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.repositories.getPullRequestHostedPropertyValue({ app_key, property_name, pullrequest_id, repo_slug, workspace, fields })
bitbucket.repositories.getPullRequestHostedPropertyValue({ app_key, property_name, pullrequest_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

pullrequest_id string

The pull request ID.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

fields optional string

repositories - getPullRequestPatch

Redirects to the repository patch with the revspec that corresponds to pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/patch
const { data, headers } = await bitbucket.repositories.getPullRequestPatch({ pull_request_id, repo_slug, workspace, fields })
bitbucket.repositories.getPullRequestPatch({ pull_request_id, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getPullRequestTask

Returns a specific pull request task. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
const { data, headers } = await bitbucket.repositories.getPullRequestTask({ pull_request_id, repo_slug, task_id, workspace, fields })
bitbucket.repositories.getPullRequestTask({ pull_request_id, repo_slug, task_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

task_id integer

The ID of the task.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getReport

Returns a single Report matching the provided ID. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
const { data, headers } = await bitbucket.repositories.getReport({ commit, repo_slug, reportId, workspace, fields })
bitbucket.repositories.getReport({ commit, repo_slug, reportId, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit the report belongs to.

repo_slug string

The repository.

reportId string

Either the uuid or external-id of the report.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

repositories - getReportsForCommit

Returns a paginated list of Reports linked to this commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports
const { data, headers } = await bitbucket.repositories.getReportsForCommit({ commit, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.getReportsForCommit({ commit, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit for which to retrieve reports.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - getRepositoryHostedPropertyValue

Retrieve an application property value stored against a repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.repositories.getRepositoryHostedPropertyValue({ app_key, property_name, repo_slug, workspace, fields })
bitbucket.repositories.getRepositoryHostedPropertyValue({ app_key, property_name, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

fields optional string

repositories - getRepositoryPipelineCacheContentURI

Retrieve the URI of the content of the specified cache. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uri
const { data, headers } = await bitbucket.repositories.getRepositoryPipelineCacheContentURI({ cache_uuid, repo_slug, workspace, fields })
bitbucket.repositories.getRepositoryPipelineCacheContentURI({ cache_uuid, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
cache_uuid string

The UUID of the cache.

repo_slug string

The repository.

workspace string

The account.

fields optional string

repositories - getRepositoryPipelineCaches

Retrieve the repository pipelines caches. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines-config/caches
const { data, headers } = await bitbucket.repositories.getRepositoryPipelineCaches({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.getRepositoryPipelineCaches({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

The account.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - getTag

Returns the specified tag. [API Docs]

get
/repositories/{workspace}/{repo_slug}/refs/tags/{name}
const { data, headers } = await bitbucket.repositories.getTag({ name, repo_slug, workspace, fields })
bitbucket.repositories.getTag({ name, repo_slug, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
name string

The name of the tag.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getUserPermission

Returns the explicit user permission for a given user and repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}
const { data, headers } = await bitbucket.repositories.getUserPermission({ repo_slug, selected_user_id, workspace, fields })
bitbucket.repositories.getUserPermission({ repo_slug, selected_user_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

selected_user_id string

This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - getWebhook

Returns the webhook with the specified id installed on the specified repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/hooks/{uid}
const { data, headers } = await bitbucket.repositories.getWebhook({ repo_slug, uid, workspace, fields })
bitbucket.repositories.getWebhook({ repo_slug, uid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

repositories - list

Returns a paginated list of all repositories owned by the specified workspace. [API Docs]

get
/repositories/{workspace}
const { data, headers } = await bitbucket.repositories.list({ role, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.list({ role, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
role optional string

Filters the result based on the authenticated user's role on each repository.

Allowed values: admin, contributor, member, owner

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting.

fields optional string

repositories - listBranchRestrictions

Returns a paginated list of all branch restrictions on the repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/branch-restrictions
const { data, headers } = await bitbucket.repositories.listBranchRestrictions({ kind, pattern, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listBranchRestrictions({ kind, pattern, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
kind optional string

Branch restrictions of this type

pattern optional string

Branch restrictions applied to branches of this pattern

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listBranches

Returns a list of all open branches within the specified repository. Results will be in the order the source control manager returns them. [API Docs]

get
/repositories/{workspace}/{repo_slug}/refs/branches
const { data, headers } = await bitbucket.repositories.listBranches({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listBranches({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. The name field is handled specially for branches in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return ['branch1', 'branch2', 'branch10'] instead of ['branch1', 'branch10', 'branch2'].

fields optional string

repositories - listCommitComments

Returns the commit's comments. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments
const { data, headers } = await bitbucket.repositories.listCommitComments({ commit, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listCommitComments({ commit, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting.

fields optional string

repositories - listCommitStatuses

Returns all statuses (e.g. build results) for a specific commit. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses
const { data, headers } = await bitbucket.repositories.listCommitStatuses({ commit, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listCommitStatuses({ commit, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. Defaults to created_on.

fields optional string

repositories - listCommits

These are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of git log. Like these tools, the DAG can be filtered. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commits
const { data, headers } = await bitbucket.repositories.listCommits({ exclude, include, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listCommits({ exclude, include, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
exclude optional string
include optional string
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listCommitsAlt

[API Docs]

post
/repositories/{workspace}/{repo_slug}/commits{?page,pagelen,q,sort}
const { data, headers } = await bitbucket.repositories.listCommitsAlt({ exclude, include, repo_slug, workspace, page, pagelen, q, sort })
bitbucket.repositories.listCommitsAlt({ exclude, include, repo_slug, workspace, page, pagelen, q, sort }).then(({ data, headers }) => {})

Parameters

Field Type Description
exclude optional string
include optional string
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string

repositories - listCommitsAt

These are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of git log. Like these tools, the DAG can be filtered. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commits/{revision}
const { data, headers } = await bitbucket.repositories.listCommitsAt({ exclude, include, repo_slug, revision, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listCommitsAt({ exclude, include, repo_slug, revision, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
exclude optional string
include optional string
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

revision string

A commit SHA1 or ref name.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listCommitsAtAlt

[API Docs]

post
/repositories/{workspace}/{repo_slug}/commits/{revision}{?page,pagelen,q,sort}
const { data, headers } = await bitbucket.repositories.listCommitsAtAlt({ exclude, include, repo_slug, revision, workspace, page, pagelen, q, sort })
bitbucket.repositories.listCommitsAtAlt({ exclude, include, repo_slug, revision, workspace, page, pagelen, q, sort }).then(({ data, headers }) => {})

Parameters

Field Type Description
exclude optional string
include optional string
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

revision string

A commit SHA1 or ref name.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string

repositories - listComponents

Returns the components that have been defined in the issue tracker. [API Docs]

get
/repositories/{workspace}/{repo_slug}/components
const { data, headers } = await bitbucket.repositories.listComponents({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listComponents({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listDefaultReviewers

Returns the repository's default reviewers. [API Docs]

get
/repositories/{workspace}/{repo_slug}/default-reviewers
const { data, headers } = await bitbucket.repositories.listDefaultReviewers({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listDefaultReviewers({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listDeployKeys

Returns all deploy-keys belonging to a repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/deploy-keys
const { data, headers } = await bitbucket.repositories.listDeployKeys({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listDeployKeys({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listDeploymentVariables

Find deployment environment level variables. [API Docs]

get
/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables
const { data, headers } = await bitbucket.repositories.listDeploymentVariables({ environment_uuid, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listDeploymentVariables({ environment_uuid, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
environment_uuid string

The environment.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listDeployments

Find deployments [API Docs]

get
/repositories/{workspace}/{repo_slug}/deployments
const { data, headers } = await bitbucket.repositories.listDeployments({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listDeployments({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listDiffStats

Produces a response in JSON format with a record for every path modified, including information on the type of the change and the number of lines added and removed. [API Docs]

get
/repositories/{workspace}/{repo_slug}/diffstat/{spec}
const { data, headers } = await bitbucket.repositories.listDiffStats({ ignore_whitespace, merge, path, renames, repo_slug, spec, topic, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listDiffStats({ ignore_whitespace, merge, path, renames, repo_slug, spec, topic, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
ignore_whitespace optional boolean

Generate diffs that ignore whitespace

merge optional boolean

This parameter is deprecated. The 'topic' parameter should be used instead. The 'merge' and 'topic' parameters cannot be both used at the same time.

path optional string

Limit the diffstat to a particular file (this parameter can be repeated for multiple paths).

renames optional boolean

Whether to perform rename detection, true if omitted.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

spec string

A commit SHA (e.g. 3a8b42) or a commit range using double dot notation (e.g. 3a8b42..9ff173).

topic optional boolean

If true, returns 2-way 'three-dot' diff. This is a diff between the source commit and the merge base of the source commit and the destination commit. If false, a simple 'two dot' diff between the source and destination is returned.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listDownloads

Returns a list of download links associated with the repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/downloads
const { data, headers } = await bitbucket.repositories.listDownloads({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listDownloads({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listEffectiveDefaultReviewers

Returns the repository's effective default reviewers. This includes both default reviewers defined at the repository level as well as those inherited from its project. [API Docs]

get
/repositories/{workspace}/{repo_slug}/effective-default-reviewers
const { data, headers } = await bitbucket.repositories.listEffectiveDefaultReviewers({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listEffectiveDefaultReviewers({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listEnvironments

Find environments [API Docs]

get
/repositories/{workspace}/{repo_slug}/environments
const { data, headers } = await bitbucket.repositories.listEnvironments({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listEnvironments({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listFileHistory

Returns a paginated list of commits that modified the specified file. [API Docs]

get
/repositories/{workspace}/{repo_slug}/filehistory/{commit}/{path}
const { data, headers } = await bitbucket.repositories.listFileHistory({ commit, path, renames, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listFileHistory({ commit, path, renames, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

path string

Path to the file.

renames optional string

When true, Bitbucket will follow the history of the file across renames (this is the default behavior). This can be turned off by specifying false.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Name of a response property sort the result by as per filtering and sorting.

fields optional string

repositories - listForks

Returns a paginated list of all the forks of the specified repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/forks
const { data, headers } = await bitbucket.repositories.listForks({ repo_slug, role, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listForks({ repo_slug, role, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

role optional string

Filters the result based on the authenticated user's role on each repository.

Allowed values: admin, contributor, member, owner

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting.

fields optional string

repositories - listGlobal

Returns a paginated list of all public repositories. [API Docs]

get
/repositories
const { data, headers } = await bitbucket.repositories.listGlobal({ after, role, page, pagelen, q, sort, fields })
bitbucket.repositories.listGlobal({ after, role, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
after optional string

Filter the results to include only repositories created on or after this ISO-8601 timestamp. Example: YYYY-MM-DDTHH:mm:ss.sssZ

role optional string

Filters the result based on the authenticated user's role on each repository.

Allowed values: admin, contributor, member, owner

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting. role parameter must also be specified.

sort optional string

Field by which the results should be sorted as per filtering and sorting.

fields optional string

repositories - listGroupPermissions

Returns a paginated list of explicit group permissions for the given repository. This endpoint does not support BBQL features. [API Docs]

get
/repositories/{workspace}/{repo_slug}/permissions-config/groups
const { data, headers } = await bitbucket.repositories.listGroupPermissions({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listGroupPermissions({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listIssueAttachments

Returns all attachments for this issue. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments
const { data, headers } = await bitbucket.repositories.listIssueAttachments({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listIssueAttachments({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listIssueChanges

Returns the list of all changes that have been made to the specified issue. Changes are returned in chronological order with the oldest change first. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes
const { data, headers } = await bitbucket.repositories.listIssueChanges({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listIssueChanges({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response. See filtering and sorting for details.

sort optional string

Name of a response property to sort results. See filtering and sorting for details.

fields optional string

repositories - listIssueComments

Returns a paginated list of all comments that were made on the specified issue. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments
const { data, headers } = await bitbucket.repositories.listIssueComments({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listIssueComments({ issue_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string
fields optional string

repositories - listIssues

Returns the issues in the issue tracker. [API Docs]

get
/repositories/{workspace}/{repo_slug}/issues
const { data, headers } = await bitbucket.repositories.listIssues({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listIssues({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listMilestones

Returns the milestones that have been defined in the issue tracker. [API Docs]

get
/repositories/{workspace}/{repo_slug}/milestones
const { data, headers } = await bitbucket.repositories.listMilestones({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listMilestones({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPermissions

Returns an object for each repository the caller has explicit access to and their effective permission — the highest level of permission the caller has. This does not return public repositories that the user was not granted any specific permission in, and does not distinguish between explicit and implicit privileges. [API Docs]

get
/user/permissions/repositories
const { data, headers } = await bitbucket.repositories.listPermissions({ page, pagelen, q, sort, fields })
bitbucket.repositories.listPermissions({ page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Name of a response property sort the result by as per filtering and sorting.

fields optional string

repositories - listPipelineKnownHosts

Find repository level known hosts. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts
const { data, headers } = await bitbucket.repositories.listPipelineKnownHosts({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPipelineKnownHosts({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPipelineScheduleExecutions

Retrieve the executions of a given schedule. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executions
const { data, headers } = await bitbucket.repositories.listPipelineScheduleExecutions({ repo_slug, schedule_uuid, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPipelineScheduleExecutions({ repo_slug, schedule_uuid, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

schedule_uuid string

The uuid of the schedule.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPipelineSchedules

Retrieve the configured schedules for the given repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules
const { data, headers } = await bitbucket.repositories.listPipelineSchedules({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPipelineSchedules({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPipelineSteps

Find steps for the given pipeline. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps
const { data, headers } = await bitbucket.repositories.listPipelineSteps({ pipeline_uuid, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPipelineSteps({ pipeline_uuid, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPipelineVariables

Find repository level variables. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines_config/variables
const { data, headers } = await bitbucket.repositories.listPipelineVariables({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPipelineVariables({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPipelines

Find pipelines [API Docs]

get
/repositories/{workspace}/{repo_slug}/pipelines
const { data, headers } = await bitbucket.repositories.listPipelines({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPipelines({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPullRequestActivities

Returns a paginated list of the pull request's activity log. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/activity
const { data, headers } = await bitbucket.repositories.listPullRequestActivities({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPullRequestActivities({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPullRequestActivitiesForRepo

Returns a paginated list of the pull request's activity log. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/activity
const { data, headers } = await bitbucket.repositories.listPullRequestActivitiesForRepo({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPullRequestActivitiesForRepo({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPullRequestComments

Returns a paginated list of the pull request's comments. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments
const { data, headers } = await bitbucket.repositories.listPullRequestComments({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPullRequestComments({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPullRequestCommits

Returns a paginated list of the pull request's commits. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits
const { data, headers } = await bitbucket.repositories.listPullRequestCommits({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPullRequestCommits({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPullRequestStatuses

Returns all statuses (e.g. build results) for the given pull request. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses
const { data, headers } = await bitbucket.repositories.listPullRequestStatuses({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPullRequestStatuses({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. Defaults to created_on.

fields optional string

repositories - listPullRequestTasks

Returns a paginated list of the pull request's tasks. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks
const { data, headers } = await bitbucket.repositories.listPullRequestTasks({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPullRequestTasks({ pull_request_id, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer

Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.

q optional string

Query string to narrow down the response. See filtering and sorting for details.

sort optional string

Field by which the results should be sorted as per filtering and sorting. Defaults to created_on.

fields optional string

repositories - listPullRequests

Returns all pull requests on the specified repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/pullrequests
const { data, headers } = await bitbucket.repositories.listPullRequests({ repo_slug, state, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPullRequests({ repo_slug, state, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

state optional string

Only return pull requests that are in this state. This parameter can be repeated.

Allowed values: OPEN, MERGED, DECLINED, SUPERSEDED

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listPullrequestsForCommit

Returns a paginated list of all pull requests as part of which this commit was reviewed. Pull Request Commit Links app must be installed first before using this API; installation automatically occurs when 'Go to pull request' is clicked from the web interface for a commit's details. [API Docs]

get
/repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests
const { data, headers } = await bitbucket.repositories.listPullrequestsForCommit({ commit, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listPullrequestsForCommit({ commit, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The SHA1 of the commit

repo_slug string

The repository; either the UUID in curly braces, or the slug

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces

page optional string

Which page to retrieve

Default value: 1

pagelen optional integer

How many pull requests to retrieve per page

Default value: 30

q optional string
sort optional string
fields optional string

repositories - listRefs

Returns the branches and tags in the repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/refs
const { data, headers } = await bitbucket.repositories.listRefs({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listRefs({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. The name field is handled specially for refs in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2'].

fields optional string

repositories - listTags

Returns the tags in the repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/refs/tags
const { data, headers } = await bitbucket.repositories.listTags({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listTags({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Field by which the results should be sorted as per filtering and sorting. The name field is handled specially for tags in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2'].

fields optional string

repositories - listUserPermissions

Returns a paginated list of explicit user permissions for the given repository. This endpoint does not support BBQL features. [API Docs]

get
/repositories/{workspace}/{repo_slug}/permissions-config/users
const { data, headers } = await bitbucket.repositories.listUserPermissions({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listUserPermissions({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listVersions

Returns the versions that have been defined in the issue tracker. [API Docs]

get
/repositories/{workspace}/{repo_slug}/versions
const { data, headers } = await bitbucket.repositories.listVersions({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listVersions({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listWatchers

Returns a paginated list of all the watchers on the specified repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/watchers
const { data, headers } = await bitbucket.repositories.listWatchers({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listWatchers({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - listWebhooks

Returns a paginated list of webhooks installed on this repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/hooks
const { data, headers } = await bitbucket.repositories.listWebhooks({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.listWebhooks({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - mergePullRequest

[API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge{?async}
const { data, headers } = await bitbucket.repositories.mergePullRequest({ _body, async, pull_request_id, repo_slug, workspace })
bitbucket.repositories.mergePullRequest({ _body, async, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any
async optional boolean

Default value is false.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - readSrc

This endpoints is used to retrieve the contents of a single file, or the contents of a directory at a specified revision. [API Docs]

get
/repositories/{workspace}/{repo_slug}/src/{commit}/{path}
const { data, headers } = await bitbucket.repositories.readSrc({ commit, format, max_depth, path, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.readSrc({ commit, format, max_depth, path, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

format optional string

If 'meta' is provided, returns the (json) meta data for the contents of the file. If 'rendered' is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. The 'rendered' option only supports these filetypes: .md, .markdown, .mkd, .mkdn, .mdown, .text, .rst, and .textile. Since Git does not generally track what text encoding scheme is used, this endpoint attempts to detect the most appropriate character encoding. While usually correct, determining the character encoding can be ambiguous which in exceptional cases can lead to misinterpretation of the characters. As such, the raw element in the response object should not be treated as equivalent to the file's actual contents.

Allowed values: meta, rendered

max_depth optional integer

If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1.

path string

Path to the file.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Optional filter expression as per filtering and sorting.

sort optional string

Optional sorting parameter as per filtering and sorting.

fields optional string

repositories - readSrcRoot

This endpoint redirects the client to the directory listing of the root directory on the main branch. [API Docs]

get
/repositories/{workspace}/{repo_slug}/src
const { data, headers } = await bitbucket.repositories.readSrcRoot({ format, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.repositories.readSrcRoot({ format, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
format optional string

Instead of returning the file's contents, return the (json) meta data for it.

Allowed values: meta

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

repositories - reopenPullRequestComment

[API Docs]

delete
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve
const { data, headers } = await bitbucket.repositories.reopenPullRequestComment({ comment_id, pull_request_id, repo_slug, workspace })
bitbucket.repositories.reopenPullRequestComment({ comment_id, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - resolvePullRequestComment

[API Docs]

post
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve
const { data, headers } = await bitbucket.repositories.resolvePullRequestComment({ comment_id, pull_request_id, repo_slug, workspace })
bitbucket.repositories.resolvePullRequestComment({ comment_id, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - stopPipeline

Signal the stop of a pipeline and all of its steps that not have completed yet. [API Docs]

post
/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/stopPipeline
const { data, headers } = await bitbucket.repositories.stopPipeline({ pipeline_uuid, repo_slug, workspace })
bitbucket.repositories.stopPipeline({ pipeline_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
pipeline_uuid string

The UUID of the pipeline.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - update

Since this endpoint can be used to both update and to create a repository, the request body depends on the intent. [API Docs]

put
/repositories/{workspace}/{repo_slug}
const { data, headers } = await bitbucket.repositories.update({ _body, repo_slug, workspace })
bitbucket.repositories.update({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The repository that is to be updated.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updateBranchRestriction

Updates an existing branch restriction rule. [API Docs]

put
/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}
const { data, headers } = await bitbucket.repositories.updateBranchRestriction({ _body, id, repo_slug, workspace })
bitbucket.repositories.updateBranchRestriction({ _body, id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new version of the existing rule

id string

The restriction rule's id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updateBranchingModelSettings

Update the branching model configuration for a repository. [API Docs]

put
/repositories/{workspace}/{repo_slug}/branching-model/settings
const { data, headers } = await bitbucket.repositories.updateBranchingModelSettings({ _body, repo_slug, workspace })
bitbucket.repositories.updateBranchingModelSettings({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updateCommitBuildStatus

Used to update the current status of a build status object on the specific commit. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}
const { data, headers } = await bitbucket.repositories.updateCommitBuildStatus({ _body, commit, key, repo_slug, workspace })
bitbucket.repositories.updateCommitBuildStatus({ _body, commit, key, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The updated build status object

commit string

The commit's SHA1.

key string

The build status' unique key

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updateCommitComment

Used to update the contents of a comment. Only the content of the comment can be updated. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}
const { data, headers } = await bitbucket.repositories.updateCommitComment({ _body, comment_id, commit, repo_slug, workspace })
bitbucket.repositories.updateCommitComment({ _body, comment_id, commit, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated comment.

comment_id integer

The id of the comment.

commit string

The commit's SHA1.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updateCommitHostedPropertyValue

Update an application property value stored against a commit. [API Docs]

put
/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.repositories.updateCommitHostedPropertyValue({ _body, app_key, commit, property_name, repo_slug, workspace })
bitbucket.repositories.updateCommitHostedPropertyValue({ _body, app_key, commit, property_name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The application property to create or update.

app_key string

The key of the Connect app.

commit string

The commit.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

repositories - updateDeployKey

Create a new deploy key in a repository. [API Docs]

put
/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}
const { data, headers } = await bitbucket.repositories.updateDeployKey({ key_id, repo_slug, workspace })
bitbucket.repositories.updateDeployKey({ key_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The key ID matching the deploy key.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updateDeploymentVariable

Update a deployment environment level variable. [API Docs]

put
/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}
const { data, headers } = await bitbucket.repositories.updateDeploymentVariable({ _body, environment_uuid, repo_slug, variable_uuid, workspace })
bitbucket.repositories.updateDeploymentVariable({ _body, environment_uuid, repo_slug, variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated deployment variable.

environment_uuid string

The environment.

repo_slug string

The repository.

variable_uuid string

The UUID of the variable to update.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - updateEnvironment

Update an environment [API Docs]

post
/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}/changes
const { data, headers } = await bitbucket.repositories.updateEnvironment({ environment_uuid, repo_slug, workspace })
bitbucket.repositories.updateEnvironment({ environment_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
environment_uuid string

The environment UUID.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - updateGroupPermission

Updates the group permission, or grants a new permission if one does not already exist. [API Docs]

put
/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}
const { data, headers } = await bitbucket.repositories.updateGroupPermission({ _body, group_slug, repo_slug, workspace })
bitbucket.repositories.updateGroupPermission({ _body, group_slug, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The permission to grant

group_slug string

Slug of the requested group.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updateIssue

Modifies the issue. [API Docs]

put
/repositories/{workspace}/{repo_slug}/issues/{issue_id}
const { data, headers } = await bitbucket.repositories.updateIssue({ _body, issue_id, repo_slug, workspace })
bitbucket.repositories.updateIssue({ _body, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updateIssueComment

Updates the content of the specified issue comment. Note that only the content.raw field can be modified. [API Docs]

put
/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}
const { data, headers } = await bitbucket.repositories.updateIssueComment({ _body, comment_id, issue_id, repo_slug, workspace })
bitbucket.repositories.updateIssueComment({ _body, comment_id, issue_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated comment.

comment_id integer

The id of the comment.

issue_id string

The issue id

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updatePipelineBuildNumber

Update the next build number that should be assigned to a pipeline. The next build number that will be configured has to be strictly higher than the current latest build number for this repository. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config/build_number
const { data, headers } = await bitbucket.repositories.updatePipelineBuildNumber({ _body, repo_slug, workspace })
bitbucket.repositories.updatePipelineBuildNumber({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The build number to update.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - updatePipelineConfig

Update the pipelines configuration for a repository. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config
const { data, headers } = await bitbucket.repositories.updatePipelineConfig({ _body, repo_slug, workspace })
bitbucket.repositories.updatePipelineConfig({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated repository pipelines configuration.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - updatePipelineKnownHost

Update a repository level known host. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}
const { data, headers } = await bitbucket.repositories.updatePipelineKnownHost({ _body, known_host_uuid, repo_slug, workspace })
bitbucket.repositories.updatePipelineKnownHost({ _body, known_host_uuid, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated known host.

known_host_uuid string

The UUID of the known host to update.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - updatePipelineSchedule

Update a schedule. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}
const { data, headers } = await bitbucket.repositories.updatePipelineSchedule({ _body, repo_slug, schedule_uuid, workspace })
bitbucket.repositories.updatePipelineSchedule({ _body, repo_slug, schedule_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The schedule to update.

repo_slug string

The repository.

schedule_uuid string

The uuid of the schedule.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - updatePipelineSshKeyPair

Create or update the repository SSH key pair. The private key will be set as a default SSH identity in your build container. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair
const { data, headers } = await bitbucket.repositories.updatePipelineSshKeyPair({ _body, repo_slug, workspace })
bitbucket.repositories.updatePipelineSshKeyPair({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The created or updated SSH key pair.

repo_slug string

The repository.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - updatePipelineVariable

Update a repository level variable. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.repositories.updatePipelineVariable({ _body, repo_slug, variable_uuid, workspace })
bitbucket.repositories.updatePipelineVariable({ _body, repo_slug, variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated variable

repo_slug string

The repository.

variable_uuid string

The UUID of the variable to update.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repositories - updatePullRequest

Mutates the specified pull request. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}
const { data, headers } = await bitbucket.repositories.updatePullRequest({ _body, pull_request_id, repo_slug, workspace })
bitbucket.repositories.updatePullRequest({ _body, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The pull request that is to be updated.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updatePullRequestComment

Updates a specific pull request comment. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
const { data, headers } = await bitbucket.repositories.updatePullRequestComment({ _body, comment_id, pull_request_id, repo_slug, workspace })
bitbucket.repositories.updatePullRequestComment({ _body, comment_id, pull_request_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The contents of the updated comment.

comment_id integer

The id of the comment.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updatePullRequestHostedPropertyValue

Update an application property value stored against a pull request. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.repositories.updatePullRequestHostedPropertyValue({ _body, app_key, property_name, pullrequest_id, repo_slug, workspace })
bitbucket.repositories.updatePullRequestHostedPropertyValue({ _body, app_key, property_name, pullrequest_id, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The application property to create or update.

app_key string

The key of the Connect app.

property_name string

The name of the property.

pullrequest_id string

The pull request ID.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

repositories - updatePullRequestTask

Updates a specific pull request task. [API Docs]

put
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
const { data, headers } = await bitbucket.repositories.updatePullRequestTask({ _body, pull_request_id, repo_slug, task_id, workspace })
bitbucket.repositories.updatePullRequestTask({ _body, pull_request_id, repo_slug, task_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated state and content of the task.

pull_request_id integer

The id of the pull request.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

task_id integer

The ID of the task.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updateRepositoryHostedPropertyValue

Update an application property value stored against a repository. [API Docs]

put
/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.repositories.updateRepositoryHostedPropertyValue({ _body, app_key, property_name, repo_slug, workspace })
bitbucket.repositories.updateRepositoryHostedPropertyValue({ _body, app_key, property_name, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The application property to create or update.

app_key string

The key of the Connect app.

property_name string

The name of the property.

repo_slug string

The repository.

workspace string

The repository container; either the workspace slug or the UUID in curly braces.

repositories - updateUserPermission

Updates the explicit user permission for a given user and repository. The selected user must be a member of the workspace, and cannot be the workspace owner. Only users with admin permission for the repository may access this resource. [API Docs]

put
/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}
const { data, headers } = await bitbucket.repositories.updateUserPermission({ _body, repo_slug, selected_user_id, workspace })
bitbucket.repositories.updateUserPermission({ _body, repo_slug, selected_user_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The permission to grant

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

selected_user_id string

This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

repositories - updateWebhook

Updates the specified webhook subscription. [API Docs]

put
/repositories/{workspace}/{repo_slug}/hooks/{uid}
const { data, headers } = await bitbucket.repositories.updateWebhook({ repo_slug, uid, workspace })
bitbucket.repositories.updateWebhook({ repo_slug, uid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

snippet

snippet - getRawFiles

Convenience resource for getting to a snippet's raw files without the need for first having to retrieve the snippet itself and having to pull out the versioned file links. [API Docs]

get
/snippets/{workspace}/{encoded_id}/files/{path}
const { data, headers } = await bitbucket.snippet.getRawFiles({ encoded_id, path, workspace, fields })
bitbucket.snippet.getRawFiles({ encoded_id, path, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

path string

Path to the file.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

snippets

snippets - checkWatch

Used to check if the current user is watching a specific snippet. [API Docs]

get
/snippets/{workspace}/{encoded_id}/watch
const { data, headers } = await bitbucket.snippets.checkWatch({ encoded_id, workspace, fields })
bitbucket.snippets.checkWatch({ encoded_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

snippets - create

Creates a new snippet under the authenticated user's account. [API Docs]

post
/snippets
const { data, headers } = await bitbucket.snippets.create({ _body })
bitbucket.snippets.create({ _body }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new snippet object.

snippets - createComment

Creates a new comment. [API Docs]

post
/snippets/{workspace}/{encoded_id}/comments
const { data, headers } = await bitbucket.snippets.createComment({ _body, encoded_id, workspace })
bitbucket.snippets.createComment({ _body, encoded_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The contents of the new comment.

encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

snippets - createForUser

Identical to /snippets, except that the new snippet will be created under the workspace specified in the path parameter {workspace}. [API Docs]

post
/snippets/{workspace}
const { data, headers } = await bitbucket.snippets.createForUser({ _body, workspace })
bitbucket.snippets.createForUser({ _body, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The new snippet object.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

snippets - delete

Deletes a snippet and returns an empty response. [API Docs]

delete
/snippets/{workspace}/{encoded_id}
const { data, headers } = await bitbucket.snippets.delete({ encoded_id, workspace })
bitbucket.snippets.delete({ encoded_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

snippets - deleteAt

Deletes the snippet. [API Docs]

delete
/snippets/{workspace}/{encoded_id}/{node_id}
const { data, headers } = await bitbucket.snippets.deleteAt({ encoded_id, node_id, workspace })
bitbucket.snippets.deleteAt({ encoded_id, node_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

node_id string

A commit revision (SHA1).

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

snippets - deleteComment

Deletes a snippet comment. [API Docs]

delete
/snippets/{workspace}/{encoded_id}/comments/{comment_id}
const { data, headers } = await bitbucket.snippets.deleteComment({ comment_id, encoded_id, workspace })
bitbucket.snippets.deleteComment({ comment_id, encoded_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

snippets - get

Retrieves a single snippet. [API Docs]

get
/snippets/{workspace}/{encoded_id}
const { data, headers } = await bitbucket.snippets.get({ encoded_id, workspace, fields })
bitbucket.snippets.get({ encoded_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

snippets - getAt

Identical to GET /snippets/encoded_id, except that this endpoint can be used to retrieve the contents of the snippet as it was at an older revision, while /snippets/encoded_id always returns the snippet's current revision. [API Docs]

get
/snippets/{workspace}/{encoded_id}/{node_id}
const { data, headers } = await bitbucket.snippets.getAt({ encoded_id, node_id, workspace, fields })
bitbucket.snippets.getAt({ encoded_id, node_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

node_id string

A commit revision (SHA1).

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

snippets - getComment

Returns the specific snippet comment. [API Docs]

get
/snippets/{workspace}/{encoded_id}/comments/{comment_id}
const { data, headers } = await bitbucket.snippets.getComment({ comment_id, encoded_id, workspace, fields })
bitbucket.snippets.getComment({ comment_id, encoded_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
comment_id integer

The id of the comment.

encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

snippets - getCommit

Returns the changes made on this snippet in this commit. [API Docs]

get
/snippets/{workspace}/{encoded_id}/commits/{revision}
const { data, headers } = await bitbucket.snippets.getCommit({ encoded_id, revision, workspace, fields })
bitbucket.snippets.getCommit({ encoded_id, revision, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

revision string

The commit's SHA1.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

snippets - getDiff

Returns the diff of the specified commit against its first parent. [API Docs]

get
/snippets/{workspace}/{encoded_id}/{revision}/diff
const { data, headers } = await bitbucket.snippets.getDiff({ encoded_id, path, revision, workspace, fields })
bitbucket.snippets.getDiff({ encoded_id, path, revision, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

path optional string

When used, only one the diff of the specified file will be returned.

revision string

A revspec expression. This can simply be a commit SHA1, a ref name, or a compare expression like staging..production.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

snippets - getFile

Retrieves the raw contents of a specific file in the snippet. The Content-Disposition header will be "attachment" to avoid issues with malevolent executable files. [API Docs]

get
/snippets/{workspace}/{encoded_id}/{node_id}/files/{path}
const { data, headers } = await bitbucket.snippets.getFile({ encoded_id, node_id, path, workspace, fields })
bitbucket.snippets.getFile({ encoded_id, node_id, path, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

node_id string

A commit revision (SHA1).

path string

Path to the file.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

snippets - getPatch

Returns the patch of the specified commit against its first parent. [API Docs]

get
/snippets/{workspace}/{encoded_id}/{revision}/patch
const { data, headers } = await bitbucket.snippets.getPatch({ encoded_id, revision, workspace, fields })
bitbucket.snippets.getPatch({ encoded_id, revision, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

revision string

A revspec expression. This can simply be a commit SHA1, a ref name, or a compare expression like staging..production.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

snippets - getRawFiles

Convenience resource for getting to a snippet's raw files without the need for first having to retrieve the snippet itself and having to pull out the versioned file links. [API Docs]

get
/snippets/{workspace}/{encoded_id}/files/{path}
const { data, headers } = await bitbucket.snippets.getRawFiles({ encoded_id, path, workspace, fields })
bitbucket.snippets.getRawFiles({ encoded_id, path, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

path string

Path to the file.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

snippets - list

Returns all snippets. Like pull requests, repositories and workspaces, the full set of snippets is defined by what the current user has access to. [API Docs]

get
/snippets
const { data, headers } = await bitbucket.snippets.list({ role, page, pagelen, q, sort, fields })
bitbucket.snippets.list({ role, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
role optional string

Filter down the result based on the authenticated user's role (owner, contributor, or member).

Allowed values: owner, contributor, member

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

snippets - listComments

Used to retrieve a paginated list of all comments for a specific snippet. [API Docs]

get
/snippets/{workspace}/{encoded_id}/comments
const { data, headers } = await bitbucket.snippets.listComments({ encoded_id, workspace, page, pagelen, q, sort, fields })
bitbucket.snippets.listComments({ encoded_id, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

snippets - listCommits

Returns the changes (commits) made on this snippet. [API Docs]

get
/snippets/{workspace}/{encoded_id}/commits
const { data, headers } = await bitbucket.snippets.listCommits({ encoded_id, workspace, page, pagelen, q, sort, fields })
bitbucket.snippets.listCommits({ encoded_id, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

snippets - listForUser

Identical to /snippets, except that the result is further filtered by the snippet owner and only those that are owned by {workspace} are returned. [API Docs]

get
/snippets/{workspace}
const { data, headers } = await bitbucket.snippets.listForUser({ role, workspace, page, pagelen, q, sort, fields })
bitbucket.snippets.listForUser({ role, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
role optional string

Filter down the result based on the authenticated user's role (owner, contributor, or member).

Allowed values: owner, contributor, member

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

snippets - listWatchers

Returns a paginated list of all users watching a specific snippet. [API Docs]

get
/snippets/{workspace}/{encoded_id}/watchers
const { data, headers } = await bitbucket.snippets.listWatchers({ encoded_id, workspace, page, pagelen, q, sort, fields })
bitbucket.snippets.listWatchers({ encoded_id, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

snippets - startWatch

Used to start watching a specific snippet. Returns 204 (No Content). [API Docs]

put
/snippets/{workspace}/{encoded_id}/watch
const { data, headers } = await bitbucket.snippets.startWatch({ encoded_id, workspace })
bitbucket.snippets.startWatch({ encoded_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

snippets - stopWatch

Used to stop watching a specific snippet. Returns 204 (No Content) to indicate success. [API Docs]

delete
/snippets/{workspace}/{encoded_id}/watch
const { data, headers } = await bitbucket.snippets.stopWatch({ encoded_id, workspace })
bitbucket.snippets.stopWatch({ encoded_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

snippets - update

Used to update a snippet. Use this to add and delete files and to change a snippet's title. [API Docs]

put
/snippets/{workspace}/{encoded_id}
const { data, headers } = await bitbucket.snippets.update({ encoded_id, workspace })
bitbucket.snippets.update({ encoded_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

snippets - updateAt

Identical to UPDATE /snippets/encoded_id, except that this endpoint takes an explicit commit revision. Only the snippet's "HEAD"/"tip" (most recent) version can be updated and requests on all other, older revisions fail by returning a 405 status. [API Docs]

put
/snippets/{workspace}/{encoded_id}/{node_id}
const { data, headers } = await bitbucket.snippets.updateAt({ encoded_id, node_id, workspace })
bitbucket.snippets.updateAt({ encoded_id, node_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
encoded_id string

The snippet id.

node_id string

A commit revision (SHA1).

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

snippets - updateComment

Updates a comment. [API Docs]

put
/snippets/{workspace}/{encoded_id}/comments/{comment_id}
const { data, headers } = await bitbucket.snippets.updateComment({ _body, comment_id, encoded_id, workspace })
bitbucket.snippets.updateComment({ _body, comment_id, encoded_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The contents to update the comment to.

comment_id integer

The id of the comment.

encoded_id string

The snippet id.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

source

source - createFileCommit

This endpoint is used to create new commits in the repository by uploading files. [API Docs]

post
/repositories/{workspace}/{repo_slug}/src
const { data, headers } = await bitbucket.source.createFileCommit({ _body, author, branch, files, message, parents, repo_slug, workspace })
bitbucket.source.createFileCommit({ _body, author, branch, files, message, parents, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any
author optional string

The raw string to be used as the new commit's author. This string follows the format Erik van Zijst <evzijst@atlassian.com>.

branch optional string

The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new head.

files optional string

Optional field that declares the files that the request is manipulating. When adding a new file to a repo, or when overwriting an existing file, the client can just upload the full contents of the file in a normal form field and the use of this files meta data field is redundant. However, when the files field contains a file path that does not have a corresponding, identically-named form field, then Bitbucket interprets that as the client wanting to replace the named file with the null set and the file is deleted instead.

message optional string

The commit message. When omitted, Bitbucket uses a canned string.

parents optional string

A comma-separated list of SHA1s of the commits that should be the parents of the newly created commit.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

source - listHistory

Returns a paginated list of commits that modified the specified file. [API Docs]

get
/repositories/{workspace}/{repo_slug}/filehistory/{commit}/{path}
const { data, headers } = await bitbucket.source.listHistory({ commit, path, renames, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.source.listHistory({ commit, path, renames, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

path string

Path to the file.

renames optional string

When true, Bitbucket will follow the history of the file across renames (this is the default behavior). This can be turned off by specifying false.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Name of a response property sort the result by as per filtering and sorting.

fields optional string

source - read

This endpoints is used to retrieve the contents of a single file, or the contents of a directory at a specified revision. [API Docs]

get
/repositories/{workspace}/{repo_slug}/src/{commit}/{path}
const { data, headers } = await bitbucket.source.read({ commit, format, max_depth, path, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.source.read({ commit, format, max_depth, path, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
commit string

The commit's SHA1.

format optional string

If 'meta' is provided, returns the (json) meta data for the contents of the file. If 'rendered' is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. The 'rendered' option only supports these filetypes: .md, .markdown, .mkd, .mkdn, .mdown, .text, .rst, and .textile. Since Git does not generally track what text encoding scheme is used, this endpoint attempts to detect the most appropriate character encoding. While usually correct, determining the character encoding can be ambiguous which in exceptional cases can lead to misinterpretation of the characters. As such, the raw element in the response object should not be treated as equivalent to the file's actual contents.

Allowed values: meta, rendered

max_depth optional integer

If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1.

path string

Path to the file.

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Optional filter expression as per filtering and sorting.

sort optional string

Optional sorting parameter as per filtering and sorting.

fields optional string

source - readRoot

This endpoint redirects the client to the directory listing of the root directory on the main branch. [API Docs]

get
/repositories/{workspace}/{repo_slug}/src
const { data, headers } = await bitbucket.source.readRoot({ format, repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.source.readRoot({ format, repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
format optional string

Instead of returning the file's contents, return the (json) meta data for it.

Allowed values: meta

repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

ssh

ssh - createKey

Adds a new SSH public key to the specified user account and returns the resulting key. [API Docs]

post
/users/{selected_user}/ssh-keys
const { data, headers } = await bitbucket.ssh.createKey({ _body, selected_user })
bitbucket.ssh.createKey({ _body, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The new SSH key object. Note that the username property has been deprecated due to privacy changes.

selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

ssh - deleteKey

Deletes a specific SSH public key from a user's account. [API Docs]

delete
/users/{selected_user}/ssh-keys/{key_id}
const { data, headers } = await bitbucket.ssh.deleteKey({ key_id, selected_user })
bitbucket.ssh.deleteKey({ key_id, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The SSH key's UUID value.

selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

ssh - getKey

Returns a specific SSH public key belonging to a user. [API Docs]

get
/users/{selected_user}/ssh-keys/{key_id}
const { data, headers } = await bitbucket.ssh.getKey({ key_id, selected_user, fields })
bitbucket.ssh.getKey({ key_id, selected_user, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The SSH key's UUID value.

selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

fields optional string

ssh - listKeys

Returns a paginated list of the user's SSH public keys. [API Docs]

get
/users/{selected_user}/ssh-keys
const { data, headers } = await bitbucket.ssh.listKeys({ selected_user, page, pagelen, q, sort, fields })
bitbucket.ssh.listKeys({ selected_user, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

ssh - updateKey

Updates a specific SSH public key on a user's account [API Docs]

put
/users/{selected_user}/ssh-keys/{key_id}
const { data, headers } = await bitbucket.ssh.updateKey({ _body, key_id, selected_user })
bitbucket.ssh.updateKey({ _body, key_id, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The updated SSH key object

key_id string

The SSH key's UUID value.

selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

teams

teams - createPipelineVariable

Create an account level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

post
/teams/{username}/pipelines_config/variables
const { data, headers } = await bitbucket.teams.createPipelineVariable({ _body, username })
bitbucket.teams.createPipelineVariable({ _body, username }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The variable to create.

username string

The account.

teams - deletePipelineVariable

Delete a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

delete
/teams/{username}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.teams.deletePipelineVariable({ username, variable_uuid })
bitbucket.teams.deletePipelineVariable({ username, variable_uuid }).then(({ data, headers }) => {})

Parameters

Field Type Description
username string

The account.

variable_uuid string

The UUID of the variable to delete.

teams - getPipelineVariable

Retrieve a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

get
/teams/{username}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.teams.getPipelineVariable({ username, variable_uuid, fields })
bitbucket.teams.getPipelineVariable({ username, variable_uuid, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
username string

The account.

variable_uuid string

The UUID of the variable to retrieve.

fields optional string

teams - listPipelineVariables

Find account level variables. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

get
/teams/{username}/pipelines_config/variables
const { data, headers } = await bitbucket.teams.listPipelineVariables({ username, page, pagelen, q, sort, fields })
bitbucket.teams.listPipelineVariables({ username, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
username string

The account.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

teams - searchCode

Search for code in the repositories of the specified team. [API Docs]

get
/teams/{username}/search/code
const { data, headers } = await bitbucket.teams.searchCode({ search_query, username, fields })
bitbucket.teams.searchCode({ search_query, username, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
search_query string

The search query

username string

The account to search in; either the username or the UUID in curly braces

fields optional string

teams - updatePipelineVariable

Update a team level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

put
/teams/{username}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.teams.updatePipelineVariable({ _body, username, variable_uuid })
bitbucket.teams.updatePipelineVariable({ _body, username, variable_uuid }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated variable.

username string

The account.

variable_uuid string

The UUID of the variable.

user

user - get

Returns the currently logged in user. [API Docs]

get
/user
const { data, headers } = await bitbucket.user.get({ fields })
bitbucket.user.get({ fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
fields optional string

user - getEmail

Returns details about a specific one of the authenticated user's email addresses. [API Docs]

get
/user/emails/{email}
const { data, headers } = await bitbucket.user.getEmail({ email, fields })
bitbucket.user.getEmail({ email, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
email string

Email address of the user.

fields optional string

user - listEmails

Returns all the authenticated user's email addresses. Both confirmed and unconfirmed. [API Docs]

get
/user/emails
const { data, headers } = await bitbucket.user.listEmails({ page, pagelen, q, sort, fields })
bitbucket.user.listEmails({ page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

user - listPermissionsForRepos

Returns an object for each repository the caller has explicit access to and their effective permission — the highest level of permission the caller has. This does not return public repositories that the user was not granted any specific permission in, and does not distinguish between explicit and implicit privileges. [API Docs]

get
/user/permissions/repositories
const { data, headers } = await bitbucket.user.listPermissionsForRepos({ page, pagelen, q, sort, fields })
bitbucket.user.listPermissionsForRepos({ page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Name of a response property sort the result by as per filtering and sorting.

fields optional string

user - listPermissionsForWorkspaces

Returns an object for each workspace the caller is a member of, and their effective role - the highest level of privilege the caller has. If a user is a member of multiple groups with distinct roles, only the highest level is returned. [API Docs]

get
/user/permissions/workspaces
const { data, headers } = await bitbucket.user.listPermissionsForWorkspaces({ page, pagelen, q, sort, fields })
bitbucket.user.listPermissionsForWorkspaces({ page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
page optional string
pagelen optional integer
q optional string

Query string to narrow down the response. See filtering and sorting for details.

sort optional string

Name of a response property to sort results. See filtering and sorting for details.

fields optional string

users

users - createPipelineVariable

Create a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

post
/users/{selected_user}/pipelines_config/variables
const { data, headers } = await bitbucket.users.createPipelineVariable({ _body, selected_user })
bitbucket.users.createPipelineVariable({ _body, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The variable to create.

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

users - createSshKey

Adds a new SSH public key to the specified user account and returns the resulting key. [API Docs]

post
/users/{selected_user}/ssh-keys
const { data, headers } = await bitbucket.users.createSshKey({ _body, selected_user })
bitbucket.users.createSshKey({ _body, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The new SSH key object. Note that the username property has been deprecated due to privacy changes.

selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

users - deletePipelineVariable

Delete an account level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

delete
/users/{selected_user}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.users.deletePipelineVariable({ selected_user, variable_uuid })
bitbucket.users.deletePipelineVariable({ selected_user, variable_uuid }).then(({ data, headers }) => {})

Parameters

Field Type Description
selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

variable_uuid string

The UUID of the variable to delete.

users - deleteSshKey

Deletes a specific SSH public key from a user's account. [API Docs]

delete
/users/{selected_user}/ssh-keys/{key_id}
const { data, headers } = await bitbucket.users.deleteSshKey({ key_id, selected_user })
bitbucket.users.deleteSshKey({ key_id, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The SSH key's UUID value.

selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

users - deleteUserHostedPropertyValue

Delete an application property value stored against a user. [API Docs]

delete
/users/{selected_user}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.users.deleteUserHostedPropertyValue({ app_key, property_name, selected_user })
bitbucket.users.deleteUserHostedPropertyValue({ app_key, property_name, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

users - get

Gets the public information associated with a user account. [API Docs]

get
/users/{selected_user}
const { data, headers } = await bitbucket.users.get({ selected_user, fields })
bitbucket.users.get({ selected_user, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

fields optional string

users - getAuthedUser

Returns the currently logged in user. [API Docs]

get
/user
const { data, headers } = await bitbucket.users.getAuthedUser({ fields })
bitbucket.users.getAuthedUser({ fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
fields optional string

users - getEmailForAuthedUser

Returns details about a specific one of the authenticated user's email addresses. [API Docs]

get
/user/emails/{email}
const { data, headers } = await bitbucket.users.getEmailForAuthedUser({ email, fields })
bitbucket.users.getEmailForAuthedUser({ email, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
email string

Email address of the user.

fields optional string

users - getPipelineVariable

Retrieve a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

get
/users/{selected_user}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.users.getPipelineVariable({ selected_user, variable_uuid, fields })
bitbucket.users.getPipelineVariable({ selected_user, variable_uuid, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

variable_uuid string

The UUID of the variable to retrieve.

fields optional string

users - getSshKey

Returns a specific SSH public key belonging to a user. [API Docs]

get
/users/{selected_user}/ssh-keys/{key_id}
const { data, headers } = await bitbucket.users.getSshKey({ key_id, selected_user, fields })
bitbucket.users.getSshKey({ key_id, selected_user, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The SSH key's UUID value.

selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

fields optional string

users - listEmailsForAuthedUser

Returns all the authenticated user's email addresses. Both confirmed and unconfirmed. [API Docs]

get
/user/emails
const { data, headers } = await bitbucket.users.listEmailsForAuthedUser({ page, pagelen, q, sort, fields })
bitbucket.users.listEmailsForAuthedUser({ page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

users - listPipelineVariables

Find user level variables. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

get
/users/{selected_user}/pipelines_config/variables
const { data, headers } = await bitbucket.users.listPipelineVariables({ selected_user, page, pagelen, q, sort, fields })
bitbucket.users.listPipelineVariables({ selected_user, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

users - listSshKeys

Returns a paginated list of the user's SSH public keys. [API Docs]

get
/users/{selected_user}/ssh-keys
const { data, headers } = await bitbucket.users.listSshKeys({ selected_user, page, pagelen, q, sort, fields })
bitbucket.users.listSshKeys({ selected_user, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

users - retrieveUserHostedPropertyValue

Retrieve an application property value stored against a user. [API Docs]

get
/users/{selected_user}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.users.retrieveUserHostedPropertyValue({ app_key, property_name, selected_user, fields })
bitbucket.users.retrieveUserHostedPropertyValue({ app_key, property_name, selected_user, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
app_key string

The key of the Connect app.

property_name string

The name of the property.

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

fields optional string

users - searchCode

Search for code in the repositories of the specified user. [API Docs]

get
/users/{selected_user}/search/code
const { data, headers } = await bitbucket.users.searchCode({ search_query, selected_user, fields })
bitbucket.users.searchCode({ search_query, selected_user, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
search_query string

The search query

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

fields optional string

users - updatePipelineVariable

Update a user level variable. This endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see the announcement. [API Docs]

put
/users/{selected_user}/pipelines_config/variables/{variable_uuid}
const { data, headers } = await bitbucket.users.updatePipelineVariable({ _body, selected_user, variable_uuid })
bitbucket.users.updatePipelineVariable({ _body, selected_user, variable_uuid }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated variable.

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

variable_uuid string

The UUID of the variable.

users - updateSshKey

Updates a specific SSH public key on a user's account [API Docs]

put
/users/{selected_user}/ssh-keys/{key_id}
const { data, headers } = await bitbucket.users.updateSshKey({ _body, key_id, selected_user })
bitbucket.users.updateSshKey({ _body, key_id, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The updated SSH key object

key_id string

The SSH key's UUID value.

selected_user string

This can either be an Atlassian Account ID OR the UUID of the account, surrounded by curly-braces, for example: {account UUID}.

users - updateUserHostedPropertyValue

Update an application property value stored against a user. [API Docs]

put
/users/{selected_user}/properties/{app_key}/{property_name}
const { data, headers } = await bitbucket.users.updateUserHostedPropertyValue({ _body, app_key, property_name, selected_user })
bitbucket.users.updateUserHostedPropertyValue({ _body, app_key, property_name, selected_user }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The application property to create or update.

app_key string

The key of the Connect app.

property_name string

The name of the property.

selected_user string

Either the UUID of the account surrounded by curly-braces, for example {account UUID}, OR an Atlassian Account ID.

webhooks

webhooks - create

Creates a new webhook on the specified repository. [API Docs]

post
/repositories/{workspace}/{repo_slug}/hooks
const { data, headers } = await bitbucket.webhooks.create({ _body, repo_slug, workspace })
bitbucket.webhooks.create({ _body, repo_slug, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

webhooks - createWebhookForWorkspace

Creates a new webhook on the specified workspace. [API Docs]

post
/workspaces/{workspace}/hooks
const { data, headers } = await bitbucket.webhooks.createWebhookForWorkspace({ workspace })
bitbucket.webhooks.createWebhookForWorkspace({ workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

webhooks - delete

Deletes the specified webhook subscription from the given repository. [API Docs]

delete
/repositories/{workspace}/{repo_slug}/hooks/{uid}
const { data, headers } = await bitbucket.webhooks.delete({ repo_slug, uid, workspace })
bitbucket.webhooks.delete({ repo_slug, uid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

webhooks - deleteWebhookForWorkspace

Deletes the specified webhook subscription from the given workspace. [API Docs]

delete
/workspaces/{workspace}/hooks/{uid}
const { data, headers } = await bitbucket.webhooks.deleteWebhookForWorkspace({ uid, workspace })
bitbucket.webhooks.deleteWebhookForWorkspace({ uid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

webhooks - get

Returns the webhook with the specified id installed on the specified repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/hooks/{uid}
const { data, headers } = await bitbucket.webhooks.get({ repo_slug, uid, workspace, fields })
bitbucket.webhooks.get({ repo_slug, uid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

webhooks - getAllSubjectTypes

Returns the webhook resource or subject types on which webhooks can be registered. [API Docs]

get
/hook_events
const { data, headers } = await bitbucket.webhooks.getAllSubjectTypes({ fields })
bitbucket.webhooks.getAllSubjectTypes({ fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
fields optional string

webhooks - getWebhookForWorkspace

Returns the webhook with the specified id installed on the given workspace. [API Docs]

get
/workspaces/{workspace}/hooks/{uid}
const { data, headers } = await bitbucket.webhooks.getWebhookForWorkspace({ uid, workspace, fields })
bitbucket.webhooks.getWebhookForWorkspace({ uid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

webhooks - getWebhooksForWorkspace

Returns a paginated list of webhooks installed on this workspace. [API Docs]

get
/workspaces/{workspace}/hooks
const { data, headers } = await bitbucket.webhooks.getWebhooksForWorkspace({ workspace, page, pagelen, q, sort, fields })
bitbucket.webhooks.getWebhooksForWorkspace({ workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

webhooks - list

Returns a paginated list of all valid webhook events for the specified entity. The team and user webhooks are deprecated, and you should use workspace instead. For more information, see the announcement.* [API Docs]

get
/hook_events/{subject_type}
const { data, headers } = await bitbucket.webhooks.list({ subject_type, page, pagelen, q, sort, fields })
bitbucket.webhooks.list({ subject_type, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
subject_type string

A resource or subject type.

Allowed values: repository, workspace

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

webhooks - listForRepo

Returns a paginated list of webhooks installed on this repository. [API Docs]

get
/repositories/{workspace}/{repo_slug}/hooks
const { data, headers } = await bitbucket.webhooks.listForRepo({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.webhooks.listForRepo({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

webhooks - update

Updates the specified webhook subscription. [API Docs]

put
/repositories/{workspace}/{repo_slug}/hooks/{uid}
const { data, headers } = await bitbucket.webhooks.update({ repo_slug, uid, workspace })
bitbucket.webhooks.update({ repo_slug, uid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

webhooks - updateWebhookForWorkspace

Updates the specified webhook subscription. [API Docs]

put
/workspaces/{workspace}/hooks/{uid}
const { data, headers } = await bitbucket.webhooks.updateWebhookForWorkspace({ uid, workspace })
bitbucket.webhooks.updateWebhookForWorkspace({ uid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces

workspaces - addDefaultReviewerForProject

Adds the specified user to the project's list of default reviewers. The method is idempotent. Accepts an optional body containing the uuid of the user to be added. [API Docs]

put
/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
const { data, headers } = await bitbucket.workspaces.addDefaultReviewerForProject({ project_key, selected_user, workspace })
bitbucket.workspaces.addDefaultReviewerForProject({ project_key, selected_user, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This can either be the actual key assigned to the project or the UUID (surrounded by curly-braces ({})).

selected_user string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - createOrUpdateProject

Since this endpoint can be used to both update and to create a project, the request body depends on the intent. [API Docs]

put
/workspaces/{workspace}/projects/{project_key}
const { data, headers } = await bitbucket.workspaces.createOrUpdateProject({ _body, project_key, workspace })
bitbucket.workspaces.createOrUpdateProject({ _body, project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - createPipelineVariableForWorkspace

Create a workspace level variable. [API Docs]

post
/workspaces/{workspace}/pipelines-config/variables
const { data, headers } = await bitbucket.workspaces.createPipelineVariableForWorkspace({ _body, workspace })
bitbucket.workspaces.createPipelineVariableForWorkspace({ _body, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body optional any

The variable to create.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

workspaces - createProject

Creates a new project. [API Docs]

post
/workspaces/{workspace}/projects
const { data, headers } = await bitbucket.workspaces.createProject({ _body, workspace })
bitbucket.workspaces.createProject({ _body, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - createProjectDeployKey

Create a new deploy key in a project. [API Docs]

post
/workspaces/{workspace}/projects/{project_key}/deploy-keys
const { data, headers } = await bitbucket.workspaces.createProjectDeployKey({ project_key, workspace })
bitbucket.workspaces.createProjectDeployKey({ project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - createWebhookForWorkspace

Creates a new webhook on the specified workspace. [API Docs]

post
/workspaces/{workspace}/hooks
const { data, headers } = await bitbucket.workspaces.createWebhookForWorkspace({ workspace })
bitbucket.workspaces.createWebhookForWorkspace({ workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - deleteDefaultReviewerForProject

Removes a default reviewer from the project. [API Docs]

delete
/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
const { data, headers } = await bitbucket.workspaces.deleteDefaultReviewerForProject({ project_key, selected_user, workspace })
bitbucket.workspaces.deleteDefaultReviewerForProject({ project_key, selected_user, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This can either be the actual key assigned to the project or the UUID (surrounded by curly-braces ({})).

selected_user string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - deletePipelineVariableForWorkspace

Delete a workspace level variable. [API Docs]

delete
/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
const { data, headers } = await bitbucket.workspaces.deletePipelineVariableForWorkspace({ variable_uuid, workspace })
bitbucket.workspaces.deletePipelineVariableForWorkspace({ variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
variable_uuid string

The UUID of the variable to delete.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

workspaces - deleteProject

Deletes this project. This is an irreversible operation. [API Docs]

delete
/workspaces/{workspace}/projects/{project_key}
const { data, headers } = await bitbucket.workspaces.deleteProject({ project_key, workspace })
bitbucket.workspaces.deleteProject({ project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - deleteProjectDeployKey

This deletes a deploy key from a project. [API Docs]

delete
/workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id}
const { data, headers } = await bitbucket.workspaces.deleteProjectDeployKey({ key_id, project_key, workspace })
bitbucket.workspaces.deleteProjectDeployKey({ key_id, project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The key ID matching the project deploy key.

project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - deleteProjectGroupPermission

Deletes the project group permission between the requested project and group, if one exists. [API Docs]

delete
/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
const { data, headers } = await bitbucket.workspaces.deleteProjectGroupPermission({ group_slug, project_key, workspace })
bitbucket.workspaces.deleteProjectGroupPermission({ group_slug, project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
group_slug string

Slug of the requested group.

project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - deleteProjectUserPermission

Deletes the project user permission between the requested project and user, if one exists. [API Docs]

delete
/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
const { data, headers } = await bitbucket.workspaces.deleteProjectUserPermission({ project_key, selected_user_id, workspace })
bitbucket.workspaces.deleteProjectUserPermission({ project_key, selected_user_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

selected_user_id string

This can either be the username, the user's UUID surrounded by curly-braces, for example: {account UUID}, or the user's Atlassian ID.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - deleteWebhookForWorkspace

Deletes the specified webhook subscription from the given workspace. [API Docs]

delete
/workspaces/{workspace}/hooks/{uid}
const { data, headers } = await bitbucket.workspaces.deleteWebhookForWorkspace({ uid, workspace })
bitbucket.workspaces.deleteWebhookForWorkspace({ uid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - getBranchingModelForProject

Return the branching model set at the project level. This view is read-only. The branching model settings can be changed using the settings API. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/branching-model
const { data, headers } = await bitbucket.workspaces.getBranchingModelForProject({ project_key, workspace, fields })
bitbucket.workspaces.getBranchingModelForProject({ project_key, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

workspaces - getBranchingModelSettingsForProject

Return the branching model configuration for a project. The returned object: [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/branching-model/settings
const { data, headers } = await bitbucket.workspaces.getBranchingModelSettingsForProject({ project_key, workspace, fields })
bitbucket.workspaces.getBranchingModelSettingsForProject({ project_key, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

workspaces - getDefaultReviewerForProject

Returns the specified default reviewer. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
const { data, headers } = await bitbucket.workspaces.getDefaultReviewerForProject({ project_key, selected_user, workspace, fields })
bitbucket.workspaces.getDefaultReviewerForProject({ project_key, selected_user, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This can either be the actual key assigned to the project or the UUID (surrounded by curly-braces ({})).

selected_user string

This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: {account UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

workspaces - getMemberForWorkspace

Returns the workspace membership, which includes a User object for the member and a Workspace object for the requested workspace. [API Docs]

get
/workspaces/{workspace}/members/{member}
const { data, headers } = await bitbucket.workspaces.getMemberForWorkspace({ member, workspace, fields })
bitbucket.workspaces.getMemberForWorkspace({ member, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
member string

Member's UUID or Atlassian ID.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

workspaces - getMembersForWorkspace

Returns all members of the requested workspace. [API Docs]

get
/workspaces/{workspace}/members
const { data, headers } = await bitbucket.workspaces.getMembersForWorkspace({ workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.getMembersForWorkspace({ workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

workspaces - getOIDCConfiguration

This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/ [API Docs]

get
/workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configuration
const { data, headers } = await bitbucket.workspaces.getOIDCConfiguration({ workspace, fields })
bitbucket.workspaces.getOIDCConfiguration({ workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

workspaces - getOIDCKeys

This is part of OpenID Connect for Pipelines, see https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/ [API Docs]

get
/workspaces/{workspace}/pipelines-config/identity/oidc/keys.json
const { data, headers } = await bitbucket.workspaces.getOIDCKeys({ workspace, fields })
bitbucket.workspaces.getOIDCKeys({ workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

workspaces - getPipelineVariableForWorkspace

Retrieve a workspace level variable. [API Docs]

get
/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
const { data, headers } = await bitbucket.workspaces.getPipelineVariableForWorkspace({ variable_uuid, workspace, fields })
bitbucket.workspaces.getPipelineVariableForWorkspace({ variable_uuid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
variable_uuid string

The UUID of the variable to retrieve.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

fields optional string

workspaces - getPipelineVariablesForWorkspace

Find workspace level variables. [API Docs]

get
/workspaces/{workspace}/pipelines-config/variables
const { data, headers } = await bitbucket.workspaces.getPipelineVariablesForWorkspace({ workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.getPipelineVariablesForWorkspace({ workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

workspaces - getProject

Returns the requested project. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}
const { data, headers } = await bitbucket.workspaces.getProject({ project_key, workspace, fields })
bitbucket.workspaces.getProject({ project_key, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

workspaces - getProjectDeployKey

Returns the deploy key belonging to a specific key ID. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id}
const { data, headers } = await bitbucket.workspaces.getProjectDeployKey({ key_id, project_key, workspace, fields })
bitbucket.workspaces.getProjectDeployKey({ key_id, project_key, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
key_id string

The key ID matching the project deploy key.

project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

workspaces - getProjectGroupPermission

Returns the group permission for a given group and project. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
const { data, headers } = await bitbucket.workspaces.getProjectGroupPermission({ group_slug, project_key, workspace, fields })
bitbucket.workspaces.getProjectGroupPermission({ group_slug, project_key, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
group_slug string

Slug of the requested group.

project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

workspaces - getProjectUserPermission

Returns the explicit user permission for a given user and project. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
const { data, headers } = await bitbucket.workspaces.getProjectUserPermission({ project_key, selected_user_id, workspace, fields })
bitbucket.workspaces.getProjectUserPermission({ project_key, selected_user_id, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

selected_user_id string

This can either be the username, the user's UUID surrounded by curly-braces, for example: {account UUID}, or the user's Atlassian ID.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

workspaces - getProjects

Returns the list of projects in this workspace. [API Docs]

get
/workspaces/{workspace}/projects
const { data, headers } = await bitbucket.workspaces.getProjects({ workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.getProjects({ workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

workspaces - getWebhookForWorkspace

Returns the webhook with the specified id installed on the given workspace. [API Docs]

get
/workspaces/{workspace}/hooks/{uid}
const { data, headers } = await bitbucket.workspaces.getWebhookForWorkspace({ uid, workspace, fields })
bitbucket.workspaces.getWebhookForWorkspace({ uid, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

workspaces - getWebhooksForWorkspace

Returns a paginated list of webhooks installed on this workspace. [API Docs]

get
/workspaces/{workspace}/hooks
const { data, headers } = await bitbucket.workspaces.getWebhooksForWorkspace({ workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.getWebhooksForWorkspace({ workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

workspaces - getWorkspace

Returns the requested workspace. [API Docs]

get
/workspaces/{workspace}
const { data, headers } = await bitbucket.workspaces.getWorkspace({ workspace, fields })
bitbucket.workspaces.getWorkspace({ workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

fields optional string

workspaces - getWorkspaces

Returns a list of workspaces accessible by the authenticated user. [API Docs]

get
/workspaces
const { data, headers } = await bitbucket.workspaces.getWorkspaces({ role, page, pagelen, q, sort, fields })
bitbucket.workspaces.getWorkspaces({ role, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
role optional string

Filters the workspaces based on the authenticated user's role on each workspace.

Allowed values: owner, collaborator, member

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response. See filtering and sorting for details.

sort optional string

Name of a response property to sort results. See filtering and sorting for details.

fields optional string

workspaces - listDefaultReviewersForProject

Return a list of all default reviewers for a project. This is a list of users that will be added as default reviewers to pull requests for any repository within the project. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/default-reviewers
const { data, headers } = await bitbucket.workspaces.listDefaultReviewersForProject({ project_key, workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.listDefaultReviewersForProject({ project_key, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

workspaces - listPermissions

Returns the list of members in a workspace and their permission levels. Permission can be: owner collaborator member [API Docs]

get
/workspaces/{workspace}/permissions
const { data, headers } = await bitbucket.workspaces.listPermissions({ workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.listPermissions({ workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string
fields optional string

workspaces - listPermissionsForRepositories

Returns an object for each repository permission for all of a workspace's repositories. [API Docs]

get
/workspaces/{workspace}/permissions/repositories
const { data, headers } = await bitbucket.workspaces.listPermissionsForRepositories({ workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.listPermissionsForRepositories({ workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Name of a response property sort the result by as per filtering and sorting.

fields optional string

workspaces - listPermissionsForRepository

Returns an object for the repository permission of each user in the requested repository. [API Docs]

get
/workspaces/{workspace}/permissions/repositories/{repo_slug}
const { data, headers } = await bitbucket.workspaces.listPermissionsForRepository({ repo_slug, workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.listPermissionsForRepository({ repo_slug, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
repo_slug string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string

Query string to narrow down the response as per filtering and sorting.

sort optional string

Name of a response property sort the result by as per filtering and sorting.

fields optional string

workspaces - listProjectDeployKeys

Returns all deploy keys belonging to a project. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/deploy-keys
const { data, headers } = await bitbucket.workspaces.listProjectDeployKeys({ project_key, workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.listProjectDeployKeys({ project_key, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

workspaces - listProjectGroupPermissions

Returns a paginated list of explicit group permissions for the given project. This endpoint does not support BBQL features. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/permissions-config/groups
const { data, headers } = await bitbucket.workspaces.listProjectGroupPermissions({ project_key, workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.listProjectGroupPermissions({ project_key, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

workspaces - listProjectUserPermissions

Returns a paginated list of explicit user permissions for the given project. This endpoint does not support BBQL features. [API Docs]

get
/workspaces/{workspace}/projects/{project_key}/permissions-config/users
const { data, headers } = await bitbucket.workspaces.listProjectUserPermissions({ project_key, workspace, page, pagelen, q, sort, fields })
bitbucket.workspaces.listProjectUserPermissions({ project_key, workspace, page, pagelen, q, sort, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

page optional string
pagelen optional integer
q optional string
sort optional string
fields optional string

workspaces - searchAccount

Search for code in the repositories of the specified workspace. [API Docs]

get
/workspaces/{workspace}/search/code
const { data, headers } = await bitbucket.workspaces.searchAccount({ search_query, workspace, fields })
bitbucket.workspaces.searchAccount({ search_query, workspace, fields }).then(({ data, headers }) => {})

Parameters

Field Type Description
search_query string

The search query

workspace string

The workspace to search in; either the slug or the UUID in curly braces

fields optional string

workspaces - updateBranchingModelSettingsForProject

Update the branching model configuration for a project. [API Docs]

put
/workspaces/{workspace}/projects/{project_key}/branching-model/settings
const { data, headers } = await bitbucket.workspaces.updateBranchingModelSettingsForProject({ project_key, workspace })
bitbucket.workspaces.updateBranchingModelSettingsForProject({ project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - updatePipelineVariableForWorkspace

Update a workspace level variable. [API Docs]

put
/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}
const { data, headers } = await bitbucket.workspaces.updatePipelineVariableForWorkspace({ _body, variable_uuid, workspace })
bitbucket.workspaces.updatePipelineVariableForWorkspace({ _body, variable_uuid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The updated variable.

variable_uuid string

The UUID of the variable.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

workspaces - updateProjectGroupPermission

Updates the group permission, or grants a new permission if one does not already exist. [API Docs]

put
/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
const { data, headers } = await bitbucket.workspaces.updateProjectGroupPermission({ _body, group_slug, project_key, workspace })
bitbucket.workspaces.updateProjectGroupPermission({ _body, group_slug, project_key, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The permission to grant

group_slug string

Slug of the requested group.

project_key string

The project in question. This is the actual key assigned to the project.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - updateProjectUserPermission

Updates the explicit user permission for a given user and project. The selected user must be a member of the workspace, and cannot be the workspace owner. [API Docs]

put
/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
const { data, headers } = await bitbucket.workspaces.updateProjectUserPermission({ _body, project_key, selected_user_id, workspace })
bitbucket.workspaces.updateProjectUserPermission({ _body, project_key, selected_user_id, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
_body any

The permission to grant

project_key string

The project in question. This is the actual key assigned to the project.

selected_user_id string

This can either be the username, the user's UUID surrounded by curly-braces, for example: {account UUID}, or the user's Atlassian ID.

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

workspaces - updateWebhookForWorkspace

Updates the specified webhook subscription. [API Docs]

put
/workspaces/{workspace}/hooks/{uid}
const { data, headers } = await bitbucket.workspaces.updateWebhookForWorkspace({ uid, workspace })
bitbucket.workspaces.updateWebhookForWorkspace({ uid, workspace }).then(({ data, headers }) => {})

Parameters

Field Type Description
uid string

Installed webhook's ID

workspace string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

Generated with apidoc 0.17.5 - 2024-05-18T09:30:55.812Z