Introduction
To enable Kody to perform automatic code reviews on Bitbucket Cloud, you need to generate an API Token. This token allows Kody to access your repositories, pull requests, webhooks and issues, with the specific permissions listed below.Generating the API Token in Bitbucket
- Open the Atlassian API tokens page directly (or, from your Atlassian profile, navigate to Security → API tokens).
- Click Create API token with scopes.
- Give the token a name (for example
kody_code_review) and set an expiration date. - If prompted, select Bitbucket as the application.
- Select all the required scopes (see below).
- Review your choices, then click Create token.
- Copy the token immediately and store it securely — after creation you will not be able to view it again.
Required Scopes for Kody
The token must include all of the following scopes for full functionality with Kody:
Kody does not use
admin:repository:bitbucket or read:pipeline:bitbucket. CI statuses are read with read:repository:bitbucket.
⚠️ Ensure you grant only these necessary permissions; avoid granting more than required to reduce security risk.
Adding the Token to Kody
- Once the token is generated with all the required scopes, paste it into Kodus: during onboarding (Connect your Git tool → Bitbucket tab → Connect via token), or later in the sidebar under Repositories → Connect a provider → Bitbucket. Fill in Username, Email and API token, then click Validate and save.
- To create the webhook that delivers pull request events, Kody needs
read:webhook:bitbucketandwrite:webhook:bitbucket, and the token’s user must be an admin of the repository. - To replace a token, click Reset on the Bitbucket card on Repositories, choose Just reset the integration, then connect again with the new token.
Bitbucket Data Center
For a self-hosted Bitbucket Data Center, turn on Bitbucket Data Center (marked Alpha) in the same form. The API token and its scopes above apply to Bitbucket Cloud only. Data Center connects with basic authentication instead: fill in Username, Bitbucket Data Center Base URL (for examplehttps://bitbucket.your-company.com) and Basic auth password, then click Validate and save.
Important Notes
- The token will be displayed only once upon creation. Save it securely, because you will not be able to view it again.
- Set an expiry date if possible, to limit the token’s lifetime.
- If the token is ever compromised, revoke it immediately and create a new one.
- Periodically audit the tokens and their scopes to confirm they are still necessary and valid.
- Check whether your Bitbucket plan / account allows all the above scopes; some scopes (project, workspace) may depend on subscription / permissions.