Before you begin
Setup has four parts:- Create the service account.
- Create its API token.
- Sign in and connect your workspace.
- Install on repositories and test.
app.eu.coderabbit.ai wherever this page says app.coderabbit.ai.
When you finish, you have:
- A service account whose Atlassian email, account UUID, and API token CodeRabbit stores, with the token encrypted. CodeRabbit uses them to read pull requests and post reviews.
- A CodeRabbit webhook on each installed repository.
- CodeRabbit reviews on new and updated pull requests in those repositories.
Create the service account
CodeRabbit accepts an API token from any Atlassian account, but a dedicated account avoids two problems:- CodeRabbit posts reviews, comments, and approvals as the tokenâs owner. With a personal token, they appear under that personâs name.
- CodeRabbit doesnât review pull requests opened by the account whose token is saved, and says âThis PR was authored by the user configured for CodeRabbit reviews.â With a personal token, that personâs pull requests are never reviewed.
Create an Atlassian account
Add the account to your workspace
Create the API token
Sign in as the service account
Start a scoped token
Name the token and set an expiry date
CodeRabbit, and an expiry date between 1 and 365 days away. CodeRabbit canât use an expired token and doesnât warn you in advance, so note the date and replace the token before then.Select Bitbucket
Select the scopes
write:repository:bitbucket unless you donât want CodeRabbit to push commits. Select each one explicitly: a write scope doesnât include the matching read scope.Create and copy the token
Scopes
CodeRabbit refuses to save a token that lacks any required scope.write:repository:bitbucket, but then features that push commits fail: the Fix finishing touch, docstring generation, and security fixes.
Donât add scopes that arenât in this table. CodeRabbit doesnât need them.
Connect your workspace
Sign in with Bitbucket Cloud
Select your workspace
Save the service account credentials
Install CodeRabbit on repositories
The onboarding wizard continues with this step. To add repositories later, use the Connected repositories page.Select repositories
Install
Open a test pull request
Talk to CodeRabbit in pull requests
To talk to CodeRabbit in a pull request comment, mention@coderabbitai, @coderabbit, or the service account. Bitbucketâs mention autocomplete works too. See Manage code reviews for the commands.
Replace the token or service account
The saved credentials are on the Bitbucket user page (Account â Bitbucket user) in CodeRabbit. The page shows Organization user (User ID: âŚ), where the ID is the accountâs Bitbucket UUID (theuuid field returned by GET https://api.bitbucket.org/2.0/user), not its username.
To replace an expiring token, or to switch CodeRabbit to a different account:
Create a new token
Save it in CodeRabbit
Revoke the old token
Webhooks
Install adds one webhook per repository with the URLhttps://app.coderabbit.ai/handleBitbucket and a random secret for that repository. Installing again after Uninstall replaces any webhook with that URL instead of adding a second one.
Bitbucket signs each delivery with the webhookâs secret, using HMAC-SHA256 in the X-Hub-Signature header. CodeRabbit verifies the signature with a constant-time comparison. It uses the repositoryâs own secret if one is stored, and otherwise the organization secret saved on the Webhook secret page (Account â Webhook secret).

A CodeRabbit webhook in a Bitbucket repository's webhook settings
Add a webhook manually
Add a webhook manually
Copy the webhook URL
Save the organization secret
Add the webhook in Bitbucket
Rotate the webhook secret
On Account â Webhook secret, click Change secret and save the new secret. CodeRabbit then updates every webhook with the CodeRabbit URL on installed repositories, together with their stored secrets. It makes the changes with your Bitbucket login and reports how many repositories it updated and how many failed. For each failed repository, and for webhooks on repositories CodeRabbit hasnât installed, update the secret in Bitbucket under Repository settings â Webhooks.IP allowlist
If your workspace restricts access by IP address (Workspace settings â Access Management â Access controls â Restrict access to certain IP addresses, a Bitbucket Premium feature), add CodeRabbitâs IP addresses there:Troubleshooting
Most fixes below need a Bitbucket workspace admin, who is also a CodeRabbit admin. If onboarding shows Admin Access Required, ask one. Installing needs Admin permission on the repository. If one pull request wasnât reviewed for a reason unrelated to Bitbucket setup, such as its draft status, its target branch, or review seats, see Automatic review controls and Seat assignment.Credentials can't be saved
Credentials can't be saved
uuid field means the email and token work.Install fails
Install fails
Give it admin access to the repository or Give that account admin access to the repository, and make sure its credential includes the webhook scope means the account creating the webhook lacks Admin permission on that repository. CodeRabbit creates webhooks with the Bitbucket login of whoever clicks Install, so ask a repository admin to install it, or get Admin permission first.Reviews stopped
Reviews stopped
- On every repository: the service accountâs API token has most likely expired or been revoked. When Bitbucket rejects the token, the CodeRabbit app shows âBitbucket needs its credentials updated.â with a Fix connection link, and if it keeps failing, CodeRabbit emails a billing admin. Nothing is posted on pull requests. Create a new token and save it, as described in Replace the token or service account.
- On one repository, or a new one: check that the service account still has access to it. Then, in Bitbucket, check Repository settings â Webhooks for a webhook with the CodeRabbit URL. If itâs missing, select the repository on the Connected repositories page and click Uninstall, then Install.
- After turning on IP allowlisting: add CodeRabbitâs addresses, as described in IP allowlist.
One person's pull requests are never reviewed
One person's pull requests are never reviewed
Webhook deliveries are rejected
Webhook deliveries are rejected
Whatâs next
Configure CodeRabbit
.coderabbit.yaml file.Automatic review controls
Manage code reviews
@coderabbitai commands.