Overview
Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.
Bitbucket API is a development API from bitbucket.org. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 303 endpoints.
At a glance
- Authentication
- API key
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Development
- Base URL
https://api.bitbucket.org/2.0- Version
- 2.0
- Endpoints
- 303
- OpenAPI
- Specification ↗
- Spec updated
- 2023-03-06
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "https://api.bitbucket.org/2.0/addon/linkers" \
-H "Accept: application/json" \
-H "X-API-Key: YOUR_API_KEY"const response = await fetch("https://api.bitbucket.org/2.0/addon/linkers", {
method: "GET",
headers: {
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"GET",
"https://api.bitbucket.org/2.0/addon/linkers",
headers={
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| PUT | /addon | Update an installed app |
| DELETE | /addon | Delete an app |
| GET | /addon/linkers | List linkers for an app |
| GET | /addon/linkers/{linker_key} | Get a linker for an app |
| GET | /addon/linkers/{linker_key}/values | List linker values for a linker |
| POST | /addon/linkers/{linker_key}/values | Create a linker value |
| PUT | /addon/linkers/{linker_key}/values | Update a linker value |
| DELETE | /addon/linkers/{linker_key}/values | Delete all linker values |
| GET | /addon/linkers/{linker_key}/values/{value_id} | Get a linker value |
| DELETE | /addon/linkers/{linker_key}/values/{value_id} | Delete a linker value |
| GET | /hook_events | Get a webhook resource |
| GET | /hook_events/{subject_type} | List subscribable webhook types |
| GET | /pullrequests/{selected_user} | List pull requests for a user |
| GET | /repositories | List public repositories |
| GET | /repositories/{workspace} | List repositories in a workspace |
| GET | /repositories/{workspace}/{repo_slug} | Get a repository |
| POST | /repositories/{workspace}/{repo_slug} | Create a repository |
| PUT | /repositories/{workspace}/{repo_slug} | Update a repository |
| DELETE | /repositories/{workspace}/{repo_slug} | Delete a repository |
| GET | /repositories/{workspace}/{repo_slug}/branch-restrictions | List branch restrictions |
| POST | /repositories/{workspace}/{repo_slug}/branch-restrictions | Create a branch restriction rule |
| GET | /repositories/{workspace}/{repo_slug}/branch-restrictions/{id} | Get a branch restriction rule |
| PUT | /repositories/{workspace}/{repo_slug}/branch-restrictions/{id} | Update a branch restriction rule |
| DELETE | /repositories/{workspace}/{repo_slug}/branch-restrictions/{id} | Delete a branch restriction rule |
| GET | /repositories/{workspace}/{repo_slug}/branching-model | Get the branching model for a repository |
| GET | /repositories/{workspace}/{repo_slug}/branching-model/settings | Get the branching model config for a repository |
| PUT | /repositories/{workspace}/{repo_slug}/branching-model/settings | Update the branching model config for a repository |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit} | Get a commit |
| POST | /repositories/{workspace}/{repo_slug}/commit/{commit}/approve | Approve a commit |
| DELETE | /repositories/{workspace}/{repo_slug}/commit/{commit}/approve | Unapprove a commit |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit}/comments | List a commit's comments |
| POST | /repositories/{workspace}/{repo_slug}/commit/{commit}/comments | Create comment for a commit |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id} | Get a commit comment |
| PUT | /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id} | Update a commit comment |
| DELETE | /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id} | Delete a commit comment |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name} | Get a commit application property |
| PUT | /repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name} | Update a commit application property |
| DELETE | /repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name} | Delete a commit application property |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests | List pull requests that contain a commit |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit}/reports | List reports |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId} | Get a report |
| PUT | /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId} | Create or update a report |
| DELETE | /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId} | Delete a report |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations | List annotations |
| POST | /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations | Bulk create or update annotations |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId} | Get an annotation |
| PUT | /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId} | Create or update an annotation |
| DELETE | /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId} | Delete an annotation |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses | List commit statuses for a commit |
| POST | /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build | Create a build status for a commit |
| GET | /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key} | Get a build status for a commit |
| PUT | /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key} | Update a build status for a commit |
| GET | /repositories/{workspace}/{repo_slug}/commits | List commits |
| POST | /repositories/{workspace}/{repo_slug}/commits | List commits with include/exclude |
| GET | /repositories/{workspace}/{repo_slug}/commits/{revision} | List commits for revision |
| POST | /repositories/{workspace}/{repo_slug}/commits/{revision} | List commits for revision using include/exclude |
| GET | /repositories/{workspace}/{repo_slug}/components | List components |
| GET | /repositories/{workspace}/{repo_slug}/components/{component_id} | Get a component for issues |
| GET | /repositories/{workspace}/{repo_slug}/default-reviewers | List default reviewers |
| GET | /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username} | Get a default reviewer |
| PUT | /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username} | Add a user to the default reviewers |
| DELETE | /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username} | Remove a user from the default reviewers |
| GET | /repositories/{workspace}/{repo_slug}/deploy-keys | List repository deploy keys |
| POST | /repositories/{workspace}/{repo_slug}/deploy-keys | Add a repository deploy key |
| GET | /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id} | Get a repository deploy key |
| PUT | /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id} | Update a repository deploy key |
| DELETE | /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id} | Delete a repository deploy key |
| GET | /repositories/{workspace}/{repo_slug}/deployments/ | List deployments |
| GET | /repositories/{workspace}/{repo_slug}/deployments/{deployment_uuid} | Get a deployment |
| GET | /repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables | List variables for an environment |
| POST | /repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables | Create a variable for an environment |
| PUT | /repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid} | Update a variable for an environment |
| DELETE | /repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid} | Delete a variable for an environment |
| GET | /repositories/{workspace}/{repo_slug}/diff/{spec} | Compare two commits |
| GET | /repositories/{workspace}/{repo_slug}/diffstat/{spec} | Compare two commit diff stats |
| GET | /repositories/{workspace}/{repo_slug}/downloads | List download artifacts |
| POST | /repositories/{workspace}/{repo_slug}/downloads | Upload a download artifact |
| GET | /repositories/{workspace}/{repo_slug}/downloads/{filename} | Get a download artifact link |
| DELETE | /repositories/{workspace}/{repo_slug}/downloads/{filename} | Delete a download artifact |
| GET | /repositories/{workspace}/{repo_slug}/effective-branching-model | Get the effective, or currently applied, branching model for a repository |
| GET | /repositories/{workspace}/{repo_slug}/effective-default-reviewers | List effective default reviewers |
| GET | /repositories/{workspace}/{repo_slug}/environments/ | List environments |
| POST | /repositories/{workspace}/{repo_slug}/environments/ | Create an environment |
| GET | /repositories/{workspace}/{repo_slug}/environments/{environment_uuid} | Get an environment |
| DELETE | /repositories/{workspace}/{repo_slug}/environments/{environment_uuid} | Delete an environment |
| POST | /repositories/{workspace}/{repo_slug}/environments/{environment_uuid}/changes/ | Update an environment |
| GET | /repositories/{workspace}/{repo_slug}/filehistory/{commit}/{path} | List commits that modified a file |
| GET | /repositories/{workspace}/{repo_slug}/forks | List repository forks |
| POST | /repositories/{workspace}/{repo_slug}/forks | Fork a repository |
| GET | /repositories/{workspace}/{repo_slug}/hooks | List webhooks for a repository |
| POST | /repositories/{workspace}/{repo_slug}/hooks | Create a webhook for a repository |
| GET | /repositories/{workspace}/{repo_slug}/hooks/{uid} | Get a webhook for a repository |
| PUT | /repositories/{workspace}/{repo_slug}/hooks/{uid} | Update a webhook for a repository |
| DELETE | /repositories/{workspace}/{repo_slug}/hooks/{uid} | Delete a webhook for a repository |
| GET | /repositories/{workspace}/{repo_slug}/issues | List issues |
| POST | /repositories/{workspace}/{repo_slug}/issues | Create an issue |
| POST | /repositories/{workspace}/{repo_slug}/issues/export | Export issues |
| GET | /repositories/{workspace}/{repo_slug}/issues/export/{repo_name}-issues-{task_id}.zip | Check issue export status |
| GET | /repositories/{workspace}/{repo_slug}/issues/import | Check issue import status |
| POST | /repositories/{workspace}/{repo_slug}/issues/import | Import issues |
Showing the first 100 of 303 endpoints; the full list is in the documentation.
Questions
Does the Bitbucket API API need an API key?
Yes. The Bitbucket API API uses API key authentication; the documentation explains how to get credentials.
Does the Bitbucket API API support HTTPS?
Yes, the Bitbucket API API is served over HTTPS.
How many endpoints does the Bitbucket API API have?
Its OpenAPI description lists 303 endpoints in version 2.0. The first 100 are shown on this page.
What are alternatives to the Bitbucket API API?
Other Development APIs include Cloudflare, Azure DevOps, IPify, App Store Connect API, StackExchange.
Similar development APIs
Compare alternatives →Cloudflare
DevelopmentManage DNS, CDN, Workers and other services; documented with an official OpenAPI 3.0 spec
Azure DevOps
DevelopmentThe Azure DevOps basic components of a REST API request/response pair
IPify
DevelopmentA simple IP Address API
App Store Connect API
DevelopmentThe data structure that represents an app store connect api resource.
StackExchange
DevelopmentQ&A forum for developers
IPinfo
DevelopmentAnother simple IP Address API
Listed from APIs.guru (CC0).