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

# Bitbucket

## What's Supported

### Supported Actions

This connector supports:

* [Read Actions](/read-actions), including full historic backfill. Please note that incremental read is supported for `repositories` only. For all other objects, a full read of the Bitbucket instance will be done for each scheduled read.
* [Write Actions](/write-actions).
* [Proxy Actions](/proxy-actions), using the base URL `https://api.bitbucket.org`.

### Supported Objects

The Bitbucket connector supports reading from the following objects:

* [addon/linkers](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-addon/#api-addon-linkers-get)
* [pipelines-config/variables](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-get)
* [repositories](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-get)
* [user/emails](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-user-emails-get)
* [hook\_events](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-webhooks/#api-hook-events-get)
* [hooks](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-hooks-get)
* [members](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-members-get)
* [projects](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-projects-get)

The Bitbucket connector supports writing to the following objects:

* [pipelines-config/variables](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-post)

* [projects](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-projects/#api-workspaces-workspace-projects-post)

* [snippets](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-snippets/#api-snippets-post)

* [hooks](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-hooks-post)

### Example integration

For an example manifest file of an Apollo integration, visit our [samples repo on Github](https://github.com/amp-labs/samples/blob/main/bitbucket/amp.yaml).

## Before You Get Started

To connect Bitbucket with Ampersand, you will need [a Bitbucket/Atlassian Account](https://bitbucket.org/).

Once your account is created, you'll need to create an OAuth consumer in your bitbucket workspace, configure the app, and obtain the following credentials from your app:

* Client ID
* Client Secret

You will then use these credentials to connect your application to Ampersand.

### Create a Bitbucket Account

Follow these steps to sign up for a Bitbucket account:

* Go to the [Atlassian website](https://id.atlassian.com/login?application=bitbucket) and sign up for a new account.

### Register a Bitbucket OAuth App

Follow the steps below to register a Bitbucket OAuth app:

1. Log in to your [Bitbucket account](https://id.atlassian.com/login?application=bitbucket).
2. Go to **Workspace Settings** by clicking the gear icon in the top-right navigation bar.
3. Select **OAuth consumers** from the left sidebar then click **Add consumer**.
4. Enter the following details in the create application form:
   1. **Name**: Enter a name for your app.
   2. **Description**: Provide a brief description of your app.
   3. **Callback URL**: Enter the Ampersand redirect URL: `https://api.withampersand.com/callbacks/v1/oauth`.
5. Select the permissions you want to grant to your app.
6. Click **Save**.
   <img src="https://mintcdn.com/ampersand-24eb5c1a/i4a56x-Fmj6u7jdE/images/provider-guides/bitbucket_oauth.png?fit=max&auto=format&n=i4a56x-Fmj6u7jdE&q=85&s=c6068085f0aaff420982f1a9e12c0aaf" alt="Bitbucket Oauth creation" width="1178" height="1866" data-path="images/provider-guides/bitbucket_oauth.png" />

Once your app is created, you can access the **Client ID** and **Client Secret** credentials. Note these down, as you will need them to connect your app to Ampersand.

<img src="https://mintcdn.com/ampersand-24eb5c1a/i4a56x-Fmj6u7jdE/images/provider-guides/bitbucket_oauth2.png?fit=max&auto=format&n=i4a56x-Fmj6u7jdE&q=85&s=2c07fc6cb4109634fabeb655a7d6b8ee" alt="Bitbucket Oauth secrets" width="1978" height="856" data-path="images/provider-guides/bitbucket_oauth2.png" />

## Add Your Bitbucket App Info to Ampersand

1. Log in to your [Ampersand Dashboard](https://dashboard.withampersand.com).
2. Select the project where you want to create a Bitbucket integration.\\
   <img src="https://mintcdn.com/ampersand-24eb5c1a/Bx3tggG51e0liOp-/images/provider-guides/31a6a12-Ampersand.png?fit=max&auto=format&n=Bx3tggG51e0liOp-&q=85&s=7ebd893fd2a976ebe7cf8af53f8581b8" alt="Ampersand Project Selection" width="2244" height="442" data-path="images/provider-guides/31a6a12-Ampersand.png" />
3. Select **Provider Apps**.
4. Select **Bitbucket** from the **Provider** list.
5. Enter the previously obtained **Client ID** in the **Client ID** field and the **Client Secret** in the **Client Secret** field.

   <br />

   <img src="https://mintcdn.com/ampersand-24eb5c1a/i4a56x-Fmj6u7jdE/images/provider-guides/bitbucket_provider_app.gif?s=5673423c74bb79361832c95ff311b718" alt="Ampersand Project Selection" width="1920" height="1080" data-path="images/provider-guides/bitbucket_provider_app.gif" />
6. Click **Save Changes**.
