> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Bitbucket

> Connect your workspace, choose which repositories to review, and receive your first pull request review.

> [!NOTE]
>
> Using a self-hosted instance? Follow the [Bitbucket Data Center setup guide](https://docs.codeant.ai/setup/bitbucket_data_center.md).

## Before you begin

* A Bitbucket Cloud account with access to the workspace and repositories you want reviewed.
* A workspace administrator who can install the CodeAnt AI app, or an Atlassian API token for the token connection below.
* A repository where you can open a pull request.

## Connect your workspace

Choose one connection method. Use the app installation for a shared workspace, or the API token flow for a personal workspace.

> [tab] Workspace app
>
> **1. Sign in with Bitbucket**
>
> Open the [CodeAnt AI dashboard](https://app.codeant.ai) and sign in with Bitbucket. Choose the workspace you want reviewed.
>
> **2. Install CodeAnt AI in the workspace**
>
> On the repository connection screen, select **Configure Bitbucket Workspace** to open the Atlassian installation flow. Install CodeAnt in the same workspace. Ask a workspace administrator to complete the installation if you do not have access to workspace app settings.
>
> **3. Check repository access**
>
> Return to CodeAnt and select **Check for Repositories**. Confirm that the workspace's repositories are available before continuing.
>
> The app enables reviews for all repositories in the workspace by default. Use [Choose which repositories to review](#choose-which-repositories-to-review) below to limit that selection before trying a review.

> [tab] Personal workspace API token
>
> **1. Create a scoped API token**
>
> Open your [Atlassian API token settings](https://id.atlassian.com/manage-profile/security/api-tokens). Select **Create API token with scopes**, name it `CodeAnt AI`, choose an expiry date, and select **Bitbucket** as the app.
>
> Select all of these scopes:
>
> | Permission | Scopes |
> | - | - |
> | Repositories: read and write | `read:repository:bitbucket`, `write:repository:bitbucket` |
> | Pull requests: read and write | `read:pullrequest:bitbucket`, `write:pullrequest:bitbucket` |
> | Webhooks: read and write | `read:webhook:bitbucket`, `write:webhook:bitbucket` |
> | Account: read | `read:me` |
> | User: read | `read:user:bitbucket` |
> | Workspaces: read | `read:workspace:bitbucket` |
>
> CodeAnt uses Account access to validate the token and User and Workspaces access for AI code suggestions. Read and write scopes must both be selected; write scopes do not include read access. See [Atlassian's API token permissions](https://support.atlassian.com/bitbucket-cloud/docs/api-token-permissions/).
>
> Create the token and copy its value before leaving the page. Atlassian displays it only once. See [Atlassian's token creation guide](https://support.atlassian.com/bitbucket-cloud/docs/create-an-api-token/) if you cannot find the token settings.
>
> **2. Connect the token in CodeAnt AI**
>
> Sign in to the [CodeAnt AI dashboard](https://app.codeant.ai) with Bitbucket. On the repositories screen, choose the **Personal workspace? Use API token** option for personal workspaces.
>
> Enter the Atlassian email address of the account that created the token and paste the token. Select **Connect Workspace**.
>
> CodeAnt validates the token and creates the webhooks that trigger reviews. Check the connection result for any webhook errors, then continue with the repository selection below.

## Choose which repositories to review

1. In CodeAnt AI, open **Settings** → **AI Code Review**.
2. Scroll to **Configure Repos** and select **Configure**.
3. Keep the repositories you want reviewed checked. Uncheck any repositories you want to exclude.
4. Select **Save Changes**.

Start with one repository so you can verify the integration before enabling more.

## Get your first review

Open a pull request in an enabled repository. CodeAnt AI reviews the changes and posts feedback directly on the PR. When it finds an issue, its comment explains the problem, severity, and suggested fix. See [how to read a review comment](https://docs.codeant.ai/pull_request/features/code_review.md).

To review an existing PR or rerun a review, post this comment on the pull request:

```text theme={"theme":"css-variables"}
@codeant-ai: review
```

## Troubleshooting

> [accordion] I cannot install the app in my workspace
>
> Confirm that you are using the intended workspace and have access to its app settings. Ask a workspace administrator to install the app. For a personal workspace, use the API token connection above.

> [accordion] CodeAnt rejects my API token
>
> Check that the email address belongs to the account that created the token, that the token has not expired or been revoked, and that all scopes in the table are selected. Create a replacement scoped token if any scopes are missing, then select **Connect Workspace** again.

> [accordion] My workspace connected, but webhook creation failed
>
> Confirm that the API token includes both Webhooks read and write scopes. Reconnect the workspace to retry creation. If it still fails, [contact CodeAnt support](mailto:support@codeant.ai) with the workspace name and connection error. Do not include the token.

> [accordion] My workspace is disconnected
>
> If your API token expired or was revoked, create a new token with the same scopes and reconnect the workspace through the API token flow.

> [accordion] My pull request has not received a review
>
> Confirm that the app or API token is connected to the PR's workspace. Check that the repository is enabled under **Settings** → **AI Code Review** → **Configure Repos**, then post `@codeant-ai: review` on the PR. If feedback still does not appear, [contact CodeAnt support](mailto:support@codeant.ai) with the workspace, repository name, and PR URL. Do not include your token.

## Next steps

> [card] [Customize your reviews](https://docs.codeant.ai/pull_request/customize/rules.md)
>
> Add review rules for your team's coding standards.

> [card] [Configure repository scans](https://docs.codeant.ai/repositories/analysis_configuration.md)
>
> Choose which analyses run and which files they include.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.