# Bitbucket

### Add Git connection

To add Bitbucket personal app password in Brainboard, you first need to generate it in your Bitbucket account.

<details>

<summary>Steps to generate an API token for your <strong>Bitbucket</strong> account.</summary>

1. Go to [API Token page in Atlassian Security center](https://id.atlassian.com/manage-profile/security/api-tokens)
2. Create API token with scopes:

   * Set the name and expiry date you want
   * Select Bitbucket app
   * Select the following scopes:
     * `write:pullrequest:bitbucket`
     * `write:repository:bitbucket`
     * `read:pullrequest:bitbucket`
     * `read:repository:bitbucket`

   <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2F43IQvV1Eg4xserOuUnz2%2Fr9r8LPTCsB027FtH.png?alt=media&#x26;token=66de81a4-1cfa-41df-b6da-05ada3ea8f88" alt="" width="375"><figcaption></figcaption></figure>
3. The token is generated, you can copy it to add to Brainboard:&#x20;

</details>

To add the generated token in Brainboard:

1. Go to the [Git integration](https://app.brainboard.co/settings/integrations/git) settings page.
2. Click on `Integrations`
3. In the section `Personal connections` Click on `Add connection`&#x20;
4. Select `Bitbucket` tab<br>

   <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2F9LSwtSzVJqzmV6dJ3f4V%2FCleanShot%202025-04-11%20at%2017.23.38%402x.png?alt=media&#x26;token=c82010cd-ffb6-406b-95fd-5cb0fa636b8d" alt=""><figcaption></figcaption></figure>
5. Add your credentials in the displayed window:
   * Name of the token. This is only for Brainboard, it will not be used when you do a pull request.
   * The URL of your Bitbucket server: by default Brainboard uses `https://api.bitbucket.org/2.0` but you can set your own URL.
   * Email: this is your Atlassian/Bitbucket email.
   * API token: the API Token generated.&#x20;
6. Then click on `Save and close` button.
7. Brainboard will verify if the credentials are valid:
   1. If they are valid, Brainboard displays a success message and you can see the integration now in the Git connection page<br>

      <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2Fpra8KE7gQGR5DC2nb3nn%2FCleanShot%202025-04-11%20at%2017.07.55%402x.png?alt=media&#x26;token=7628f78c-bf93-4f36-a57b-45f561a58ad6" alt=""><figcaption></figcaption></figure>
   2. If they are not, you'll receive an error about what is wrong. For example:<br>

      <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2Fdv9hKKZaTDhRnJqibfML%2FCleanShot%202025-04-11%20at%2017.00.18%402x.png?alt=media&#x26;token=48bcd08a-1c9d-4464-abdb-b425d22e4f0d" alt=""><figcaption></figcaption></figure>

      <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2Fqnr5EInAOYsKxrKSgPNJ%2FCleanShot%202025-04-11%20at%2017.03.42%402x.png?alt=media&#x26;token=80ab95d5-8278-4f87-8183-e778449c6a4c" alt=""><figcaption></figcaption></figure>

### How to use

Please refer to the page [pull-requests](https://docs.brainboard.co/settings/integrations/git-configuration/pull-requests "mention") to understand how you can use your git connections whether you want to do a pull request and import your code from Git.

### Edit or delete connection

1. Go to the [Git integration](https://app.brainboard.co/settings/integrations/git) settings page.
2. Click on `Integrations`
3. In the section `Personal connections` Click on `Bitbucket` integration that you want to edit or delete
4. Select the action you want to perform from the view

<figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2FiIAGOj5LsTTnSzvLGOeC%2FCleanShot%202025-04-11%20at%2017.30.00%402x.png?alt=media&#x26;token=de80cbaf-538e-4019-b996-704803797712" alt=""><figcaption></figcaption></figure>
