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

# Bitbucket

> Connect Bitbucket Cloud to Tembo on Kubernetes with an OAuth consumer.

Tembo connects to Bitbucket through an OAuth consumer you create in your Bitbucket workspace.

## Step 1: Create an OAuth consumer

In your Bitbucket workspace settings, create an OAuth consumer:

* **Callback URL:** `https://<your-host>/api/oauth/bitbucket/callback`
* **Permissions:** covering the scopes Tembo requests, `account`, `repository`, `pullrequest:write` and `webhook`.

Copy the consumer's key and secret.

## Step 2: Give Tembo the credentials

Store them in a Secret, with a random webhook secret of your own:

```bash theme={null}
read -s BITBUCKET_CLIENT_SECRET
kubectl -n tembo create secret generic tembo-bitbucket \
  --from-literal=bitbucket.clientId=<consumer key> \
  --from-literal=bitbucket.clientSecret="$BITBUCKET_CLIENT_SECRET" \
  --from-literal=bitbucket.webhookSecret="$(openssl rand -hex 32)"
unset BITBUCKET_CLIENT_SECRET
```

Add it to `configSecrets` in your values, keeping any existing entries, and [apply the change](https://docs.tembo.io/features/self-hosted/kubernetes/configuration.md#apply-changes):

```yaml theme={null}
configSecrets:
  - tembo-bitbucket
```

## Step 3: Connect Bitbucket

1. In Tembo, open **Settings > Integrations** and install Bitbucket.
2. Authorize the consumer with an account that can access your workspace's repositories.
3. Start a session on a repository, and check that it can open a pull request.

Bitbucket delivers webhooks to `https://<your-host>/api/webhook/bitbucket`, or your [public API host](https://docs.tembo.io/features/self-hosted/kubernetes/networking.md#public-api-host). If repository actions fail after installing, check both the consumer's permissions and the authorizing user's access.

See the [Bitbucket guide](https://docs.tembo.io/integrations/bitbucket.md) for using it.

***

## Need Help?

If you run into any issues, contact [support@tembo.io](mailto:support@tembo.io).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.