Sazabi
Integrations

Bitbucket

Connect a Bitbucket workspace so the Sazabi agent can search your code during investigations.

About

Connecting Bitbucket gives the Sazabi agent read access to the repositories in a Bitbucket workspace, so it can search source and correlate errors with code while investigating. Bitbucket is a forge integration.

The agent can:

  • Search and read source files across the workspace's repositories.
  • Cross-reference stack traces and errors with the code that produced them.

Prerequisites

  • A Bitbucket workspace and its workspace slug.
  • A Bitbucket workspace access token with read access to the repositories.
  • Organization admin access in Sazabi.

Set up in the dashboard

Create a workspace access token in Bitbucket

In Bitbucket, create a workspace access token scoped to read the repositories you want Sazabi to search. Copy the token — Bitbucket shows it once.

Enter the workspace and token

Provide the Workspace slug and paste the Workspace access token, then connect. Sazabi validates the token against the Bitbucket API before saving.

Set up with the CLI

You can also connect Bitbucket with the Sazabi CLI (installed and authenticated — see CLI reference).

Bitbucket is an API-key provider with two credential fields: the workspace slug and an apiToken (the workspace access token). Read the token from an environment variable rather than pasting it inline:

export BITBUCKET_WORKSPACE_TOKEN=...   # your Bitbucket workspace access token
sazabi integrations connect bitbucket \
  --credentials "{\"workspace\":\"your-workspace-slug\",\"apiToken\":\"$BITBUCKET_WORKSPACE_TOKEN\"}"

Sazabi validates the token against the Bitbucket API before saving, the same as the dashboard path. Run sazabi integrations list to confirm the connection, or sazabi integrations providers --json to see each provider's credential fields.

Once Bitbucket is connected and its repositories are mapped to a project, the Sazabi agent searches and reads those repositories to trace an error to the exact file and line during an investigation — cross-referencing a stack trace with the source that produced it. See Agent tools.

Automated code review

Sazabi can review pull requests on Bitbucket with inline comments and a verdict. Enable it with the per-project master switch under Settings > Code, then turn on this integration's own review toggle; request a review on demand by commenting @Sazabi review on a pull request.

See Set up automated code review for the full behavior — re-review on new commits, the on-demand request, and agent-opened pull requests.

Ask the agent from a pull request

Bitbucket is also an agent surface — a place you can start an agent thread and read its response without leaving Bitbucket. Mention @Sazabi in a pull request comment with any request, and the agent investigates using your connected repositories and project data, then replies in the same comment thread. Keep replying in that thread to continue the conversation. This is separate from automated code review, which runs on its own.

Connected account

You can also connect your personal Bitbucket account under Settings > Connected accounts so the agent acts as you at Bitbucket. When you have a personal connection Sazabi uses it first and falls back to this organization integration otherwise. See Connected accounts.

Verify

Open Settings > Integrations > Bitbucket and confirm the connection reads connected for your workspace. Then ask the agent, in a thread for the project the workspace is mapped to, to find a file or symbol you know exists in one of the workspace's repositories — it should return the file. If nothing is found, confirm the token has read access to that repository.

Troubleshooting

Token rejected on connect — Confirm the workspace slug matches the token's workspace and that the token has repository read scope. Sazabi validates the token when you connect, so a rejection means the credential or scope is wrong.

Connection shows needs attention — The workspace access token may have expired or been revoked in Bitbucket. Create a new token and reconnect.

Further reading