> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/engineering-insights-classic/use-software-engineering-insights/setup-sei/configure-integrations/bitbucket/sei-bitbucket-cloud.md).

# Connect with BitBucket Cloud

Integrate SEI with Bitbucket Cloud

Bitbucket Cloud is a cloud-based platform for managing Git repositories. It is part of the Atlassian suite and is widely used for version control, collaboration, and DevOps workflows.

This page describes the settings and permissions for the Bitbucket integration. Harness supports both [Cloud](https://developer.harness.io/engineering-insights-classic/use-software-engineering-insights/setup-sei/configure-integrations/bitbucket/sei-bitbucket-cloud.md) and [Data Center (On-Prem)](https://developer.harness.io/engineering-insights-classic/use-software-engineering-insights/setup-sei/configure-integrations/bitbucket/sei-integration-bitbucket.md) versions of Bitbucket. The following settings are applicable to Bitbucket Cloud.

#### Requirements <a href="#requirements" id="requirements"></a>

The following permissions and settings are required to use the SEI Bitbucket integration:

* You have a Bitbucket account.
* Your role is **Member** or higher.

{% hint style="info" %}
If you have enabled an allowlist in your Bitbucket account, certain Harness IP addresses must be added to it in order to allow communication between the Harness Platform and Bitbucket. If the necessary IPs are not whitelisted, the integration may fail to authenticate or sync data properly.

To ensure your integration can work correctly, go to the list of [Harness Platform IPs](https://developer.harness.io/harness-platform/use-harness-platform/references/allowlist-harness-domains-and-ips.md) to find the addresses to allow in your firewall.
{% endhint %}

#### Add the integration <a href="#add-the-integration" id="add-the-integration"></a>

1. In your **Harness Project**, select the **SEI Module**, and go to your **Account**.
2. Select **Integrations** under **Data Settings**.
3. Select **Available Integrations**, locate **Bitbucket**, and click **Add Integration**.
4. In **Choose your Bitbucket type**, select **Cloud**.
5. In **Choose how you want to connect Bitbucket?**, choose the authentication type. You can use either OAuth or an Atlassian scoped API token to authenticate with Bitbucket.

{% tabs %}
{% tab title="Using OAuth" %}
You do not register your own OAuth app in Bitbucket. Harness redirects you to Bitbucket to authorize the Harness OAuth app. After you grant access, Bitbucket returns you to the integration setup page.

To complete the integration, do the following:

1. On the **Using OAuth** card, click **Select**.
2. Sign in to Bitbucket if prompted, then authorize the Harness OAuth app.
3. Enter a **Name** for the integration.
4. Optionally, add a **Description** and **Tags**.
5. Click **Save** to save the integration.
   {% endtab %}

{% tab title="Using Scoped API Token" %}
Authenticate with an Atlassian scoped API token and the email address of your Atlassian account.

To start the setup, click **Select** on the **Using App Password** card. This option authenticates with a scoped API token. The **Create Scoped Token** step of the wizard repeats the token instructions below.

**Create a scoped API token**

To create the token in Atlassian, do the following:

1. Go to [Atlassian account API tokens](https://id.atlassian.com/manage-profile/security/api-tokens) and sign in with your Atlassian account.
2. Click **Create API token with scopes**.
3. Enter a name and an expiry date for the token, then click **Next**.
4. Select **Bitbucket** as the app, then click **Next**.
5. Select the following scopes, then click **Next**:
   * `read:account`
   * `read:workspace:bitbucket`
   * `read:project:bitbucket`
   * `read:repository:bitbucket`
   * `read:pullrequest:bitbucket`
6. Click **Create token**.
7. Copy the token and store it securely. You cannot view it again after you close the dialog.

**Complete the integration setup in Harness**

In the Harness wizard, click **Next** on the **Create Scoped Token** step. On the **Provide Bitbucket Details** step, do the following:

1. Enter an **Integration Name**.
2. Enter a **Description (optional)** and **Tags (optional)** if you want them.
3. Under **Configure Bitbucket Authentication**, leave **Bitbucket URL** set to `https://bitbucket.org`.
4. In **Email**, enter your Atlassian account email.
5. In **Personal Access Token**, enter the scoped API token.
6. Click **Validate Connection** to run pre-flight checks and confirm the connection. Once validated, your Bitbucket integration appears under **My Integrations**.

{% hint style="info" %}
**Avoid rate limiting**

To ingest many repositories faster and avoid rate limits, click **+ Account Credentials** to add credentials for more Bitbucket accounts.
{% endhint %}
{% endtab %}
{% endtabs %}

#### See also <a href="#see-also" id="see-also"></a>

* [Connect with Bitbucket Data Center](https://developer.harness.io/engineering-insights-classic/use-software-engineering-insights/setup-sei/configure-integrations/bitbucket/sei-integration-bitbucket.md)
* [Reauthenticate](https://developer.harness.io/engineering-insights-classic/use-software-engineering-insights/setup-sei/configure-integrations/reauthenticate-integration.md)
* [Ingested data](https://developer.harness.io/engineering-insights-classic/use-software-engineering-insights/setup-sei/configure-integrations/bitbucket/sei-bitbucket-datasheet.md)

{% @harness-feedback/feedback %}
