HELIOS DOCS

Bitbucket

Connect agents to the Bitbucket Cloud REST API and start workflows on supported pull request, comment, push, build status, repository, and Pipelines trace events.

What your agents can do

Helios indexes the Bitbucket Cloud REST API, so agents search it at run time and call the endpoints the credential allows. The credential is attached server-side.

  • Open pull requests, and review, comment on, approve, decline, or merge them
  • Read diffs, commits, branches, and files at any ref
  • Check build statuses and Bitbucket Pipelines runs, steps, and logs, and run or stop pipelines
  • Create branches and tags, and report build statuses
  • With admin permissions, manage repository and project settings, branch restrictions, default reviewers, and Pipelines variables

Agents can send JSON and multipart request bodies, including file uploads. Bitbucket removed its issue tracker and wikis on August 20, 2026, so there are no issue or wiki endpoints or events.

Authentication

MethodTypeDescription
Atlassian API TokenAPI KeyAn API token with Bitbucket scopes, sent with your account email
Bitbucket Access TokenAPI KeyA workspace, project, or repository access token
Your own Bitbucket OAuth appOAuth 2.0An OAuth consumer you create in your Bitbucket workspace

Every method asks for two more fields:

  • Workspace ID is the first part of your Bitbucket URLs, as in bitbucket.org/<workspace ID>.
  • Repository is optional. Leave it empty to use the whole workspace. To use one repository, enter its slug, as in bitbucket.org/<workspace ID>/<repository slug>. Helios then tests the connection against that repository and registers the webhook there. Project and repository access tokens need it to connect.

Bitbucket stopped accepting app passwords on July 28, 2026, so Helios does not offer them. See Integration authentication for how credentials are stored and injected.

Each method below lists the permissions for full access, and names the ones Helios itself needs after the table. Permissions marked admin grant administration rights, such as editing branch restrictions or deleting projects. An API token or OAuth app only gets them where its account is an admin.

Atlassian API Token

You need a Bitbucket account in the workspace. For triggers with Repository empty, the account must be a workspace admin. With Repository set, it must be an admin of that repository.

  1. In Bitbucket, select your avatar, then Account settings, and open the Security tab.
  2. Select Create and manage API tokens, then Create API token with scopes.
  3. Enter a name and an expiry date, and select Next. Choose Bitbucket as the app, and select Next.
  4. Select the scopes below, then select Next and Create token. Copy the token.
  5. In Helios, choose Atlassian API Token. Enter the token in API Token, your Atlassian account's email in Atlassian Account Email, and the workspace in Workspace ID. Optional: enter a repository slug in Repository.
  6. Save.
PermissionScopesWhat it allows
Repositoriesread:repository:bitbucket, write:repository:bitbucket, admin:repository:bitbucket (admin), delete:repository:bitbucketRead and change code, branches, tags, and build statuses. Admin creates repositories and edits branch restrictions and default reviewers. Delete removes repositories
Pull requestsread:pullrequest:bitbucket, write:pullrequest:bitbucketRead and comment on pull requests. Write opens, updates, approves, declines, and merges them
Projectsread:project:bitbucket, admin:project:bitbucket (admin)Read projects. Admin creates, updates, and deletes them
Workspacesread:workspace:bitbucket, admin:workspace:bitbucket (admin)Read the workspace and its members. Admin updates the workspace
Userread:user:bitbucket, write:user:bitbucketRead and update the token owner's account
Pipelinesread:pipeline:bitbucket, write:pipeline:bitbucket, admin:pipeline:bitbucket (admin)Read runs, steps, and logs. Write starts and stops pipelines. Admin manages Pipelines variables
Runnersread:runner:bitbucket, write:runner:bitbucketRead and manage Pipelines runners
Webhooksread:webhook:bitbucket, write:webhook:bitbucket, delete:webhook:bitbucketRead, register, and remove webhooks
Snippetsread:snippet:bitbucket, write:snippet:bitbucket, delete:snippet:bitbucketRead, create, and delete snippets
SSH keysread:ssh-key:bitbucket, write:ssh-key:bitbucket, delete:ssh-key:bitbucketRead and manage SSH keys and deploy keys
GPG keysread:gpg-key:bitbucket, write:gpg-key:bitbucket, delete:gpg-key:bitbucketRead and manage GPG keys
Permissionsread:permission:bitbucket, write:permission:bitbucket, delete:permission:bitbucketRead and change repository and project permissions

Helios itself uses read:workspace:bitbucket to test the connection when Repository is empty, and read:repository:bitbucket when it is set. It uses the three webhook scopes to register and remove the Helios webhook. The pull request, pipeline, and project events also need read:pullrequest:bitbucket, read:pipeline:bitbucket, and read:project:bitbucket.

An API token expires after at most one year, and its scopes can't be changed. Before it expires, or to add scopes, create a new token and enter it through Manage. Bitbucket records every change made with the token as the account that owns it.

Bitbucket Access Token

Repository access tokens work on every plan. Workspace and project access tokens need Bitbucket Premium.

  1. Open the settings for the token's scope:
    • Repository: select More actions (…) next to the repository name, then Settings → Security → Access tokens.
    • Project: select More actions (…) on the project, then Settings → Security → Access tokens.
    • Workspace: select the settings cog, then Workspace settings → Security → Access tokens.
  2. Select Create access token, enter a name, and choose an expiry.
  3. Select every permission below that the token type offers. Then create the token and copy it.
  4. In Helios, choose Bitbucket Access Token. Enter the token in Access Token and the workspace in Workspace ID.
  5. For a project or repository access token, enter a repository slug in Repository. These tokens only reach their own project or repository, and without it Helios tests the connection against the whole workspace.
  6. Save.
PermissionLevelsScopesToken types
RepositoriesRead, Write, Admin (admin), Deleterepository, repository:write, repository:admin, repository:deleteAll
Pull requestsRead, Writepullrequest, pullrequest:writeAll
WebhooksRead and writewebhookAll
PipelinesRead, Write, Edit variablespipeline, pipeline:write, pipeline:variableAll
RunnersRead, Writerunner, runner:writeAll
ProjectsReadprojectProject, workspace
ProjectsAdmin (admin)project:adminWorkspace
AccountReadaccountWorkspace

Helios itself needs Repositories Read and Webhooks Read and write. The pull request and pipeline events also need Pull requests Read and Pipelines Read, and the project event needs Projects Read.

Bitbucket's docs don't say whether a workspace access token can register a workspace webhook. If no webhook appears, set Repository to register it on one repository. Access token permissions can't be changed after creation. If the token has an expiry date, or you need more permissions, create a new token and enter it through Manage.

Your own Bitbucket OAuth app

You need to be a workspace admin to add an OAuth consumer.

  1. In Bitbucket, select the settings cog, then Workspace settings → Apps and features → OAuth consumers, and select Add consumer.

  2. Enter a Name, and set Callback URL to:

    https://api.heliosapp.com/integrations/bitbucket/oauth_callback
  3. Under Permissions, select every permission below.

  4. Select Save. Select the consumer's name to show its Key and Secret.

  5. In Helios, choose Your own Bitbucket OAuth app. Enter the key in OAuth Consumer Key, the secret in OAuth Consumer Secret, and the workspace in Workspace ID. Optional: enter a repository slug in Repository.

  6. Save, then approve access in Bitbucket.

PermissionLevelsScopes
AccountEmail, Read, Writeemail, account, account:write
ProjectsRead, Admin (admin)project, project:admin
RepositoriesRead, Write, Admin (admin), Deleterepository, repository:write, repository:admin, repository:delete
Pull requestsRead, Writepullrequest, pullrequest:write
SnippetsRead, Writesnippet, snippet:write
WebhooksRead and writewebhook
PipelinesRead, Write, Edit variablespipeline, pipeline:write, pipeline:variable
RunnersRead, Writerunner, runner:write

Helios itself needs Repositories Read and Webhooks Read and write. The pull request and pipeline events also need Pull requests Read and Pipelines Read, and the project event needs Projects Read.

Helios doesn't ask for scopes, and there is no Admin access option for this method. Bitbucket gives every token exactly the permissions set on the consumer, so change them there, then click Re-connect. Agents act as the person who approved access, and the admin permissions only work where that person is an admin. For a workspace webhook, that person must be a workspace admin. Otherwise, set Repository to a repository they administer.

Helios renews access tokens with the refresh token. A refresh token that isn't used for three months expires. If that happens, open the connection and click Re-connect.

Triggers

Bitbucket can start a Workflow when something happens in your repositories. Helios registers a webhook titled Helios when you save the connection, so there is nothing to paste into Bitbucket. The webhook subscribes to the events below that its credentials and repository setting allow. Deleting the connection removes the webhook.

  • With Repository empty, Helios registers one workspace webhook. It covers every repository in the workspace, including ones created later. Bitbucket only lets workspace admins create workspace webhooks.
  • With Repository set, Helios registers the webhook on that repository only. This needs admin access to the repository. Bitbucket sends repository.created, repository.imported, repository.transferred, repository.deleted, and project.updated only to workspace webhooks, so the trigger picker shows them as unavailable.

Bitbucket only lets a webhook subscribe to an event when the credential can read what the event is about. If the credential lacks Pull requests Read, Pipelines Read, or Projects Read, Helios subscribes to the other events and the trigger picker shows the refused ones as unavailable. Add the permission, or create a new token with it, and save the connection again.

Setting Repository on a connection that had a workspace webhook removes that webhook. Any other change to Workspace ID or Repository on a saved connection leaves the old webhook in Bitbucket. Create a new connection and delete the old one instead.

EventDescriptionFilters
pull_request.createdA pull request was createdrepository, destination branch (pattern)
pull_request.updatedA pull request was updated, including new commits on its branchrepository, destination branch (pattern)
pull_request.approvedA pull request was approvedrepository, destination branch (pattern)
pull_request.unapprovedAn approval was removed from a pull requestrepository, destination branch (pattern)
pull_request.changes_requestedSomeone requested changes on a pull requestrepository, destination branch (pattern)
pull_request.changes_request_removedA request for changes was removed from a pull requestrepository, destination branch (pattern)
pull_request.mergedA pull request was mergedrepository, destination branch (pattern)
pull_request.declinedA pull request was declinedrepository, destination branch (pattern)
pull_request_comment.createdA comment was added to a pull requestrepository, destination branch (pattern)
pull_request_comment.updatedA comment on a pull request was editedrepository, destination branch (pattern)
pull_request_comment.deletedA comment on a pull request was deletedrepository, destination branch (pattern)
pull_request_comment.resolvedA comment on a pull request was resolvedrepository, destination branch (pattern)
pull_request_comment.reopenedA resolved comment on a pull request was reopenedrepository, destination branch (pattern)
repository.pushedCommits, branches or tags were pushed to a repositoryrepository, branch (pattern), tag (pattern)
repository.forkedA repository was forkedrepository
repository.updatedA repository's name, description, website or language changedrepository
repository.createdA repository was created in the workspacenone
repository.importedA repository was imported into the workspacenone
repository.transferredA repository transfer was acceptedrepository
repository.deletedA repository was permanently deletedrepository
commit_comment.createdA comment was added to a commitrepository
build_status.createdA build reported a status on a commit, such as a Bitbucket Pipelines runrepository, branch (pattern), build state, build name (pattern)
build_status.updatedA build status on a commit changedrepository, branch (pattern), build state, build name (pattern)
pipeline_span.createdA finished Bitbucket Pipelines run sent a trace span for the run, a step, a container or a logrepository, branch (pattern), span name (pattern)
project.updatedA project's settings changednone

Every filter is optional. Patterns are case-sensitive.

  • Repository lists the workspace's repositories, or only the one set on the connection. Choose one or more. An event without a repository, such as project.updated, never matches it.
  • Destination branch matches the branch a pull request merges into, such as main or release/*.
  • Branch matches any branch a push created, updated, or deleted, the branch a build ran on, or the branch a pipeline ran on. A build status that doesn't name a branch never matches it.
  • Tag matches any tag a push created, moved, or deleted, such as v*.
  • Build state is one or more of Successful, Failed, In progress, and Stopped.
  • Build name matches the build's name, such as Unit tests*.
  • Span name matches the name of a trace span, such as bbc.pipeline_run.

Some notes on specific events:

  • Bitbucket Pipelines reports a build as In progress first, then updates it. For failed Pipelines builds, use build_status.updated with Build state set to Failed. A build system that reports a failed status straight away sends build_status.created instead.
  • A finished Pipelines run sends spans for the run and for its steps, containers, and logs. Set Span name to bbc.pipeline_run to start one run for each pipeline run.
  • repository.deleted arrives when Bitbucket permanently deletes the repository, which can be up to 30 days after someone deletes it.
  • New commits on a pull request's branch arrive as pull_request.updated, whether they were pushed with git or committed through the API. Helios does not offer the separate pull request push event.
  • A comment edited through the API may not send pull_request_comment.updated.

Deliveries are verified with the HMAC-SHA256 X-Hub-Signature header. Bitbucket sends no delivery timestamp, so Helios drops repeated deliveries by their X-Request-UUID instead. Bitbucket sends a delivery again, up to two more times, when Helios answers with a server error.

An agent that comments on a pull request can start another pull_request_comment.created run. An agent that opens, approves, or declines a pull request can start the matching pull_request event. One that creates a branch or tag can start repository.pushed, and one that reports a build status can start build_status.created. Say in the prompt which events to ignore, such as comments the agent wrote. See Guarding against events you don't want.

Check that it works

  • The connection: after you save, the connection's status shows Connected. Error means Bitbucket rejected the credential or couldn't find the workspace or repository. Click Test Connection to check again.
  • The webhook: for a repository webhook, select More actions (…) next to the repository name, then Settings, then Webhooks under Workflow. A webhook titled Helios should be listed. View requests shows its deliveries after you select Enable history. Bitbucket's docs describe no page that lists workspace webhooks, so check a workspace webhook with a test event.
  • A trigger:
    1. Add pull_request.created to a workflow with no filters.
    2. Open a test pull request.
    3. Check that a run starts. Then open the connection in Helios and click Webhook events to see the event.

Common errors

What you seeCauseFix
The connection's status shows ErrorThe token expired or was revoked, Workspace ID or Repository is wrong, or the token lacks read:workspace:bitbucket or read:repository:bitbucketCheck the IDs against your Bitbucket URLs, or create a new token with the scopes above
Error with a project or repository access tokenRepository is emptyEnter a repository slug in Repository
Error after you entered an app passwordBitbucket no longer accepts app passwordsCreate an API token with scopes, and enter it in API Token
Approve access in Bitbucket to finish connectingAccess wasn't approved in BitbucketOpen the connection and click Re-connect
Some events show as unavailable in the trigger pickerRepository is set, and the event is sent only to workspace webhooks. Or the credential lacks the permission the event needsLeave Repository empty, or add the permission named in the picker. Then save the connection again
No Helios webhook, and no runs startWith Repository empty, the account isn't a workspace admin. With it set, the account isn't a repository admin. Or the token lacks the webhook scopes or Repositories ReadUse an admin's credential with the webhook scopes, or set Repository to a repository the account administers. Then save the connection again
An old Helios webhook stays after you change the workspace or repositoryHelios only removes webhooks for the current workspace and repositoryDelete the old webhook in Bitbucket, or create a new connection and delete the old one
No run starts, but the webhook is listedThe filters don't match the eventRemove the filters, check that a run starts, then add them back one at a time

Limits

Bitbucket Cloud counts authenticated requests per user over a rolling hour. Most repository data allows 1,000 requests an hour, and webhook calls allow 1,000 an hour. Requests over a limit get 429 Too Many Requests. See Bitbucket's API request limits. A repository can have up to 50 webhooks.

Workspaces on the Free plan can't use snippets or the repository's Downloads section, and Bitbucket answers those calls with 402 Payment Required. They need the Standard or Premium plan. See changes to Bitbucket Cloud's free plan.

Last updated on