Bitbucket Pull Requests API

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

Business capability
Software Construction Management BC-4200.40

Operations 37

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests Find pull requests that contain a commit · List pull requests that contain a commit #
Ask an LLM
“Which pull request was this commit reviewed and merged in?”
“Can I trace a commit hash back to the PRs that included it?”
Tell an agent
List pull requests containing commit {commit} in {workspace}/{repo_slug}.
Find the PRs where commit {commit} was reviewed, {pagelen} per page.
GET /repositories/{workspace}/{repo_slug}/default-reviewers List a repository's default reviewers · List default reviewers #
Ask an LLM
“Who gets added automatically as a reviewer on every new pull request in this repo?”
“Which users are set as default reviewers directly on a Bitbucket repository?”
Tell an agent
List the default reviewers configured on {workspace}/{repo_slug}.
Show me who is auto-added to every new PR in repo {repo_slug}, workspace {workspace}.
DELETE /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username} Remove a user from a repo's default reviewers · Remove a user from the default reviewers #
Ask an LLM
“How can I stop a person from being auto-added as reviewer on new pull requests?”
“Can I take one user off a repository's default reviewer list?”
Tell an agent destructive · confirm first
Remove {target_username} from the default reviewers of {workspace}/{repo_slug}.
Stop auto-adding user {target_username} as reviewer on new PRs in repo {repo_slug}, workspace {workspace}.
GET /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username} Check whether a user is a default reviewer · Get a default reviewer #
Ask an LLM
“Is a specific teammate already on the default reviewer list for a repo?”
“Can I test one user's default-reviewer membership without pulling the whole list?”
Tell an agent
Check whether {target_username} is a default reviewer on {workspace}/{repo_slug}.
Confirm user {target_username} is among the default reviewers of repo {repo_slug} in {workspace}.
PUT /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username} Add a user to a repo's default reviewers · Add a user to the default reviewers #
Ask an LLM
“How do I make someone review every new pull request in a repository automatically?”
“What happens if I add a person to default reviewers who is already on the list?”
Tell an agent
Add {target_username} to the default reviewers of {workspace}/{repo_slug}.
Make user {target_username} an automatic reviewer on every new PR in repo {repo_slug}, workspace {workspace}.
GET /repositories/{workspace}/{repo_slug}/effective-default-reviewers List effective default reviewers incl. project · List effective default reviewers #
Ask an LLM
“Which default reviewers apply to a repo once the ones inherited from its project are included?”
“Can I see repository-level and project-inherited default reviewers together?”
Tell an agent
List the effective default reviewers, including project-inherited ones, for {workspace}/{repo_slug}.
Show every inherited and repo-level default reviewer that applies to repo {repo_slug} in {workspace}.
GET /repositories/{workspace}/{repo_slug}/pullrequests List a repository's pull requests · List pull requests #
Ask an LLM
“What pull requests are currently open on a Bitbucket repository?”
“Can I list merged or declined PRs in a repo instead of just the open ones?”
Tell an agent
List the open pull requests in {workspace}/{repo_slug}.
Show pull requests in state {state} for repo {repo_slug} in workspace {workspace}.
POST /repositories/{workspace}/{repo_slug}/pullrequests Open a new pull request · Create a pull request #
Ask an LLM
“How do I open a pull request from a feature branch into main?”
“What is the minimum I need to supply to create a PR — a title and a source branch?”
Tell an agent
Open a pull request titled {title} from branch {source} in {workspace}/{repo_slug}.
Create a draft PR {title} from {source} into {destination} in repo {repo_slug}, workspace {workspace}, with reviewers {reviewers}.
GET /repositories/{workspace}/{repo_slug}/pullrequests/activity List activity across a repo's pull requests · List a pull request activity log #
Ask an LLM
“What has happened recently across all the pull requests in a repository?”
“Can I get one activity feed of approvals, comments and updates for every PR in a repo?”
Tell an agent
Show the combined pull request activity log for all PRs in {workspace}/{repo_slug}.
List recent activity across every pull request in repo {repo_slug}, workspace {workspace}.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id} Get a pull request · Get a pull request #
Ask an LLM
“What are the title, branches and state of a particular pull request?”
“Where can I look up a single PR by its number?”
Tell an agent
Get pull request #{pull_request_id} in {workspace}/{repo_slug}.
Show me the details of PR {pull_request_id} in repo {repo_slug}, workspace {workspace}.
PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id} Update an open pull request · Update a pull request #
Ask an LLM
“Can I change the title, description or destination branch of a PR that is still open?”
“Is it possible to edit a pull request after it has been merged?”
Tell an agent
Change the title of PR #{pull_request_id} in {workspace}/{repo_slug} to {title}.
Retarget pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}, onto branch {destination}.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/activity Get one pull request's activity log · List a pull request activity log #
Ask an LLM
“What is the history of approvals, comments and updates on a single pull request?”
“When was a specific PR last updated, and by whom?”
Tell an agent
Show the activity log for PR #{pull_request_id} in {workspace}/{repo_slug}.
List the timeline of events on pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
DELETE /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve Withdraw my approval of a pull request · Unapprove a pull request #
Ask an LLM
“I approved a PR by mistake — how do I take the approval back?”
“Can I unapprove a pull request after new commits are pushed?”
Tell an agent destructive · confirm first
Remove my approval from PR #{pull_request_id} in {workspace}/{repo_slug}.
Unapprove pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve Approve a pull request · Approve a pull request #
Ask an LLM
“How do I approve a pull request as myself through the API?”
“Can a bot account give a PR its approval programmatically?”
Tell an agent
Approve PR #{pull_request_id} in {workspace}/{repo_slug}.
Give my approval to pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments List comments on a pull request · List comments on a pull request #
Ask an LLM
“What review comments, inline ones included, have been left on a pull request?”
“Can I sort a PR's comment thread newest first?”
Tell an agent
List all comments on PR #{pull_request_id} in {workspace}/{repo_slug}.
Show the inline and general review comments on pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments Comment on a pull request · Create a comment on a pull request #
Ask an LLM
“How do I post a review comment on a pull request?”
“Can I leave a pending comment on a PR that is not published yet?”
Tell an agent
Add a comment to PR #{pull_request_id} in {workspace}/{repo_slug}.
Post a pending review comment on pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}, setting pending to {pending}.
DELETE /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id} Delete a comment on a pull request · Delete a comment on a pull request #
Ask an LLM
“How do I remove a review comment from a pull request?”
“Can I delete a PR comment someone posted by mistake?”
Tell an agent destructive · confirm first
Delete comment {comment_id} from PR #{pull_request_id} in {workspace}/{repo_slug}.
Remove review comment {comment_id} on pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id} Get one comment on a pull request · Get a comment on a pull request #
Ask an LLM
“How can I fetch a single PR review comment by its id?”
“Is a particular comment on a pull request resolved or still pending?”
Tell an agent
Get comment {comment_id} on PR #{pull_request_id} in {workspace}/{repo_slug}.
Show review comment {comment_id} from pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id} Edit a comment on a pull request · Update a comment on a pull request #
Ask an LLM
“Can I edit a review comment I already posted on a pull request?”
“How do I publish a pending PR comment I left earlier?”
Tell an agent
Edit comment {comment_id} on PR #{pull_request_id} in {workspace}/{repo_slug}.
Set pending to {pending} on comment {comment_id} of pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
DELETE /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve Reopen a resolved PR comment thread · Reopen a comment thread #
Ask an LLM
“A review thread was resolved too early — can I reopen it?”
“How do I un-resolve a comment discussion on a pull request?”
Tell an agent destructive · confirm first
Reopen resolved thread {comment_id} on PR #{pull_request_id} in {workspace}/{repo_slug}.
Un-resolve discussion {comment_id} on pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve Resolve a PR comment thread · Resolve a comment thread #
Ask an LLM
“How do I mark a review discussion on a pull request as resolved?”
“Can I close out a comment thread once the feedback is addressed?”
Tell an agent
Resolve the comment thread {comment_id} on PR #{pull_request_id} in {workspace}/{repo_slug}.
Mark discussion {comment_id} on pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}, as resolved.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits List commits in a pull request · List commits on a pull request #
Ask an LLM
“Which commits will land on the destination branch when a PR is merged?”
“How many commits does a pull request contain?”
Tell an agent
List the commits in PR #{pull_request_id} in {workspace}/{repo_slug}.
Show the commits pull request {pull_request_id} would merge in repo {repo_slug}, workspace {workspace}.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/decline Decline a pull request · Decline a pull request #
Ask an LLM
“How do I reject a pull request without merging it?”
“Can I decline a PR that is no longer needed?”
Tell an agent destructive · confirm first
Decline PR #{pull_request_id} in {workspace}/{repo_slug}.
Reject pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}, without merging.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diff Get the diff of a pull request · List changes in a pull request #
Ask an LLM
“What line-by-line code changes does a pull request introduce?”
“Can I download the raw unified diff for a PR?”
Tell an agent
Get the diff for PR #{pull_request_id} in {workspace}/{repo_slug}.
Show the line-level code changes in pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstat Get a pull request's diffstat · Get the diff stat for a pull request #
Ask an LLM
“Which files does a pull request touch, and how many lines are added or removed in each?”
“Is there a per-file summary of a PR's changes rather than the full diff?”
Tell an agent
Get the diffstat for PR #{pull_request_id} in {workspace}/{repo_slug}.
Summarize files changed and lines added or removed in pull request {pull_request_id}, repo {repo_slug}, workspace {workspace}.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge Merge a pull request · Merge a pull request #
Ask an LLM
“How do I merge an approved pull request through the API?”
“Which merge strategies can I choose, such as squash or fast-forward?”
Tell an agent
Merge PR #{pull_request_id} in {workspace}/{repo_slug}.
Squash-merge pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}, using strategy {merge_strategy} and message {message}.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge/task-status/{task_id} Check the status of an async PR merge · Get the merge task status for a pull request #
Ask an LLM
“My merge returned a 202 with a task id — how do I find out if it finished?”
“Is a slow pull request merge still pending or has it succeeded?”
Tell an agent
Check merge task {task_id} for PR #{pull_request_id} in {workspace}/{repo_slug}.
Poll whether the async merge {task_id} of pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}, is done.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/patch Get a pull request as a patch · Get the patch for a pull request #
Ask an LLM
“Can I export a pull request as a git patch file to apply elsewhere?”
“Is there a patch-formatted version of a PR with commit metadata?”
Tell an agent
Get the patch for PR #{pull_request_id} in {workspace}/{repo_slug}.
Export pull request {pull_request_id} from repo {repo_slug}, workspace {workspace}, as a git patch.
DELETE /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes Withdraw a change request on a PR · Remove change request for a pull request #
Ask an LLM
“The author fixed my feedback — how do I clear my request for changes?”
“Can I remove a changes-requested status I put on a pull request?”
Tell an agent destructive · confirm first
Withdraw my change request on PR #{pull_request_id} in {workspace}/{repo_slug}.
Clear the changes-requested flag I set on pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes Request changes on a pull request · Request changes for a pull request #
Ask an LLM
“How do I flag that a pull request needs changes before it can merge?”
“Can a reviewer block a PR by requesting changes via the API?”
Tell an agent
Request changes on PR #{pull_request_id} in {workspace}/{repo_slug}.
Mark pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}, as needing changes.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses List build statuses for a pull request · List commit statuses for a pull request #
Ask an LLM
“Did the CI builds pass for a pull request?”
“Can I filter a PR's build results to only failed ones?”
Tell an agent
List build statuses for PR #{pull_request_id} in {workspace}/{repo_slug}.
Show build results for pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}, filtered by {q}.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks List tasks on a pull request · List tasks on a pull request #
Ask an LLM
“What to-do tasks are still open on a pull request?”
“Can I filter a PR's checklist tasks by state?”
Tell an agent
List the tasks on PR #{pull_request_id} in {workspace}/{repo_slug}.
Show tasks on pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}, matching {q}.
POST /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks Add a task to a pull request · Create a task on a pull request #
Ask an LLM
“How do I add a to-do item to a pull request?”
“Can I attach a PR task to a specific review comment?”
Tell an agent
Add task {content} to PR #{pull_request_id} in {workspace}/{repo_slug}.
Create a task {content} on pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}, tied to comment {comment}.
DELETE /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id} Delete a task from a pull request · Delete a task on a pull request #
Ask an LLM
“How do I remove a to-do item that no longer applies to a PR?”
“Can I delete a task someone added to my pull request?”
Tell an agent destructive · confirm first
Delete task {task_id} from PR #{pull_request_id} in {workspace}/{repo_slug}.
Remove to-do item {task_id} on pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
GET /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id} Get one task on a pull request · Get a task on a pull request #
Ask an LLM
“Has a particular to-do on a pull request been marked done?”
“How do I look up a single PR task by its id?”
Tell an agent
Get task {task_id} on PR #{pull_request_id} in {workspace}/{repo_slug}.
Show to-do item {task_id} from pull request {pull_request_id} in repo {repo_slug}, workspace {workspace}.
PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id} Update or resolve a pull request task · Update a task on a pull request #
Ask an LLM
“How do I tick off a task on a pull request as resolved?”
“Can I reword a to-do item already on a PR?”
Tell an agent
Set task {task_id} on PR #{pull_request_id} in {workspace}/{repo_slug} to state {state}.
Change the text of to-do {task_id} on pull request {pull_request_id}, repo {repo_slug}, workspace {workspace}, to {content}.
GET /workspaces/{workspace}/pullrequests/{selected_user} List a user's pull requests across a workspace · List workspace pull requests for a user #
Ask an LLM
“What pull requests has a given person authored across every repo in a workspace?”
“Can I see one developer's merged PRs workspace-wide, not just in one repository?”
Tell an agent
List open pull requests authored by {selected_user} across workspace {workspace}.
Show {state} PRs by user {selected_user} in every repository of {workspace}.

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/bitbucket:bitbucket-pull-requests-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

bitbucket-pull-requests-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Bitbucket Pullrequests API
  description: Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.
  version: '2.0'
  termsOfService: https://www.atlassian.com/legal/customer-agreement
  contact:
    name: Bitbucket Support
    url: https://support.atlassian.com/bitbucket-cloud/
    email: support@bitbucket.org
servers:
- url: https://api.bitbucket.org/2.0
tags:


# --- truncated at 32 KB (239 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/bitbucket/refs/heads/main/openapi/bitbucket-pull-requests-api-openapi.yml