Skip to main content

Creating a scoped API token

An API token acts with the Bitbucket permissions of the Atlassian account that creates it, so sign in as the account the connection should use.

1

Start a scoped API token

Sign in to your Atlassian account to open the API Tokens page.

  • Click Create API token with scopes.
The Atlassian API Tokens page with the Create API token with scopes button highlighted
2

Name the token

On the Name API token screen, fill in the token details.

  • Name: StackOne Integration
  • Expires on: The date the token should stop working
  • Click Next.
The Name API token screen with the Name and Expires on fields and the Next button highlighted
3

Select Bitbucket

On the Select the app screen, choose the app the token can reach.

  • Select API token app: Bitbucket
  • Click Next.
The Select the app screen with Bitbucket selected and the Next button highlighted
4

Select the scopes

Enables actions: Add Default Reviewer, Approve Commit, Approve Pull Request, Create Branch Restrictions, Create Branches, Create Build, Create Comments, Create Commits, Create Deploy Key, Create Deploy Keys, Create Environment, Create Pipelines, Create Project, Create Pullrequests, Create Repository, Create Schedules, Create Src, Create Ssh Keys, Create Variables, Decline Pull Request, Delete Branch Restrictions, Delete Comments, Delete Default Reviewer, Delete Default Reviewers, Delete Deploy Key, Delete Deploy Keys, Delete Project, Delete Reports, Delete Repository, Delete Schedules, Delete Ssh Keys, Delete Variables, Get Authenticated User, Get Branch Restrictions, Get Branches, Get Branching Model, Get Branching Model Settings, Get Build, Get Comments, Get Commit, Get Default Reviewer, Get Default Reviewers, Get Deploy Key, Get Deploy Keys, Get Deployment, Get Diff, Get Diffstat, Get Environment, Get Log, Get Logs, Get Patch, Get Pipelines, Get Pipelines Config, Get Project, Get Project Branching Model Settings, Get Pullrequests, Get Reports, Get Repository, Get SSH Key, Get Schedules, Get Src, Get Steps, Get Unified Credentials, Get Unified Organization, Get Unified Role, Get Unified User, Get User, Get Variables, Get Workspace, List Branch Restrictions, List Branches, List Branching Model, List Comments, List Commits, List Default Reviewers, List Deploy Keys, List Deployments, List Downloads, List Environments, List Forks, List Permissions, List Pipelines, List Projects, List Pull Request Commits, List Pullrequests, List Reports, List Repositories In Workspace, List Repository Groups, List Repository Permissions, List Schedules, List Src, List Ssh Keys, List Statuses, List Steps, List Unified Organizations, List Unified Resource Types, List Unified Resource Users, List Unified Roles, List Unified Users, List User Repository Permissions, List Variables, List Watchers, List Workspace Members, List Workspace Repository Permissions, List Workspaces, 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 Default Reviewer, Update Deploy Keys, Update Environment, Update Pipelines Config, Update Project, Update Pullrequests, Update Reports, Update Schedules, Update Settings, Update Ssh Keys, Update Variables

On the Select Bitbucket scopes screen, tick every scope listed. Use Search by scope name to find each one. To receive webhook events, also tick read:webhook:bitbucket, write:webhook:bitbucket and delete:webhook:bitbucket.

  • Click Next.
The Select Bitbucket scopes screen with ticked scope checkboxes and the Next button highlighted
5

Create the token

On the Review your API token screen, check the name, expiry and scopes.

  • Click Create token.
The Review your API token screen with the Create token button highlighted
6

Copy the token

On the Copy API token screen, the token is shown only once and cannot be retrieved later.

  • Click Copy.
  • Copy the API token across.
  • Your Email is the email address of the Atlassian account you signed in with.
  • New tokens may take up to a minute to work after they’ve been created.
The Copy API token screen with the token value hidden and the Copy button highlighted
7

Find the Webhook Workspace

Only needed to receive webhook events. Your Webhook Workspace is the workspace slug in the address bar when you open the workspace in Bitbucket. The account that created the token must be an administrator of this workspace.

  • Format: https://bitbucket.org/{workspace}/
  • Example: if your URL is https://bitbucket.org/acme-dev/, your Webhook Workspace is acme-dev
1

Connect

  • Click Connect.
  • If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider’s authorization flow.
  • Once authorization is successful, you will see a confirmation popup.
2

Use Actions

Connect an AI platform to the linked account’s actions. See AI Platforms.Other ways to call actions are listed in Protocols & SDKs.

Next Steps

Webhooks setup

Configure receiving Events for Bitbucket into StackOne.