Fetches the activity feed for this pull request.
Activities include comments, approvals, reviews, rescopes, merges, and declines.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/activities
Optionalparams: ActivitiesParamsOptional filters: limit, start, fromId, fromType
An array of pull request activities, ordered from most recent to oldest
Posts a comment on this pull request.
POST /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/comments
The comment text, and an optional anchor or parent for replies
The created comment
Adds a reviewer to the pull request.
POST /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/participants
The user to add as a reviewer
The newly added participant
Applies a suggested change from a comment as a new commit.
POST /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/comments/{commentId}/apply-suggestion
The comment id containing the suggestion
The suggestion index to apply, and an optional commit summary/description
The commit created by applying the suggestion
Approves the pull request on behalf of a participant.
PUT /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/participants/{userSlug}
Slug of the user approving (typically the authenticated user)
The updated participant
Fetches the pending auto-merge request on this pull request, if any.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/auto-merge
The pending auto-merge request
Fetches the aggregated build summaries for this pull request.
Returns a map of commit hash → build counts per state
(successful, failed, inProgress, cancelled, unknown).
The official API exposes build statistics per commit, so this method first fetches the pull request commits (up to 100) and then requests their build statistics in a single batch call (two requests). Commits without any associated builds are not present in the response.
POST /rest/build-status/latest/commits/stats
A record keyed by commit SHA with aggregated build counts
Cancels a pending auto-merge request.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/auto-merge
Checks whether the pull request can currently be merged.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/merge
Whether the pull request can merge, and any vetoes blocking it
Checks whether the pull request's source branch can be rebased onto its target branch.
GET /rest/git/latest/projects/{key}/repos/{slug}/pull-requests/{id}/rebase
Whether a rebase is possible, and any vetoes blocking it
Fetches the file changes included in this pull request.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/changes
Optionalparams: ChangesParamsOptional filters: limit, start, withComments
An array of file changes
Fetches the comments on this pull request.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/comments
Optionalparams: PaginationParamsOptional pagination: limit, start
A paged response of comments
Fetches a suggested commit message for merging this pull request (e.g. for squash merges).
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/commit-message-suggestion
The suggested commit message
Fetches the commits included in this pull request.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/commits
Optionalparams: PaginationParamsOptional pagination: limit, start
An array of commits
Marks the given files as reviewed by the authenticated user.
PUT /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/review
The files to mark as reviewed
The updated review progress
Creates a task (blocker comment) on this pull request.
POST /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/blocker-comments
The task text, and an optional anchor to a specific file/line
The created task
Declines the pull request.
POST /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/decline?version={version}
version (must match the pull request's current version)
The declined pull request
Deletes the pull request.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}
version (must match the pull request's current version)
Deletes a comment.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/comments/{commentId}
The comment id
Must match the comment's current version
Deletes a task.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/blocker-comments/{commentId}
The task's comment id
Must match the task's current version
Fetches the diff for this pull request.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/diff/{path}
The path param (the file to diff) is optional: when omitted, the diff for
the whole pull request is returned. srcPath is sent as a query parameter
and identifies the previous path of a copied, moved or renamed file.
Optionalparams: DiffParamsOptional: path, contextLines, srcPath, whitespace
The diff object
Fetches aggregated line-change counts for a single file's diff.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/diff-stats-summary/{path}
The file path to summarize
Added/removed line counts for the file
Discards the authenticated user's file-review progress on this pull request.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/review
Fetches the pull request details.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}
The pull request object
Fetches the Jira issues linked to this pull request.
GET /rest/jira/latest/projects/{key}/repos/{slug}/pull-requests/{id}/issues
An array of linked Jira issues
Merges the pull request.
POST /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/merge?version={version}
version (must match the pull request's current version) plus optional merge options
The merged pull request
Fetches the common ancestor commit between the pull request's source and target branches.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/merge-base
The merge-base commit
Fetches this pull request as a git format-patch-compatible patch file.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}.patch
The raw patch as plain text
Fetches the raw unified diff for this pull request, in git diff format.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}.diff
The raw diff as plain text
Reacts to a comment with an emoticon (e.g. ':+1:').
PUT /rest/comment-likes/latest/projects/{key}/repos/{slug}/pull-requests/{id}/comments/{commentId}/reactions/{emoticon}
The comment id
The emoticon identifier (e.g. '+1', 'heart')
Rebases the pull request's source branch onto its target branch.
POST /rest/git/latest/projects/{key}/repos/{slug}/pull-requests/{id}/rebase
The result of the rebase
Removes a reviewer (or any participant) from the pull request entirely.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/participants/{userSlug}
Slug of the user to remove
Reopens a previously declined pull request.
POST /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/reopen?version={version}
version (must match the pull request's current version)
The reopened pull request
Fetches the Code Insights reports for this pull request.
Code Insights reports are attached to commits, so this method first fetches the pull request to resolve the latest commit of its source branch and then queries the official Code Insights API for that commit (two requests).
GET /rest/insights/latest/projects/{key}/repos/{slug}/commits/{commitId}/reports
Optionalparams: PaginationParamsOptional pagination: limit, start
A paged response of Code Insights reports for the latest source commit
Requests that the pull request be merged automatically once it becomes mergeable (required builds pass, approvals met, etc.).
POST /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/auto-merge
Optionaldata: RequestAutoMergeDataOptional merge message, source-branch deletion, and merge strategy
The created auto-merge request
Fetches the authenticated user's file-review progress on this pull request.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/review
Which files the authenticated user has marked as reviewed
Fetches the participants (reviewers) of this pull request.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/participants
Optionalparams: PaginationParamsOptional pagination: limit, start
A paged response of participants
Fetches the tasks (review to-do items) for this pull request.
Since Bitbucket 7.2 tasks are modelled as blocker comments (comments with
severity: 'BLOCKER') and the legacy /tasks endpoint was removed, so this
method queries the blocker-comments endpoint. Tasks can be OPEN or RESOLVED.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/blocker-comments
Optionalparams: TasksParamsOptional filters: limit, start, states
A paged response of pull request tasks (blocker comments)
Allows the resource to be awaited directly, resolving with the pull request info. Delegates to PullRequestResource.get.
Optionalonfulfilled: ((value: BitbucketPullRequest) => TResult1 | PromiseLike<TResult1>) | nullOptionalonrejected: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | nullWithdraws a participant's approval, without removing them as a reviewer.
PUT /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/participants/{userSlug}
Slug of the user withdrawing their approval
The updated participant
Removes a reaction from a comment.
DELETE /rest/comment-likes/latest/projects/{key}/repos/{slug}/pull-requests/{id}/comments/{commentId}/reactions/{emoticon}
The comment id
The emoticon identifier (e.g. '+1', 'heart')
Removes the authenticated user as a watcher of this pull request.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/watch
Updates the pull request's title, description, target branch, or reviewers.
PUT /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}
version (must match the pull request's current version) plus any fields to change
The updated pull request
Updates an existing comment's text.
PUT /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/comments/{commentId}
The comment id
version (must match the comment's current version) and the new text
The updated comment
Updates a task's text or resolution state.
PUT /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/blocker-comments/{commentId}
The task's comment id
version (must match the task's current version) plus the fields to change
The updated task
Adds the authenticated user as a watcher of this pull request.
POST /rest/api/latest/projects/{key}/repos/{slug}/pull-requests/{id}/watch
Represents a Bitbucket pull request resource with chainable async methods.
Implements
PromiseLike<BitbucketPullRequest>so it can be awaited directly to fetch the pull request info, while also exposing sub-resource methods.Example