Hanzo
PlatformHanzo KMSIntegrationsApp Connections

Bitbucket Connection

Learn how to configure a Bitbucket Connection for Hanzo KMS.

Hanzo KMS supports the use of API Tokens to connect with Bitbucket.

Hanzo KMS recommends creating a dedicated Bitbucket account with access restricted to only the resources your use case requires.

Create Bitbucket Access Token

Go to Account API Tokens and click Create API token with scopes.

Create API Token

Set the name and expiration date of the token, then click Next.

Set Name and Expiry

Keep in mind that you'll need to manually replace the token after it expires.

Select Bitbucket and then click Next.

Select Bitbucket

Configure permissions according to your app's use case:

read:workspace:bitbucket
read:user:bitbucket
read:webhook:bitbucket
write:webhook:bitbucket
delete:webhook:bitbucket
read:repository:bitbucket

Configure Permissions

read:workspace:bitbucket
admin:workspace:bitbucket
read:user:bitbucket
read:repository:bitbucket
read:pipeline:bitbucket
write:pipeline:bitbucket
admin:pipeline:bitbucket

Configure Permissions

Click Next.

Save the API Token for later steps.

Save Token

Create Bitbucket Connection in Hanzo KMS

In your Hanzo KMS dashboard, navigate to the Integrations tab in the desired project, then select App Connections.

App Connections Tab

Click the Add new connection button and select Bitbucket from the list of available connections.

Complete the Bitbucket Connection form by entering:

  • A descriptive name for the connection
  • An optional description for future reference
  • Your Bitbucket email
  • The API Token from earlier steps

Bitbucket Connection Modal

After clicking Create, your Bitbucket Connection is established and ready to use with your Hanzo KMS project.

Bitbucket Connection Created

To create a Bitbucket Connection, make an API request to the Create Bitbucket Connection API endpoint.

Sample request

curl    --request POST \
        --url https://app.kms.hanzo.ai/api/v1/app-connections/bitbucket \
        --header 'Content-Type: application/json' \
        --data '{
            "name": "my-bitbucket-connection",
            "method": "api-token",
            "projectId": "7ffbb072-2575-495a-b5b0-127f88caef78",
            "credentials": {
                "email": "user@example.com",
                "apiToken": "<YOUR-API-TOKEN>"
            }
        }'

Sample response

{
  "appConnection": {
      "id": "e5d18aca-86f7-4026-a95e-efb8aeb0d8e6",
      "name": "my-bitbucket-connection",
      "projectId": "7ffbb072-2575-495a-b5b0-127f88caef78",
      "description": null,
      "version": 1,
      "orgId": "6f03caa1-a5de-43ce-b127-95a145d3464c",
      "createdAt": "2025-04-23T19:46:34.831Z",
      "updatedAt": "2025-04-23T19:46:34.831Z",
      "isPlatformManagedCredentials": false,
      "credentialsHash": "7c2d371dec195f82a6a0d5b41c970a229cfcaf88e894a5b6395e2dbd0280661f",
      "app": "bitbucket",
      "method": "api-token",
      "credentials": {
          "email": "user@example.com"
      }
  }
}

How is this guide?

Last updated on

On this page