> For the complete documentation index, see [llms.txt](https://docs.harmony.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.harmony.io/integrations/saas-applications/bitbucket.md).

# Bitbucket

The Bitbucket integration allows you to connect your Bitbucket workspace to Harmony and automate user provisioning as part of your onboarding workflows. Once connected via OAuth, Harmony agents can manage repository access and workspace membership automatically - no manual steps required.

This integration is ideal for engineering onboarding flows where new hires need to be added to your Atlassian organization and granted access to the right repositories from day one.

### Connecting Bitbucket

To connect Bitbucket as a SaaS integration:

1. In Harmony, navigate to **Integrations** and select **SaaS Applications**.
2. Find **Bitbucket** in the list and click **Connect**.
3. You will be redirected to Atlassian to authorize the connection via OAuth.
4. Grant the requested permissions and confirm the authorization.
5. Once authorized, Bitbucket will appear as a connected integration and will be available to use in your workflows.

### Available Actions

After connecting Bitbucket, the following actions are available to use in your onboarding workflows:

#### Invite User

Adds a new user to your Atlassian organization. Use this action at the start of an onboarding flow to give a new team member access to your organization before assigning them to specific repositories.

#### Set Repository Permission

Grants a user access to a specific repository at a defined permission level. Use this action to provision the exact level of access a new hire needs - for example, read access for internal documentation repos or write access for active development repos.

#### Remove Repository Permission

Revokes a user's access to a specific repository. Use this action in offboarding flows or when adjusting access as roles change.

#### List Workspaces

Retrieves a list of workspaces available in your connected Bitbucket account. Use this action to dynamically reference workspace details within your workflow logic.

### Using Bitbucket Actions in Workflows

Once Bitbucket is connected, its actions are available in the workflow builder alongside other SaaS integration actions. You can combine them with actions from other integrations - such as sending a Slack message or creating a ticket in Jira - to build end-to-end onboarding automations.

A typical onboarding workflow with Bitbucket might look like this:

1. A new hire record is created in your HRIS.
2. Harmony triggers the onboarding workflow automatically.
3. The **Invite User** action adds the new hire to your Atlassian organization.
4. The **Set Repository Permission** action grants access to the relevant repositories based on their team or role.
5. A confirmation message is sent to the manager via Slack.

### Permissions and OAuth Scope

The Bitbucket integration uses OAuth to authenticate and operates with the permissions granted during the authorization flow. Make sure the account used to authorize the integration has sufficient administrative access in your Atlassian organization to perform the actions you plan to automate - such as inviting users and managing repository permissions.

### Disconnecting Bitbucket

To disconnect the Bitbucket integration:

1. Navigate to **Integrations** and select **SaaS Applications**.
2. Find **Bitbucket** in the list and click on the connected integration.
3. Select **Disconnect** and confirm your choice.

Disconnecting Bitbucket will stop all associated workflow actions from executing. Any workflows that include Bitbucket actions should be reviewed and updated before disconnecting.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.harmony.io/integrations/saas-applications/bitbucket.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
