# Bitbucket Cloud

> Connect Bitbucket Cloud to MergeHarbor with OAuth or an access token, choose repositories, and get AI reviews on every pull request.

## Connect with Bitbucket (recommended)

Choose **Bitbucket** in the console and authorize MergeHarbor for your workspace. MergeHarbor requests read access to your account, write access to repositories and pull requests (Bitbucket requires repository write for pull request write), and permission to manage webhooks. See [Code host permissions](https://mergeharbor.com/docs/permissions).

## Connect with an access token

Use a **workspace**, **project**, or **repository access token** with **Repositories: Read**, **Pull requests: Write**, and **Webhooks: Read and write**. Workspace access tokens require Bitbucket Premium.

## How reviews appear

Inline comments on the pull request, a summary comment, and a build status. Pull requests from forks are supported.

Bitbucket Cloud does not offer a reactions API, so rate review comments in the MergeHarbor console to feed learning.

## Commands

Comment `@mergeharbor review`, `@mergeharbor remember <rule>` or any other [command](https://mergeharbor.com/docs/configuration#commands-in-pull-requests) on a pull request. Bitbucket turns `@` into a people picker, so you can also start the comment with `mergeharbor review` (no `@`). Questions still need the `@mergeharbor` mention.

MergeHarbor keeps one webhook per repository: when it registers a repository again, for example after you reconnect, it removes the hooks it added earlier.

## Reconnect, switch accounts or disconnect

- **Reconnect** (Integrations → Code hosts) replaces the token of the account the connection belongs to, for example after a token expired or was revoked. Signing in as a different Bitbucket account is refused and nothing changes. After a reconnect, MergeHarbor registers the webhooks of the enabled repositories again with the new credentials; a repository the account can no longer access stops being reviewed and shows a webhook error on the Repositories page.
- **Switch accounts** by disconnecting and connecting the other account.
- **Disconnect** stops reviews at once and removes MergeHarbor's webhooks from Bitbucket. The repositories' reviews, index and settings are kept for 7 days, then permanently deleted. Connecting Bitbucket again within those 7 days brings the repositories back with their history; the ones that were enabled are reviewed again if the connected account can see them, and the others stay disabled.
- A repository belongs to one MergeHarbor organization at a time. Enabling a repository that another organization has connected is refused until it is disconnected there.
