> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blitzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bitbucket Data Center

> Connect a self-hosted Bitbucket Data Center instance to Blitzy for AI-Native code generation

export const ImageWrapper = ({src, alt, caption, width = '100%'}) => <Frame caption={caption}>
    <img src={src} alt={alt} style={{
  width: width,
  display: 'block'
}} />
  </Frame>;

Bitbucket Data Center integration lets Blitzy connect to your self-hosted instance for code analysis, branch creation, commits, and pull request management.

If you use Bitbucket Cloud (bitbucket.org), see [Bitbucket](/integrations/bitbucket) instead.

## Setup

<Steps>
  <Step title="Create an application in Bitbucket">
    In your Bitbucket Data Center instance, navigate to **Administration > Application Links**. Create a new application link and note the **Application ID** and **Secret** that are generated. The secret is shown only once during creation - store it securely.
  </Step>

  <Step title="Open the Blitzy connection form">
    Navigate to **Settings > Integrations** in your Blitzy dashboard and click **Connect Bitbucket Data Center**. The **Bitbucket Data Center connection** form will appear.
  </Step>

  <Step title="Enter connection details">
    Fill in the three required fields:

    * **Bitbucket URL** - Your organization's Bitbucket instance URL (e.g., `https://bitbucket.yourcompany.com`)
    * **Application ID** - The ID from **Administration > Application Links** in your Bitbucket instance
    * **Secret** - The secret generated when you created the application link

    <ImageWrapper src="/images/bitbucket-dc-connection.png" alt="Bitbucket Data Center connection form showing Bitbucket URL, Application ID, and Secret fields" />
  </Step>

  <Step title="Choose sharing">
    After connecting, choose whether to keep the integration private (**Just me**) or make it available to your team (**Share with team**). Click **Done** to finish.
  </Step>
</Steps>

<Note>You must have System Administrator access to your Bitbucket Data Center instance to create application links.</Note>

<Warning>The application secret is shown only once when creating the application link. If you lose it, click **Change secret** in the Blitzy connection form to generate a new one.</Warning>

## Permissions

The Blitzy Bitbucket Data Center integration requires the following permissions, scoped to the minimum level needed.

| Permission            | Access Level | Purpose                                           |
| --------------------- | ------------ | ------------------------------------------------- |
| Account - Read        | Read         | Read account information and email address        |
| Account - Write       | Read & Write | Modify account information                        |
| Projects - Read       | Read         | Read project settings and list available projects |
| Pull Requests - Read  | Read         | Read pull requests                                |
| Pull Requests - Write | Read & Write | Create and modify pull requests                   |
| Repositories - Read   | Read         | Clone and analyze repositories                    |
| Repositories - Write  | Read & Write | Create branches and push commits                  |

### Permission Mapping Reference

| Operation           | Required Permission  | Bitbucket API          |
| ------------------- | -------------------- | ---------------------- |
| Clone repository    | Repositories: Read   | Git-over-HTTPS         |
| Create branch       | Repositories: Write  | Branches REST API      |
| Push commits        | Repositories: Write  | Git-over-HTTPS         |
| Create pull request | Pull Requests: Write | Pull Requests REST API |
| List repositories   | Repositories: Read   | Repositories REST API  |
| Read user identity  | Account: Read        | Users REST API         |

## Differences from Bitbucket Cloud

|                   | Bitbucket Cloud     | Bitbucket Data Center                                                                    |
| ----------------- | ------------------- | ---------------------------------------------------------------------------------------- |
| Authentication    | OAuth via Atlassian | Application link on your instance                                                        |
| Domain            | `bitbucket.org`     | Your self-hosted domain (e.g., `bitbucket.yourcompany.com`)                              |
| Admin requirement | Not required        | System Administrator access required                                                     |
| Network access    | Public internet     | Instance must be reachable by Blitzy (see [Network Requirements](#network-requirements)) |

## Network Requirements

Your Bitbucket Data Center instance must be accessible from Blitzy's platform over HTTPS. If your instance is behind a firewall or VPN, work with your network team to allow inbound connections from Blitzy's IP ranges. Contact **[support@blitzy.com](mailto:support@blitzy.com)** for the current IP allowlist.

For Bitbucket-specific troubleshooting (OAuth errors, permission issues), see [Troubleshooting](/integrations/troubleshooting#bitbucket-issues).
