Skip to main content
Follow these steps to connect Refacto to your Bitbucket Cloud workspace.

Go to Integrations

  • Navigate to the Integrations page in your Refacto dashboard.
  • Click Connect on Bitbucket Cloud. Bitbucket Integration Page

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
    Bitbucket Setup Form

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.
  1. Log in to Bitbucket Cloud and navigate to
    Settings → Atlassian Account Settings → Security,
    or open https://id.atlassian.com/manage-profile/security/api-tokens
    Bitbucket Security Page
  2. Click Create API token with scopes.
  3. Give it a name (e.g., Refacto Integration) and set an expiry (recommended 360 days). Bitbucket Name And Expiry
  4. Under Select the app, choose Bitbucket. Bitbucket App Select
  5. 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
    Bitbucket Token Permissions
  6. Under Review your API token, verify details and click Create Token. Bitbucket Token Permissions
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.
Click Save & Sync Repos when done.

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.
Bot Email: security@refacto.ai

Done

Your Bitbucket Cloud integration is now active.