# Bitbucket

> Browse Bitbucket repositories and pull requests and manage branches with an Atlassian API token.

App · Code Repositories · 5 actions. Web page: https://docs.lodol.com/docs/integrations/bitbucket

## Actions

### 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**

- Workspace (`workspace`, text, required): The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
- Repository (`repo_slug`, text, required): The repository to act on (the part after the '/' in 'workspace/repository').
- New branch name (`name`, text, required): The name for the new branch (without any 'refs/heads/' prefix).
- Source branch (`from_branch`, text): The existing branch to base the new one on. Defaults to the repository's main branch when not set.
- Source commit hash (`commit_hash`, text): A specific commit hash to point the new branch at. Takes precedence over the source branch when provided.

**Outputs**

- `hash` (text)
- `html_url` (text)
- `name` (text)

**Example output**

```json
{
  "hash": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
  "html_url": "https://bitbucket.org/my-team/hello-world/branch/feature/new-widget",
  "name": "feature/new-widget"
}
```

### Delete branch

Delete a branch from a repository.

**Inputs**

- Workspace (`workspace`, text, required): The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
- Repository (`repo_slug`, text, required): The repository to act on (the part after the '/' in 'workspace/repository').
- Branch name (`name`, text, required): The name of the branch to delete (without any 'refs/heads/' prefix).

**Outputs**

- `deleted` (true/false)
- `name` (text)

**Example output**

```json
{
  "deleted": true,
  "name": "feature/old-widget"
}
```

### Get current user

Get the Atlassian account the connection's API token belongs to. Useful for verifying the connection works.

**Inputs**: None.

**Outputs**

- `account_id` (text)
- `display_name` (text)
- `html_url` (text)
- `nickname` (text)
- `uuid` (text)

**Example output**

```json
{
  "account_id": "5f8a1b2c3d4e5f6a7b8c9d0e",
  "display_name": "Octo Bit",
  "html_url": "https://bitbucket.org/octobit/",
  "nickname": "octobit",
  "uuid": "{9133e9d5-8f9a-4f5d-9c2f-3c2d1a6b7c8d}"
}
```

### List pull requests

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

**Inputs**

- Workspace (`workspace`, text, required): The workspace that owns the repository (the part before the '/' in 'workspace/repository'), visible in any repository's URL at bitbucket.org/<workspace>/<repository>.
- Repository (`repo_slug`, text, required): The repository to act on (the part after the '/' in 'workspace/repository').
- State (`state`, text): Which pull requests to include. Defaults to open ones. One of: `OPEN`, `MERGED`, `DECLINED`, `SUPERSEDED`. Default: `OPEN`.

**Outputs**

- `pull_requests` (list)

**Example output**

```json
{
  "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**

- Workspace (`workspace`, text, required): 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**

- `repositories` (list)

**Example output**

```json
{
  "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"
    }
  ]
}
```
