Skip to main content

Bitbucket

Bitbucket is a Git-based source code repository hosting service for collaborative software development, code review, and CI/CD pipelines.

Authentication Types

Bitbucket supports 3 authentication methods:

  • OAuth - Create your own Bitbucket OAuth app with custom scopes. Every user connects with their Bitbucket account.

    • Pros: Full control, per-user tracking, production-ready
    • Cons: ~2 min setup
  • API Key - Use your Atlassian account email and API token for authentication.

    • Pros: Easy setup
    • Cons: Single credential for all users
  • API Key Per User - Each user provides their own Atlassian account email and API token.

    • Pros: Per-user tracking, better security
    • Cons: Each user needs to set up their own credentials

General Settings

Before using the connector, you need to configure:

  • Bitbucket Workspace - Your Bitbucket workspace slug

Setting up OAuth

  1. Go to your Bitbucket workspace settings at https://bitbucket.org/{workspace}/workspace/settings/api
  1. Click Add consumer
  1. Fill in the OAuth consumer details:
    • Name: Give it a descriptive name (e.g., "Webrix Integration")
    • Callback URL: Copy the Redirect URL from Webrix and paste it here
    • URL: Your organization's website (optional)
  1. Select the permissions (scopes) you need:
    • Repositories: Read and write access
    • Pull requests: Read and write access
    • Pipelines: Read and write access
    • Account: Read account information
    • Team: Read team information
    • Webhooks: Manage webhooks
  1. Click Save

  2. Copy the Key (Client ID) and Secret (Client Secret)

  1. In Webrix, paste the Client ID and Client Secret

  2. Enter your Workspace in General Settings

  3. Click Save Changes

Generating an API Key (API Token)

  1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
  1. Click Create API token
  1. Give your token a descriptive label (e.g., "Webrix Integration")

  2. Select the scopes you need:

    • Repositories: Read and write
    • Pull requests: Read and write
    • Pipelines: Read and write
    • Workspaces: Read
  1. Click Create

  2. Copy the generated token immediately (it won't be shown again)

  1. In Webrix, enter the API key in the format: email:api_token
    • Example: [email protected]:ATATTxxxxxxxxxxxxx
    • Note: Use your Atlassian account email, not your Bitbucket username
    • The API key will be Base64 encoded automatically as Basic {encoded_credentials}

Available Scopes

The Bitbucket connector provides access to the following scopes:

  • repository: Read repository information
  • repository:write: Write access to repositories
  • pullrequest: Read pull requests
  • pullrequest:write: Create and update pull requests
  • pipeline: Read pipeline information
  • pipeline:write: Trigger and manage pipelines
  • account: Read account information
  • team: Read team/workspace information
  • webhook: Manage webhooks for repositories

For more information about Bitbucket permissions, refer to the Bitbucket API documentation.