Go to Integrations
- Navigate to the Integrations page in your Refacto dashboard.
-
Click Connect on Bitbucket Cloud.

Open Bitbucket Setup Form
- After clicking Connect, you’ll be redirected to the Bitbucket Cloud setup form in Refacto.
- This form requires three fields: Workspace Slug, API Token Owner’s Email, and API Token.
-
To get these values, please follow the next steps:
- Create an API Token
- Invite the Refacto Bot User

Create an API Token
You need to create a Bitbucket API token with appropriate permissions.⚠️ You must have Administrator access to the Bitbucket Cloud workspace to create webhooks at the workspace level.
-
Log in to Bitbucket Cloud and navigate to
Settings → Atlassian Account Settings → Security,
or open https://id.atlassian.com/manage-profile/security/api-tokens
- Click Create API token with scopes.
-
Give it a name (e.g., Refacto Integration) and set an expiry (recommended 360 days).

-
Under Select the app, choose Bitbucket.

-
Under Select Bitbucket scopes, check the following scopes:
- read:user:bitbucket, read:account
- read:webhook:bitbucket, write:webhook:bitbucket, delete:webhook:bitbucket
- read:workspace:bitbucket, read:project:bitbucket, read:repository:bitbucket
- read:pullrequest:bitbucket
- read:issue:bitbucket

-
Under Review your API token, verify details and click Create Token.

Copy and save the token — it’s shown only once.
Fill in the Setup Form
On the Bitbucket Cloud setup page in Refacto, provide the following:
-
Workspace Slug – The workspace identifier in your Bitbucket URL.
Example:https://bitbucket.org/bluetowers/\ → workspace slug is bluetowers
- API Token Owner’s Email – The email of the user who created the token.
- API Token – The token you generated above.
Invite the Refacto Bot
Invite the Refacto Bot User to your Bitbucket workspace to allow secure access to repositories during pull request reviews.
- The bot requires read access to temporarily clone repositories for analysis.
- Since Bitbucket App Passwords are deprecated from September 2025, Refacto uses an SSH-based authentication mechanism.
- Add the bot to your workspace using the provided email and grant it read permissions for all repositories (recommended) or only those you want Refacto to review.
security@refacto.aiDone
Your Bitbucket Cloud integration is now active.