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

# Connect Bitbucket with Repository Access Token – StackOne Hub

> Link a Bitbucket account in the StackOne Hub using Repository Access Token. End-user guide to authorize the integration and start using Bitbucket actions.

Select Actions to adjust the guideSome actions may require additional configuration in the provider to be accessible. Choose the actions you need and the guide will be updated.

Select all
Clear

ActionScope(s)

Loading actions...No actions match your search.

Dynamic Guide URL

Copy URL

Scopes Selected

<pre role="textbox" aria-readonly="true" tabIndex="0" />

Separator

Copy scopes

## Creating a repository access token

A repository access token reaches only the repository it was created in, and works on any Bitbucket Cloud plan.

**1. Open the access tokens page**

Sign in to [Bitbucket](https://bitbucket.org/account/signin/) as an administrator of the repository, then open the repository.

<ul>
  <li>Next to the repository name in the left sidebar, select **…**, then select **Settings**.</li>
  <li>Under **Security**, select **Access tokens**.</li>
  <li>Click **Create access token**.</li>
</ul>

![The repository Access tokens settings page with Access tokens in the sidebar and the Create access token button highlighted](https://mintcdn.com/stackone-60/CujQRlriSUMfjXZA/connectors/bitbucket/images/access_token-config-access-tokens-page.png?fit=max\&auto=format\&n=CujQRlriSUMfjXZA\&q=85\&s=7fe9a2e4bce336dbc659d09e58eae485)

**2. Create the token**

Enables actions: Add Default Reviewer, Approve Commit, Approve Pull Request, Create Branch Restrictions, Create Branches, Create Build, Create Comments, Create Commits, Create Environment, Create Pipelines, Create Pullrequests, Create Schedules, Create Src, Create Variables, Decline Pull Request, Delete Branch Restrictions, Delete Comments, Delete Default Reviewers, Delete Reports, Delete Repository, Delete Schedules, Delete Variables, Get Branch Restrictions, Get Branches, Get Branching Model, Get Branching Model Settings, Get Build, Get Comments, Get Commit, Get Default Reviewers, Get Deploy Keys, Get Deployment, Get Diff, Get Diffstat, Get Environment, Get Log, Get Logs, Get Patch, Get Pipelines, Get Pipelines Config, Get Pullrequests, Get Reports, Get Repository, Get Schedules, Get Src, Get Steps, Get Variables, List Branch Restrictions, List Branches, List Comments, List Commits, List Default Reviewers, List Deploy Keys, List Deployments, List Downloads, List Environments, List Forks, List Pipelines, List Pull Request Commits, List Pullrequests, List Reports, List Repositories In Workspace, List Schedules, List Src, List Statuses, List Steps, List Variables, List Watchers, Merge Pull Request, Remove Request Changes, Request Changes, Resolve Pull Request Comment, Stop Pipeline, Unapprove Commit, Unapprove Pull Request, Unresolve Pull Request Comment, Update Branch Restrictions, Update Build, Update Build Number, Update Comments, Update Environment, Update Pipelines Config, Update Pullrequests, Update Reports, Update Schedules, Update Settings, Update Variables

In the **Create access token** dialog, tick every scope listed under **Scopes**.

<ul>
  <li>**Name**: `StackOne Integration`</li>
  <li>**Expiry**: The date the token should stop working</li>
  <li>Click **Create**.</li>
</ul>

![The Create access token dialog with the Name, Expiry and ticked scopes highlighted](https://mintcdn.com/stackone-60/CujQRlriSUMfjXZA/connectors/bitbucket/images/access_token-config-create-access-token.png?fit=max\&auto=format\&n=CujQRlriSUMfjXZA\&q=85\&s=5172a9bde989ff94276ff72f6f23a1af)

<ul>
  <li>
    repository
  </li>

  <li>
    repository:write
  </li>

  <li>
    repository:admin
  </li>

  <li>
    repository:delete
  </li>

  <li>
    pullrequest
  </li>

  <li>
    pullrequest:write
  </li>

  <li>
    pipeline
  </li>

  <li>
    pipeline:write
  </li>

  <li>
    pipeline:variable
  </li>
</ul>

**3. Copy the token**

In the **Access token created** dialog, the token is shown only once and cannot be retrieved after you close the dialog.

<ul>
  <li>Click **Copy**.</li>
  <li>Copy the **Access Token** across.</li>
</ul>

![The Access token created dialog with the token value hidden and the Copy button highlighted](https://mintcdn.com/stackone-60/CujQRlriSUMfjXZA/connectors/bitbucket/images/access_token-config-copy-access-token.png?fit=max\&auto=format\&n=CujQRlriSUMfjXZA\&q=85\&s=84c532f3099933e7887315d68083e760)

## Link the Account

**1. Connect**

<ul>
  <li>Click **Connect**.</li>
  <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
  <li>Once authorization is successful, you will see a confirmation popup.</li>
</ul>

**2. Use Actions**

Connect an AI platform to the linked account's actions. See [AI Platforms](https://docs.stackone.com/ai-platforms/overview.md).

Other ways to call actions are listed in [Protocols & SDKs](https://docs.stackone.com/connect/protocols-and-sdks.md).

## Next Steps

> [card] [Webhooks setup](https://docs.stackone.com/connectors/bitbucket/guides/webhook-setup.md)
>
> Configure receiving Events for Bitbucket into StackOne.


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