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

# Bitbucket

> What agents can do in Bitbucket at each access level, and how to connect, limit, and disconnect Bitbucket.

Connect Bitbucket so your agents can work in your Bitbucket account. You choose an access level for each account, and Squad refuses any agent action outside that level.

## Access levels

Each Bitbucket account has an access level: **Read-only**, **Read + write**, and **Full access**. Squad refuses any agent action outside that level. You can also narrow or block single agents under **Per-agent access**.

| Level                          | The connect window describes this level as          | Actions agents can use |
| ------------------------------ | --------------------------------------------------- | ---------------------- |
| **Read-only**                  | "Read account info and repos."                      | 80 of 110              |
| **Read + write** (recommended) | "Read/write code, pull requests, and issues."       | 105 of 110             |
| **Full access**                | "Read/write code, manage PRs, administer settings." | 110 of 110             |

**Read + write** is the recommended level. The connect window selects it for you, and you can choose another level.

The Bitbucket sign-in page asks you to approve full access to your account. This is expected. Squad does not narrow the sign-in. It checks every agent action against the level you chose, and it refuses actions outside that level.

## What agents can do at each level

Each level opens with a short summary in plain tasks, then lists every action it adds, grouped by what the action works on. You do not need to name actions. Ask in plain words, and the agent searches for the matching action.

<Tip>**Find an action.** Open a level and use your browser's find (Ctrl+F, or Cmd+F on a Mac) with a word from the task or part of a slug. Or ask your agent in plain words, for example "What can you do in my Bitbucket account?" The agent can search the Bitbucket actions for you.</Tip>

Each action shows its name, a one-line description where the Bitbucket action catalog has one, and its slug. The slug is the ID that agents use when they call the action.

<AccordionGroup>
  <Accordion title="Read-only">
    Agents can use 80 of the 110 Bitbucket actions at this level:

    * View and create commits
    * View and search code
    * View comments
    * View repositories
    * View workspaces
    * View pull requests
    * View branches
    * View email addresses
    * View environments
    * View pipelines
    * View reports
    * View snippets

    All 80 actions at this level:

    <AccordionGroup>
      <Accordion title="Activities (1)">
        | Action                                 | What it does                                                      | Slug                                               |
        | -------------------------------------- | ----------------------------------------------------------------- | -------------------------------------------------- |
        | Get repositories pullrequests activity | Get paginated activity log for all pull requests in a repository. | `BITBUCKET_GET_REPOSITORIES_PULLREQUESTS_ACTIVITY` |
      </Accordion>

      <Accordion title="Bases (1)">
        | Action                      | What it does                                                                             | Slug                                    |
        | --------------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------- |
        | Get repositories merge base | Get the merge base (best common ancestor) between two commits in a Bitbucket repository. | `BITBUCKET_GET_REPOSITORIES_MERGE_BASE` |
      </Accordion>

      <Accordion title="Branches (2)">
        | Action        | What it does                                                                                                     | Slug                      |
        | ------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------- |
        | Get branch    | Retrieves detailed information about a specific branch in a Bitbucket repository.                                | `BITBUCKET_GET_BRANCH`    |
        | List branches | Lists branches in a Bitbucket repository with optional server-side filtering by name pattern (BBQL) and sorting. | `BITBUCKET_LIST_BRANCHES` |
      </Accordion>

      <Accordion title="Change history (1)">
        | Action             | What it does                                                                                                                                 | Slug                           |
        | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
        | Get commit changes | Retrieve a page of changes made in a specified commit, showing all changed files with their change statistics (lines added/removed, status). | `BITBUCKET_GET_COMMIT_CHANGES` |
      </Accordion>

      <Accordion title="Code (5)">
        | Action                        | What it does                                                                                               | Slug                                      |
        | ----------------------------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
        | Get commit diff               | Retrieve the unified diff between two provided revisions or for a single commit in a Bitbucket repository. | `BITBUCKET_GET_COMMIT_DIFF`               |
        | Get pull request diff         | Fetch the unified diff for a Bitbucket pull request (follows 302 redirect to repository diff).             | `BITBUCKET_GET_PULL_REQUEST_DIFF`         |
        | Get workspaces search code    | Search for code in the repositories of the specified workspace.                                            | `BITBUCKET_GET_WORKSPACES_SEARCH_CODE`    |
        | Search team code              | Search for code in repositories of a specified team.                                                       | `BITBUCKET_SEARCH_TEAM_CODE`              |
        | Search user repositories code | Search for code in the repositories of a specified user.                                                   | `BITBUCKET_SEARCH_USER_REPOSITORIES_CODE` |
      </Accordion>

      <Accordion title="Comments (4)">
        | Action                                 | What it does                                                                                 | Slug                                               |
        | -------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------- |
        | Get commit comment                     | Retrieves a specific comment from a commit by its ID.                                        | `BITBUCKET_GET_COMMIT_COMMENT`                     |
        | Get pull request comment               | Retrieve a specific comment from a pull request by its ID.                                   | `BITBUCKET_GET_PULL_REQUEST_COMMENT`               |
        | Get repositories commit comments       | Retrieves all comments on a specific commit in a Bitbucket repository.                       | `BITBUCKET_GET_REPOSITORIES_COMMIT_COMMENTS`       |
        | Get repositories pullrequests comments | Retrieves a paginated list of comments on a specific pull request in a Bitbucket repository. | `BITBUCKET_GET_REPOSITORIES_PULLREQUESTS_COMMENTS` |
      </Accordion>

      <Accordion title="Commits (8)">
        | Action                           | What it does                                                                     | Slug                                         |
        | -------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------- |
        | Create repositories commits2     | List commits from a revision using POST method.                                  | `BITBUCKET_CREATE_REPOSITORIES_COMMITS2`     |
        | Get commit build status          | Get a specific build status for a commit in Bitbucket.                           | `BITBUCKET_GET_COMMIT_BUILD_STATUS`          |
        | Get pull request commits         | Retrieve commits for a specified pull request.                                   | `BITBUCKET_GET_PULL_REQUEST_COMMITS`         |
        | Get repositories commit          | Retrieve detailed information about a specific commit in a Bitbucket repository. | `BITBUCKET_GET_REPOSITORIES_COMMIT`          |
        | Get repositories commit statuses | Returns all build statuses (e.g., CI/CD pipeline results) for a specific commit. | `BITBUCKET_GET_REPOSITORIES_COMMIT_STATUSES` |
        | List commits                     | Retrieve a page of commits from a Bitbucket repository.                          | `BITBUCKET_LIST_COMMITS`                     |
        | List commits from revision       | List commits starting from a specific revision in a Bitbucket repository.        | `BITBUCKET_LIST_COMMITS_FROM_REVISION`       |
        | List commits on master           | Lists commits on the master branch of a Bitbucket repository.                    | `BITBUCKET_LIST_COMMITS_ON_MASTER`           |
      </Accordion>

      <Accordion title="Content (1)">
        | Action               | What it does                                                    | Slug                             |
        | -------------------- | --------------------------------------------------------------- | -------------------------------- |
        | Get raw file content | DEPRECATED: Use BITBUCKET\_GET\_FILE\_FROM\_REPOSITORY instead. | `BITBUCKET_GET_RAW_FILE_CONTENT` |
      </Accordion>

      <Accordion title="Deployments (1)">
        | Action           | What it does                                            | Slug                         |
        | ---------------- | ------------------------------------------------------- | ---------------------------- |
        | List deployments | Lists deployments for a specified Bitbucket repository. | `BITBUCKET_LIST_DEPLOYMENTS` |
      </Accordion>

      <Accordion title="Email addresses (2)">
        | Action           | What it does                                                                          | Slug                         |
        | ---------------- | ------------------------------------------------------------------------------------- | ---------------------------- |
        | Get user emails  | Returns all the authenticated user's email addresses, both confirmed and unconfirmed. | `BITBUCKET_GET_USER_EMAILS`  |
        | Get user emails2 | Retrieves details about a specific email address for the authenticated user.          | `BITBUCKET_GET_USER_EMAILS2` |
      </Accordion>

      <Accordion title="Environments (2)">
        | Action                         | What it does                                                                                     | Slug                                       |
        | ------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------ |
        | Get repositories environments2 | Retrieve detailed information about a specific deployment environment in a Bitbucket repository. | `BITBUCKET_GET_REPOSITORIES_ENVIRONMENTS2` |
        | List repositories environments | List all deployment environments configured for a Bitbucket repository.                          | `BITBUCKET_LIST_REPOSITORIES_ENVIRONMENTS` |
      </Accordion>

      <Accordion title="Events (1)">
        | Action          | What it does                                                                                                  | Slug                        |
        | --------------- | ------------------------------------------------------------------------------------------------------------- | --------------------------- |
        | Get hook events | Retrieves a paginated list of all valid webhook events for a specified entity type (repository or workspace). | `BITBUCKET_GET_HOOK_EVENTS` |
      </Accordion>

      <Accordion title="Files (1)">
        | Action                   | What it does                                                                                                                                                   | Slug                                 |
        | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
        | Get file from repository | Retrieves a specific file's content from a Bitbucket repository at a given commit (hash, branch, or tag), failing if the file path is invalid for that commit. | `BITBUCKET_GET_FILE_FROM_REPOSITORY` |
      </Accordion>

      <Accordion title="Forks (1)">
        | Action                | What it does | Slug                              |
        | --------------------- | ------------ | --------------------------------- |
        | List repository forks |              | `BITBUCKET_LIST_REPOSITORY_FORKS` |
      </Accordion>

      <Accordion title="Issues (2)">
        | Action                       | What it does                                                                                          | Slug                                     |
        | ---------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------- |
        | Get repositories issues vote | Check whether the authenticated user has voted for a specific issue in a Bitbucket repository.        | `BITBUCKET_GET_REPOSITORIES_ISSUES_VOTE` |
        | List issues                  | Lists issues in a Bitbucket repository with optional filtering by state, priority, kind, or assignee. | `BITBUCKET_LIST_ISSUES`                  |
      </Accordion>

      <Accordion title="Keys (1)">
        | Action              | What it does                                                           | Slug                            |
        | ------------------- | ---------------------------------------------------------------------- | ------------------------------- |
        | Get SSH latest keys | Retrieves a paginated list of SSH keys for a specified Bitbucket user. | `BITBUCKET_GET_SSH_LATEST_KEYS` |
      </Accordion>

      <Accordion title="Members (1)">
        | Action                 | What it does                                          | Slug                               |
        | ---------------------- | ----------------------------------------------------- | ---------------------------------- |
        | List workspace members | Lists all members of a specified Bitbucket workspace. | `BITBUCKET_LIST_WORKSPACE_MEMBERS` |
      </Accordion>

      <Accordion title="Pipelines (3)">
        | Action                           | What it does                                               | Slug                                         |
        | -------------------------------- | ---------------------------------------------------------- | -------------------------------------------- |
        | Get repositories pipelines steps | Retrieves all steps for a given pipeline.                  | `BITBUCKET_GET_REPOSITORIES_PIPELINES_STEPS` |
        | Get repositories pipelines2      | Retrieve a specified pipeline from a Bitbucket repository. | `BITBUCKET_GET_REPOSITORIES_PIPELINES2`      |
        | List pipelines                   | Find pipelines in a Bitbucket repository.                  | `BITBUCKET_LIST_PIPELINES`                   |
      </Accordion>

      <Accordion title="Projects (1)">
        | Action                  | What it does                                       | Slug                                |
        | ----------------------- | -------------------------------------------------- | ----------------------------------- |
        | List workspace projects | Lists projects in a specified Bitbucket workspace. | `BITBUCKET_LIST_WORKSPACE_PROJECTS` |
      </Accordion>

      <Accordion title="Pull requests (5)">
        | Action                                 | What it does                                                                                                                         | Slug                                               |
        | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------- |
        | Get pull request                       | Get a single pull request by ID with complete details.                                                                               | `BITBUCKET_GET_PULL_REQUEST`                       |
        | Get pull request diffstat              | Get the diffstat for a Bitbucket pull request, showing all changed files with their change statistics (lines added/removed, status). | `BITBUCKET_GET_PULL_REQUEST_DIFFSTAT`              |
        | Get repositories pullrequests statuses | Returns all build statuses (e.g., CI/CD pipeline results) for a specific pull request.                                               | `BITBUCKET_GET_REPOSITORIES_PULLREQUESTS_STATUSES` |
        | Get workspaces pullrequests            | Get all workspace pull requests authored by a specified user.                                                                        | `BITBUCKET_GET_WORKSPACES_PULLREQUESTS`            |
        | List pull requests                     | Lists pull requests in a specified, accessible Bitbucket repository, optionally filtering by state (OPEN, MERGED, DECLINED).         | `BITBUCKET_LIST_PULL_REQUESTS`                     |
      </Accordion>

      <Accordion title="Reports (3)">
        | Action                                      | What it does                                                               | Slug                                                    |
        | ------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------- |
        | Get repositories commit report              | Returns a single report matching the provided ID from a commit.            | `BITBUCKET_GET_REPOSITORIES_COMMIT_REPORT`              |
        | Get repositories commit reports             | Get reports linked to a specific commit.                                   | `BITBUCKET_GET_REPOSITORIES_COMMIT_REPORTS`             |
        | Get repositories commit reports annotations | Returns a single annotation matching the provided ID from a commit report. | `BITBUCKET_GET_REPOSITORIES_COMMIT_REPORTS_ANNOTATIONS` |
      </Accordion>

      <Accordion title="Repositories (12)">
        | Action                                     | What it does                                                                                                                                                                    | Slug                                                   |
        | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
        | Browse repository path                     | Retrieve content for a file path or browse directory contents at a specified revision in a Bitbucket repository.                                                                | `BITBUCKET_BROWSE_REPOSITORY_PATH`                     |
        | Get repositories branching model           | Return the branching model as applied to the repository.                                                                                                                        | `BITBUCKET_GET_REPOSITORIES_BRANCHING_MODEL`           |
        | Get repositories effective branching model | Retrieves the effective branching model for a Bitbucket repository, showing which branching model is currently applied (including any inheritance from project-level settings). | `BITBUCKET_GET_REPOSITORIES_EFFECTIVE_BRANCHING_MODEL` |
        | Get repositories filehistory               | Returns a paginated list of commits that modified the specified file.                                                                                                           | `BITBUCKET_GET_REPOSITORIES_FILEHISTORY`               |
        | Get repositories refs                      | Returns the branches and tags in the repository.                                                                                                                                | `BITBUCKET_GET_REPOSITORIES_REFS`                      |
        | Get repositories src                       | Lists the contents of the root directory on the repository's main branch without needing to specify a commit or branch.                                                         | `BITBUCKET_GET_REPOSITORIES_SRC`                       |
        | Get repository                             | Retrieves detailed information about a specific repository in a Bitbucket workspace.                                                                                            | `BITBUCKET_GET_REPOSITORY`                             |
        | Get repository patch                       | Retrieve the git patch content for a Bitbucket repository at a specified revision or commit range.                                                                              | `BITBUCKET_GET_REPOSITORY_PATCH`                       |
        | Get user permissions repositories          | Returns an object for each repository the caller has explicit access to, including their permission level.                                                                      | `BITBUCKET_GET_USER_PERMISSIONS_REPOSITORIES`          |
        | List repositories                          | Retrieves a paginated list of all public repositories on Bitbucket.                                                                                                             | `BITBUCKET_LIST_REPOSITORIES`                          |
        | List repositories in workspace             | Lists repositories in a specified Bitbucket workspace, accessible to the authenticated user, with options to filter by role or query string, and sort results.                  | `BITBUCKET_LIST_REPOSITORIES_IN_WORKSPACE`             |
        | List repository paths                      | Lists file and directory entries under a repository path at a given revision, with optional breadth-first recursion via max\_depth for repository traversal and scanning.       | `BITBUCKET_LIST_REPOSITORY_PATHS`                      |
      </Accordion>

      <Accordion title="Runners (1)">
        | Action                                    | What it does                                                                       | Slug                                                  |
        | ----------------------------------------- | ---------------------------------------------------------------------------------- | ----------------------------------------------------- |
        | Get repositories pipelines config runners | Retrieves the list of self-hosted runners configured for a repository's pipelines. | `BITBUCKET_GET_REPOSITORIES_PIPELINES_CONFIG_RUNNERS` |
      </Accordion>

      <Accordion title="Schedules (1)">
        | Action                                      | What it does                                                        | Slug                                                    |
        | ------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------- |
        | Get repositories pipelines config schedules | Retrieves configured pipeline schedules for a Bitbucket repository. | `BITBUCKET_GET_REPOSITORIES_PIPELINES_CONFIG_SCHEDULES` |
      </Accordion>

      <Accordion title="Settings (3)">
        | Action                                            | What it does                                                                       | Slug                                                          |
        | ------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------- |
        | Get openid configuration                          | Retrieves the OpenID Connect discovery configuration for Bitbucket Pipelines OIDC. | `BITBUCKET_GET_OPENID_CONFIGURATION`                          |
        | Get repositories pipelines config caches          | Retrieves the repository pipelines caches.                                         | `BITBUCKET_GET_REPOSITORIES_PIPELINES_CONFIG_CACHES`          |
        | Get repositories pipelines config SSH known hosts | Retrieves repository-level SSH known hosts configured for Bitbucket Pipelines.     | `BITBUCKET_GET_REPOSITORIES_PIPELINES_CONFIG_SSH_KNOWN_HOSTS` |
      </Accordion>

      <Accordion title="Snippets (3)">
        | Action             | What it does                                                                                                                    | Slug                           |
        | ------------------ | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
        | Get snippet        | Retrieves a specific Bitbucket snippet by its encoded ID from an existing workspace, returning its metadata and file structure. | `BITBUCKET_GET_SNIPPET`        |
        | Get snippets watch | Checks if the current user is watching a specific snippet.                                                                      | `BITBUCKET_GET_SNIPPETS_WATCH` |
        | List snippets      | Returns all snippets accessible to the authenticated user.                                                                      | `BITBUCKET_LIST_SNIPPETS`      |
      </Accordion>

      <Accordion title="Tags (2)">
        | Action                     | What it does                                                                                                                | Slug                                   |
        | -------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
        | Get repositories refs tags | Retrieves detailed information about a specific tag in a Bitbucket repository.                                              | `BITBUCKET_GET_REPOSITORIES_REFS_TAGS` |
        | List tags                  | Lists tags in a Bitbucket repository with optional server-side filtering by name pattern or commit hash (BBQL) and sorting. | `BITBUCKET_LIST_TAGS`                  |
      </Accordion>

      <Accordion title="Tasks (1)">
        | Action                  | What it does                                                              | Slug                                |
        | ----------------------- | ------------------------------------------------------------------------- | ----------------------------------- |
        | List pull request tasks | Lists all tasks associated with a pull request in a Bitbucket repository. | `BITBUCKET_LIST_PULL_REQUEST_TASKS` |
      </Accordion>

      <Accordion title="Users (2)">
        | Action            | What it does                                                                            | Slug                          |
        | ----------------- | --------------------------------------------------------------------------------------- | ----------------------------- |
        | Get current user2 | Retrieve complete profile information for the currently authenticated Bitbucket user.   | `BITBUCKET_GET_CURRENT_USER2` |
        | Get user          | Retrieves public profile information for a specific Bitbucket user by username or UUID. | `BITBUCKET_GET_USER`          |
      </Accordion>

      <Accordion title="Variables (2)">
        | Action                                      | What it does                                                                                      | Slug                                                    |
        | ------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
        | Get deployment environment variables        | Retrieves deployment environment level variables for a specific Bitbucket repository environment. | `BITBUCKET_GET_DEPLOYMENT_ENVIRONMENT_VARIABLES`        |
        | Get repositories pipelines config variables | Retrieves repository-level pipeline variables for a specific Bitbucket repository.                | `BITBUCKET_GET_REPOSITORIES_PIPELINES_CONFIG_VARIABLES` |
      </Accordion>

      <Accordion title="Versions (1)">
        | Action        | What it does                                                           | Slug                      |
        | ------------- | ---------------------------------------------------------------------- | ------------------------- |
        | List versions | Lists versions (milestones) in a Bitbucket repository's issue tracker. | `BITBUCKET_LIST_VERSIONS` |
      </Accordion>

      <Accordion title="Watchers (1)">
        | Action                    | What it does                                                                | Slug                                  |
        | ------------------------- | --------------------------------------------------------------------------- | ------------------------------------- |
        | Get repositories watchers | Retrieves a paginated list of all the watchers on the specified repository. | `BITBUCKET_GET_REPOSITORIES_WATCHERS` |
      </Accordion>

      <Accordion title="Workspaces (4)">
        | Action                          | What it does                                                                                     | Slug                                        |
        | ------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------- |
        | Get user permissions workspaces | Retrieves workspace memberships and permission levels for the authenticated user.                | `BITBUCKET_GET_USER_PERMISSIONS_WORKSPACES` |
        | Get user workspaces             | Retrieve all workspaces accessible to the authenticated user.                                    | `BITBUCKET_GET_USER_WORKSPACES`             |
        | Get workspace                   | Retrieves detailed information about a specific Bitbucket workspace.                             | `BITBUCKET_GET_WORKSPACE`                   |
        | List workspaces                 | Lists Bitbucket workspaces accessible to the authenticated user, optionally filtered and sorted. | `BITBUCKET_LIST_WORKSPACES`                 |
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Read + write (recommended)">
    Agents can use 105 of the 110 Bitbucket actions at this level: everything in **Read-only**, plus:

    * Create, update, and delete comments
    * Create and update pull requests
    * Create and update variables
    * Create, update, and delete issues
    * Create branches
    * Update reports
    * Create repositories

    The 25 actions that this level adds to **Read-only**:

    | Works on          | Action                                         | What it does                                                                                                                                              | Slug                                                       |
    | ----------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
    | **Branches**      | Create branch                                  | Creates a new branch in a Bitbucket repository from a target commit hash.                                                                                 | `BITBUCKET_CREATE_BRANCH`                                  |
    | **Comments**      | Create issue comment                           | Adds a new comment with markdown support to an existing Bitbucket issue.                                                                                  | `BITBUCKET_CREATE_ISSUE_COMMENT`                           |
    |                   | Create pull request comment                    | Creates a new comment on a Bitbucket pull request.                                                                                                        | `BITBUCKET_CREATE_PULL_REQUEST_COMMENT`                    |
    |                   | Create snippet comment                         | Posts a new top-level comment or a threaded reply to an existing comment on a specified Bitbucket snippet.                                                | `BITBUCKET_CREATE_SNIPPET_COMMENT`                         |
    |                   | Delete commit comment                          | Permanently deletes a specific comment on a commit.                                                                                                       | `BITBUCKET_DELETE_COMMIT_COMMENT`                          |
    |                   | Delete pull request comment                    | Permanently deletes a specific pull request comment (top-level, inline, or threaded reply).                                                               | `BITBUCKET_DELETE_PULL_REQUEST_COMMENT`                    |
    |                   | Resolve pull request comment                   | Resolve or reopen a pull request comment thread.                                                                                                          | `BITBUCKET_RESOLVE_PULL_REQUEST_COMMENT`                   |
    |                   | Update repositories commit comments            | Updates the contents of a comment on a commit.                                                                                                            | `BITBUCKET_UPDATE_REPOSITORIES_COMMIT_COMMENTS`            |
    | **Issues**        | Create issue                                   | Creates a new issue in a Bitbucket repository, setting the authenticated user as reporter.                                                                | `BITBUCKET_CREATE_ISSUE`                                   |
    |                   | Delete issue                                   | Permanently deletes a specific issue, identified by its issue\_id, from the repository specified by repo\_slug within the given workspace.                | `BITBUCKET_DELETE_ISSUE`                                   |
    |                   | Update issue                                   | Updates an existing issue in a Bitbucket repository by modifying specified attributes.                                                                    | `BITBUCKET_UPDATE_ISSUE`                                   |
    | **Pull requests** | Approve pull request                           | Approve a pull request as the authenticated user.                                                                                                         | `BITBUCKET_APPROVE_PULL_REQUEST`                           |
    |                   | Create pull request                            | Creates a new pull request in a specified Bitbucket repository, ensuring the source branch exists and is distinct from the (optional) destination branch. | `BITBUCKET_CREATE_PULL_REQUEST`                            |
    |                   | Decline pull request                           |                                                                                                                                                           | `BITBUCKET_DECLINE_PULL_REQUEST`                           |
    |                   | Merge pull request                             | Merge a Bitbucket Cloud pull request via the REST API.                                                                                                    | `BITBUCKET_MERGE_PULL_REQUEST`                             |
    |                   | Request pull request changes                   | Request changes on a pull request as the authenticated user.                                                                                              | `BITBUCKET_REQUEST_PULL_REQUEST_CHANGES`                   |
    |                   | Update pull request                            | Update an existing pull request's editable fields (e.g., title, description, reviewers) via the Bitbucket Cloud API.                                      | `BITBUCKET_UPDATE_PULL_REQUEST`                            |
    | **Reports**       | Create repositories commit reports annotations | Adds multiple annotations to a commit report in bulk.                                                                                                     | `BITBUCKET_CREATE_REPOSITORIES_COMMIT_REPORTS_ANNOTATIONS` |
    |                   | Update insights projects repos commits reports | Create or update an insight report for a commit.                                                                                                          | `BITBUCKET_UPDATE_INSIGHTS_PROJECTS_REPOS_COMMITS_REPORTS` |
    |                   | Update repositories commit reports annotations | Creates or updates an individual annotation for a commit report.                                                                                          | `BITBUCKET_UPDATE_REPOSITORIES_COMMIT_REPORTS_ANNOTATIONS` |
    | **Repositories**  | Create repository                              | Creates a new Bitbucket 'git' repository in a specified workspace, defaulting to the workspace's oldest project if project\_key is not provided.          | `BITBUCKET_CREATE_REPOSITORY`                              |
    | **Variables**     | Create teams pipelines config variables        | Creates a team-level pipeline configuration variable in Bitbucket.                                                                                        | `BITBUCKET_CREATE_TEAMS_PIPELINES_CONFIG_VARIABLES`        |
    |                   | Create users pipelines config variables        | Creates a user-level pipeline variable for Bitbucket pipelines.                                                                                           | `BITBUCKET_CREATE_USERS_PIPELINES_CONFIG_VARIABLES`        |
    |                   | Update teams pipelines config variables        | Updates a team-level pipeline configuration variable in Bitbucket.                                                                                        | `BITBUCKET_UPDATE_TEAMS_PIPELINES_CONFIG_VARIABLES`        |
    |                   | Update users pipelines config variables        | Updates a user-level pipeline variable for Bitbucket pipelines.                                                                                           | `BITBUCKET_UPDATE_USERS_PIPELINES_CONFIG_VARIABLES`        |
  </Accordion>

  <Accordion title="Full access">
    Agents can use 110 of the 110 Bitbucket actions at this level: everything in **Read + write**, plus:

    * Stop pipelines
    * Delete repositories
    * Delete variables

    The 5 actions that this level adds to **Read + write**:

    | Works on         | Action                                         | What it does                                                                             | Slug                                                       |
    | ---------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
    | **Pipelines**    | Stop pipeline                                  |                                                                                          | `BITBUCKET_STOP_PIPELINE`                                  |
    | **Reports**      | Delete repositories commit reports annotations | Deletes a single annotation matching the provided ID from a commit report.               | `BITBUCKET_DELETE_REPOSITORIES_COMMIT_REPORTS_ANNOTATIONS` |
    | **Repositories** | Delete repository                              | Permanently deletes a specified Bitbucket repository.                                    | `BITBUCKET_DELETE_REPOSITORY`                              |
    | **Snippets**     | Delete snippets watch                          | Stops watching a specific snippet.                                                       | `BITBUCKET_DELETE_SNIPPETS_WATCH`                          |
    | **Variables**    | Delete user pipeline variable                  | Permanently deletes a user-level pipeline configuration variable identified by its UUID. | `BITBUCKET_DELETE_USER_PIPELINE_VARIABLE`                  |
  </Accordion>
</AccordionGroup>

## Connect Bitbucket

Before you start:

* You need a Bitbucket account that you can sign in to.
* Your Squad subscription must be active. Squad does not connect apps while the subscription is not active.

<Steps>
  <Step title="Open Integrations">
    Open **Settings** > **Integrations**.
  </Step>

  <Step title="Add an integration">
    On the **Connected apps** tab, click **+ Add integration**.
  </Step>

  <Step title="Find Bitbucket">
    Find **Bitbucket** in the catalog and click it. You can type the name in **Search the catalog…**.
  </Step>

  <Step title="Choose an access level">
    Under **Default scope**, choose an access level. This level applies to every agent.
  </Step>

  <Step title="Click Connect Bitbucket">
    Click **Connect Bitbucket**. The Bitbucket sign-in page opens in a new tab.
  </Step>

  <Step title="Sign in to Bitbucket">
    Sign in to Bitbucket and approve the request.
  </Step>
</Steps>

Check that it works: Bitbucket shows under **YOUR CONNECTIONS**, with a row for the account and its access level.

## Change the access level

1. Under **YOUR CONNECTIONS**, find the Bitbucket account.
2. Open the account menu (⋯) and click **Manage scope**.
3. Under **Default scope**, choose the new level.
4. Click **Save access**.

The change does not need a new sign-in. Agents get the new level from their next call.

## Set access for one agent

Every agent uses the account's level unless you set something else for it. You can narrow one agent to a lower level, or block it.

1. Under **YOUR CONNECTIONS**, open the account menu (⋯) on the Bitbucket account.
2. Click **Manage scope**.
3. Under **Per-agent access**, find the agent.
4. Choose the **Default** option to follow the account's level, choose a lower level, or choose **No access**.
5. Click **Save access**.

An agent never gets more than the account's level, even if you choose a higher level for it. Changes apply from the agent's next call. An agent with **No access** does not see the account.

## Use more than one Bitbucket account

Click **+ Account** on the Bitbucket card to connect another account. Agents use the primary account unless they are asked to use a specific one.

* After you click **+ Account**, follow the connect steps above.
* Each account has its own access level.
* The first account you connect becomes the primary account. It shows **★ PRIMARY**.
* To change the primary account, open the account menu (⋯) and click **Make primary**.
* To tell accounts apart, open the account menu (⋯) and click **Rename**.

## Reconnect or disconnect

Reconnect when the connection has expired, or when you need to change what the account can reach on the Bitbucket side:

1. Open the account menu (⋯) and click **Reconnect**.
2. Click **Reauthorize on Bitbucket**.
3. Sign in to Bitbucket and approve the request.

Reconnect signs in to the same account again. It does not add a second connection.

Open the account menu (⋯) on the Bitbucket account and click **Disconnect**. Agents lose access to that account at once.

<Warning>**Disconnect** acts at once, with no confirmation step. If it was the primary account, another connected Bitbucket account becomes primary.</Warning>

## Costs

Bitbucket actions do not use Squad credits. Connected apps never use credits. For what does use credits, see [What Squad costs](/docs/costs).

## Troubleshooting

An agent reports that an action is not allowed on this account.

* Cause: the action is outside the account's access level, or outside the level you set for that agent.
* Fix: choose a higher level in **Manage scope**, or change the agent's row under **Per-agent access**.

An agent says it has no access to Bitbucket, or it does not see the account.

* Cause: the agent is set to **No access** under **Per-agent access**, or the account is not connected.
* Fix: open **Manage scope** and change the agent's row. If the account is missing, connect it again.

Connecting or saving fails with "Your subscription isn't active."

* Cause: your Squad subscription is not active.
* Fix: resubscribe. See [Manage your subscription](/docs/billing).

An agent says the Bitbucket connection has expired.

* Cause: the sign-in for that account is no longer valid.
* Fix: use **Reconnect** on the account.

## Common questions

<AccordionGroup>
  <Accordion title="Can I limit what agents can do in Bitbucket?">
    Each Bitbucket account has an access level: **Read-only**, **Read + write**, and **Full access**. Squad refuses any agent action outside that level. You can also narrow or block single agents under **Per-agent access**.
  </Accordion>

  <Accordion title="Can I connect more than one Bitbucket account?">
    Click **+ Account** on the Bitbucket card to connect another account. Agents use the primary account unless they are asked to use a specific one.
  </Accordion>

  <Accordion title="How do I disconnect Bitbucket?">
    Open the account menu (⋯) on the Bitbucket account and click **Disconnect**. Agents lose access to that account at once.
  </Accordion>
</AccordionGroup>

## Related pages

<CardGroup cols={2}>
  <Card title="Connect apps" icon="plug" href="/docs/integrations" />

  <Card title="Add an MCP server or an API key" icon="server" href="/docs/custom-integrations">
    Use this when an action you need is not in this app.
  </Card>
</CardGroup>
