Bitbucket

App · Code Repositories · 17 actions

Browse Bitbucket repositories, branches and commits, manage branches, open, review, comment on, merge or decline pull requests, and start a workflow on a new pull request or commit, with an Atlassian API token.

Actions

ActionWhat it does
Approve pull requestApprove a pull request as the connected account.
Comment on pull requestPost a comment on a pull request as the connected account.
Create branchCreate a new branch in a repository.
Create pull requestOpen a pull request from one branch into another (the repository's main branch unless you choose one), as the connected account.
Decline pull requestDecline (close without merging) a pull request.
Delete branchDelete a branch from a repository.
Get current userGet the Atlassian account whose API token is connected.
Get pull requestGet one pull request's title, description, state and branches.
Get repositoryGet one repository's details: its name, description, main branch, whether it's private and its link.
List branchesList a repository's branches, most recently committed to first, up to 100.
List commitsList the newest commits on a branch, or on every branch, newest first.
List pull request commentsList the comments on a pull request, oldest first.
List pull requestsList a repository's pull requests, most recently updated first.
List repositoriesList the repositories in a workspace that the connected account can access, most recently updated first.
Merge pull requestMerge a pull request into its target branch.
Remove approvalTake back the connected account's approval of a pull request.
Update pull requestChange a pull request's title, description or the branch it goes into.

Approve pull request

Approve a pull request as the connected account. Bitbucket doesn't let you approve a pull request you opened.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Pull request numberpull_request_idnumberRequired
The pull request's number, as shown in its link (.../pull-requests/7) or returned by List pull requests.At least 1.

Outputs

approvedtrue/false
Whether it's approved
approved_bytext
Who approved it
pull_request_idnumber
The pull request approved
Example output
{
  "approved": true,
  "approved_by": "Octo Bit",
  "pull_request_id": 7
}

Comment on pull request

Post a comment on a pull request as the connected account. Everyone who can see the repository can read it.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Pull request numberpull_request_idnumberRequired
The pull request's number, as shown in its link (.../pull-requests/7) or returned by List pull requests.At least 1.
CommenttexttextRequired
What the comment says. Markdown works.

Outputs

authortext
Who wrote it
created_ontext
When it was posted
html_urltext
Link to the comment on bitbucket.org
idnumber
The comment's ID
texttext
What the comment says
Example output
{
  "author": "Octo Bit",
  "created_on": "2026-07-30T12:30:00.000000+00:00",
  "html_url": "https://bitbucket.org/my-team/hello-world/pull-requests/7#comment-412345678",
  "id": 412345678,
  "text": "Looks good to me."
}

Create branch

Create a new branch in a repository. Points the new branch at the tip of an existing branch (defaults to the repository's main branch) unless you supply a specific commit hash.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
New branch namenametextRequired
The name for the new branch (without any 'refs/heads/' prefix).
Source branchfrom_branchtext
The existing branch to base the new one on. Defaults to the repository's main branch when not set.
Source commit hashcommit_hashtext
A specific commit hash to point the new branch at. Takes precedence over the source branch when provided.

Outputs

hashtext
html_urltext
nametext
Example output
{
  "hash": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
  "html_url": "https://bitbucket.org/my-team/hello-world/branch/feature/new-widget",
  "name": "feature/new-widget"
}

Create pull request

Open a pull request from one branch into another (the repository's main branch unless you choose one), as the connected account.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
TitletitletextRequired
The pull request's title.
From branchsource_branchtextRequired
The branch with the changes.
Into branchdestination_branchtext
Optional. The branch the changes go into. Leave blank for the repository's main branch.
Descriptiondescriptiontext
Optional. What the changes are and why.
Delete the branch once mergedclose_source_branchtrue/false
Whether to delete the source branch when it's merged.

Outputs

authortext
Who opened it
close_source_branchtrue/false
Whether the source branch is deleted once it's merged
comment_countnumber
How many comments it has
created_ontext
When it was opened
descriptiontext
The pull request's description
destination_branchtext
The branch the changes go into
html_urltext
Link to the pull request on bitbucket.org
idnumber
The pull request's number
merge_committext
The commit it was merged as, once merged; otherwise empty
source_branchtext
The branch with the changes
statetext
OPEN, MERGED, DECLINED or SUPERSEDED
titletext
The pull request's title
updated_ontext
When it last changed
Example output
{
  "author": "Octo Bit",
  "close_source_branch": true,
  "comment_count": 0,
  "created_on": "2026-07-30T11:00:00.000000+00:00",
  "description": "Adds the widget to the home page.",
  "destination_branch": "main",
  "html_url": "https://bitbucket.org/my-team/hello-world/pull-requests/7",
  "id": 7,
  "merge_commit": "",
  "source_branch": "feature/new-widget",
  "state": "OPEN",
  "title": "Add new widget",
  "updated_on": "2026-07-30T12:00:00.000000+00:00"
}

Decline pull request

Decline (close without merging) a pull request.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Pull request numberpull_request_idnumberRequired
The pull request's number, as shown in its link (.../pull-requests/7) or returned by List pull requests.At least 1.

Outputs

authortext
Who opened it
close_source_branchtrue/false
Whether the source branch is deleted once it's merged
comment_countnumber
How many comments it has
created_ontext
When it was opened
descriptiontext
The pull request's description
destination_branchtext
The branch the changes go into
html_urltext
Link to the pull request on bitbucket.org
idnumber
The pull request's number
merge_committext
The commit it was merged as, once merged; otherwise empty
source_branchtext
The branch with the changes
statetext
OPEN, MERGED, DECLINED or SUPERSEDED
titletext
The pull request's title
updated_ontext
When it last changed
Example output
{
  "author": "Octo Bit",
  "close_source_branch": true,
  "comment_count": 1,
  "created_on": "2026-07-30T11:00:00.000000+00:00",
  "description": "Adds the widget to the home page.",
  "destination_branch": "main",
  "html_url": "https://bitbucket.org/my-team/hello-world/pull-requests/7",
  "id": 7,
  "merge_commit": "",
  "source_branch": "feature/new-widget",
  "state": "DECLINED",
  "title": "Add new widget",
  "updated_on": "2026-07-30T12:00:00.000000+00:00"
}

Delete branch

Delete a branch from a repository.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Branch namenametextRequired
The name of the branch to delete (without any 'refs/heads/' prefix).

Outputs

deletedtrue/false
nametext
Example output
{
  "deleted": true,
  "name": "feature/old-widget"
}

Get current user

Get the Atlassian account whose API token is connected. Useful for verifying the connected account works.

Inputs

None.

Outputs

account_idtext
display_nametext
html_urltext
nicknametext
uuidtext
Example output
{
  "account_id": "5f8a1b2c3d4e5f6a7b8c9d0e",
  "display_name": "Octo Bit",
  "html_url": "https://bitbucket.org/octobit/",
  "nickname": "octobit",
  "uuid": "{9133e9d5-8f9a-4f5d-9c2f-3c2d1a6b7c8d}"
}

Get pull request

Get one pull request's title, description, state and branches.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Pull request numberpull_request_idnumberRequired
The pull request's number, as shown in its link (.../pull-requests/7) or returned by List pull requests.At least 1.

Outputs

authortext
Who opened it
close_source_branchtrue/false
Whether the source branch is deleted once it's merged
comment_countnumber
How many comments it has
created_ontext
When it was opened
descriptiontext
The pull request's description
destination_branchtext
The branch the changes go into
html_urltext
Link to the pull request on bitbucket.org
idnumber
The pull request's number
merge_committext
The commit it was merged as, once merged; otherwise empty
source_branchtext
The branch with the changes
statetext
OPEN, MERGED, DECLINED or SUPERSEDED
titletext
The pull request's title
updated_ontext
When it last changed
Example output
{
  "author": "Octo Bit",
  "close_source_branch": true,
  "comment_count": 1,
  "created_on": "2026-07-30T11:00:00.000000+00:00",
  "description": "Adds the widget to the home page.",
  "destination_branch": "main",
  "html_url": "https://bitbucket.org/my-team/hello-world/pull-requests/7",
  "id": 7,
  "merge_commit": "",
  "source_branch": "feature/new-widget",
  "state": "OPEN",
  "title": "Add new widget",
  "updated_on": "2026-07-30T12:00:00.000000+00:00"
}

Get repository

Get one repository's details: its name, description, main branch, whether it's private and its link.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').

Outputs

descriptiontext
The repository's description
full_nametext
workspace/repository
html_urltext
Link to the repository on bitbucket.org
is_privatetrue/false
Whether only members can see it
mainbranchtext
The repository's main branch, for example main
nametext
The repository's name
slugtext
The repository's short name, used in its link
updated_ontext
When it last changed
Example output
{
  "description": "An example repository.",
  "full_name": "my-team/hello-world",
  "html_url": "https://bitbucket.org/my-team/hello-world",
  "is_private": true,
  "mainbranch": "main",
  "name": "Hello World",
  "slug": "hello-world",
  "updated_on": "2026-07-30T12:00:00.000000+00:00"
}

List branches

List a repository's branches, most recently committed to first, up to 100.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Name containsquerytext
Optional. Only list branches whose name contains this.

Outputs

brancheslist
The branches, most recently committed to first
Example output
{
  "branches": [
    {
      "hash": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
      "html_url": "https://bitbucket.org/my-team/hello-world/branch/main",
      "name": "main"
    }
  ]
}

List commits

List the newest commits on a branch, or on every branch, newest first.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Branchbranchtext
Optional. Only list commits on this branch.
Maximum commitslimitnumber
How many commits to return (1-100).From 1 to 100. Default: 20.

Outputs

commitslist
The commits, newest first
Example output
{
  "commits": [
    {
      "author": "Octo Bit",
      "author_raw": "Octo Bit <octo@example.com>",
      "date": "2026-07-30T11:00:00+00:00",
      "hash": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
      "html_url": "https://bitbucket.org/my-team/hello-world/commits/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
      "message": "Add new widget\n\nShown on the home page.",
      "title": "Add new widget"
    }
  ]
}

List pull request comments

List the comments on a pull request, oldest first.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Pull request numberpull_request_idnumberRequired
The pull request's number, as shown in its link (.../pull-requests/7) or returned by List pull requests.At least 1.
Maximum commentslimitnumber
How many comments to return (1-100).From 1 to 100. Default: 50.

Outputs

commentslist
The comments, oldest first
Example output
{
  "comments": [
    {
      "author": "Octo Bit",
      "created_on": "2026-07-30T12:30:00.000000+00:00",
      "html_url": "https://bitbucket.org/my-team/hello-world/pull-requests/7#comment-412345678",
      "id": 412345678,
      "text": "Looks good to me."
    }
  ]
}

List pull requests

List a repository's pull requests, most recently updated first. Defaults to open pull requests.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Statestatetext
Which pull requests to include. Defaults to open ones.One of: OPEN, MERGED, DECLINED, SUPERSEDED. Default: OPEN.

Outputs

pull_requestslist
Example output
{
  "pull_requests": [
    {
      "author": "Octo Bit",
      "created_on": "2026-07-30T11:00:00.000000+00:00",
      "destination_branch": "main",
      "html_url": "https://bitbucket.org/my-team/hello-world/pull-requests/7",
      "id": 7,
      "source_branch": "feature/new-widget",
      "state": "OPEN",
      "title": "Add new widget",
      "updated_on": "2026-07-30T12:00:00.000000+00:00"
    }
  ]
}

List repositories

List the repositories in a workspace that the connected account can access, most recently updated first.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.

Outputs

repositorieslist
Example output
{
  "repositories": [
    {
      "description": "An example repository.",
      "full_name": "my-team/hello-world",
      "html_url": "https://bitbucket.org/my-team/hello-world",
      "is_private": true,
      "mainbranch": "main",
      "name": "Hello World",
      "slug": "hello-world",
      "updated_on": "2026-07-30T12:00:00.000000+00:00"
    }
  ]
}

Merge pull request

Merge a pull request into its target branch. If that branch has a merge queue, Bitbucket queues it instead and the step says so.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Pull request numberpull_request_idnumberRequired
The pull request's number, as shown in its link (.../pull-requests/7) or returned by List pull requests.At least 1.
How to mergemerge_strategytext
Optional. How Bitbucket joins the changes in. Leave empty for the repository's default.One of: merge_commit (Merge commit), squash, fast_forward (Fast forward), squash_fast_forward (Squash, fast forward only), rebase_fast_forward (Rebase, fast forward), rebase_merge (Rebase, merge).
Commit messagemessagetext
Optional. The message for the merge commit.
Delete the branchclose_source_branchtrue/false
Whether to delete the source branch after merging. Leave empty to follow what was chosen when it was opened.

Outputs

authortext
Who opened it
close_source_branchtrue/false
Whether the source branch is deleted once it's merged
comment_countnumber
How many comments it has
created_ontext
When it was opened
descriptiontext
The pull request's description
destination_branchtext
The branch the changes go into
html_urltext
Link to the pull request on bitbucket.org
idnumber
The pull request's number
merge_committext
The commit it was merged as, once merged; otherwise empty
queuedtrue/false
True when Bitbucket put it in the branch's merge queue instead of merging it straight away
source_branchtext
The branch with the changes
statetext
OPEN, MERGED, DECLINED or SUPERSEDED
titletext
The pull request's title
updated_ontext
When it last changed
Example output
{
  "author": "Octo Bit",
  "close_source_branch": true,
  "comment_count": 1,
  "created_on": "2026-07-30T11:00:00.000000+00:00",
  "description": "Adds the widget to the home page.",
  "destination_branch": "main",
  "html_url": "https://bitbucket.org/my-team/hello-world/pull-requests/7",
  "id": 7,
  "merge_commit": "b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1",
  "queued": false,
  "source_branch": "feature/new-widget",
  "state": "MERGED",
  "title": "Add new widget",
  "updated_on": "2026-07-30T12:00:00.000000+00:00"
}

Remove approval

Take back the connected account's approval of a pull request.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Pull request numberpull_request_idnumberRequired
The pull request's number, as shown in its link (.../pull-requests/7) or returned by List pull requests.At least 1.

Outputs

approvedtrue/false
Always false: your approval is gone
pull_request_idnumber
The pull request
Example output
{
  "approved": false,
  "pull_request_id": 7
}

Update pull request

Change a pull request's title, description or the branch it goes into. Fields left empty stay as they are.

Inputs

WorkspaceworkspacetextRequired
The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
Repositoryrepo_slugtextRequired
The repository to act on (the part after the '/' in 'workspace/repository').
Pull request numberpull_request_idnumberRequired
The pull request's number, as shown in its link (.../pull-requests/7) or returned by List pull requests.At least 1.
New titletitletext
The new title. Leave empty to keep it.
New descriptiondescriptiontext
The new description. Leave empty to keep it.
New target branchdestination_branchtext
The branch it should go into instead. Leave empty to keep it.

Outputs

authortext
Who opened it
close_source_branchtrue/false
Whether the source branch is deleted once it's merged
comment_countnumber
How many comments it has
created_ontext
When it was opened
descriptiontext
The pull request's description
destination_branchtext
The branch the changes go into
html_urltext
Link to the pull request on bitbucket.org
idnumber
The pull request's number
merge_committext
The commit it was merged as, once merged; otherwise empty
source_branchtext
The branch with the changes
statetext
OPEN, MERGED, DECLINED or SUPERSEDED
titletext
The pull request's title
updated_ontext
When it last changed
Example output
{
  "author": "Octo Bit",
  "close_source_branch": true,
  "comment_count": 1,
  "created_on": "2026-07-30T11:00:00.000000+00:00",
  "description": "Adds the widget to the home page.",
  "destination_branch": "main",
  "html_url": "https://bitbucket.org/my-team/hello-world/pull-requests/7",
  "id": 7,
  "merge_commit": "",
  "source_branch": "feature/new-widget",
  "state": "OPEN",
  "title": "Add new widget (v2)",
  "updated_on": "2026-07-30T12:00:00.000000+00:00"
}

On this page