# Bitbucket pipelines API

Get Bitbucket Pipelines data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, repo, and retrieve structured data including pipeline lifecycle state, target branch name, and next page to monitor branch build health, measure ci execution time, and trace failures to commits.

Documentation: https://openany.si/bitbucket/bitbucket-pipelines-api/870d8be1-203c-451c-837e-2b8dd6e464ae/
API ID: 870d8be1-203c-451c-837e-2b8dd6e464ae
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/bitbucket/v1/pipelines
Page update time: 2026-12-03T02:55:00.308Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:38:53.979Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## Bitbucket Pipelines API

Pass a workspace/repo identifier or bitbucket.org link in the repo query parameter, with optional branch, sort (default -created\_on), page and limit (1–100, default 25). The pipelines array returns build numbers, states, results, commit hashes, durations and creator metadata.

## What You Can Build

- **Monitor branch build health**: Filter by branch to check recent pipeline results on main or release branches.
- **Measure CI execution time**: Compare duration\_seconds and build\_seconds\_used across recent build numbers.
- **Trace failures to commits**: Pair failed results with commit hashes and creator metadata before inspecting source changes.

## Returned Data

| Field | Meaning |
| --- | --- |
| `pipelines[].build_number` | Sequential Bitbucket pipeline build number |
| `pipelines[].state` | Pipeline lifecycle state |
| `pipelines[].result` | Final build outcome when completed |
| `pipelines[].branch` | Target branch name |
| `pipelines[].commit` | Commit hash built by the pipeline |
| `pipelines[].trigger` | Trigger type that started the run |
| `pipelines[].duration_seconds` | Total execution duration in seconds |
| `pipelines[].url` | Direct pipeline URL on Bitbucket |
| `next_page` | Next page number, or null on the final page |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Bitbucket pipelines API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "repo": {
          "type": "string",
          "description": "Repository as workspace/repo, or a bitbucket.org link."
        },
        "branch": {
          "type": "string",
          "description": "Only builds of this branch."
        },
        "sort": {
          "type": "string",
          "description": "Sort order (default -created_on).",
          "enum": [
            "-created_on",
            "created_on"
          ]
        },
        "page": {
          "type": "integer",
          "description": "Page number (default 1). Pass `next_page` back as `page`; null on the last page."
        },
        "limit": {
          "type": "integer",
          "description": "Results per page, 1-100 (default 25)."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON exports are not exposed.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "Native CSV/NDJSON record selector; it has no effect on this JSON-only product."
        }
      },
      "required": [
        "repo"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "branch": {
      "type": "null"
    },
    "cached": {
      "type": "boolean"
    },
    "count": {
      "type": "integer"
    },
    "credits_used": {
      "type": "integer"
    },
    "next_page": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "pipelines": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "branch": {
                "type": "string"
              },
              "build_number": {
                "type": "integer"
              },
              "build_seconds_used": {
                "type": "integer"
              },
              "commit": {
                "type": "string"
              },
              "completed_at": {
                "type": "string"
              },
              "created_at": {
                "type": "string"
              },
              "creator": {
                "type": "object",
                "properties": {
                  "avatar": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "display_name": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "nickname": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "type": {
                    "type": "string"
                  },
                  "url": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "uuid": {
                    "type": "string"
                  }
                }
              },
              "duration_seconds": {
                "type": "integer"
              },
              "pipeline": {
                "type": "string"
              },
              "ref_type": {
                "type": "string"
              },
              "result": {
                "type": "string"
              },
              "state": {
                "type": "string"
              },
              "trigger": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "uuid": {
                "type": "string"
              }
            }
          },
          {
            "type": "string"
          }
        ]
      }
    },
    "repo": {
      "type": "string"
    },
    "total": {
      "type": "integer"
    }
  }
}
```

## Request example
Scenario: Official example · Official documentation response · Supplier-tr
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/bitbucket/v1/pipelines?output=json&repo=atlassian%2Faui' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "branch": null,
  "cached": false,
  "count": 25,
  "credits_used": 1,
  "next_page": 2,
  "page": 1,
  "pipelines": [
    {
      "branch": "BESECART-3480_aui",
      "build_number": 14542,
      "build_seconds_used": 414,
      "commit": "682ba878894e91e6e528c01030767e0287a77b43",
      "completed_at": "2025-06-10T06:24:31.737475482Z",
      "created_at": "2025-06-10T06:17:24.957391773Z",
      "creator": {
        "avatar": null,
        "display_name": null,
        "nickname": null,
        "type": "user",
        "url": null,
        "uuid": "{18485dd2-d374-46f3-b21c-a79d4257817e}"
      },
      "duration_seconds": 414,
      "pipeline": "docs-index-deployment",
      "ref_type": "branch",
      "result": "FAILED",
      "state": "COMPLETED",
      "trigger": "MANUAL",
      "url": "https://bitbucket.org/atlassian/aui/pipelines/results/14542",
      "uuid": "{afed4f12-e6f6-4e93-96c7-0d615b95363c}"
    },
    {
      "branch": "issue/DCA11Y-1655-fixing",
      "build_number": 14541,
      "build_seconds_used": 269,
      "commit": "add22b2bf0b99d0cccefb639cbf8ca1fee635b3d",
      "completed_at": "2025-05-16T06:00:04.651471656Z",
      "created_at": "2025-05-16T05:55:18.15338187Z",
      "creator": {
        "avatar": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/FN-2.png",
        "display_name": "Filip Nowakowski",
        "nickname": "Filip Nowakowski",
        "type": "user",
        "url": "https://bitbucket.org/%7Bb42d7a4b-e7ad-4849-bc59-600c8129b033%7D/",
        "uuid": "{b42d7a4b-e7ad-4849-bc59-600c8129b033}"
      },
      "duration_seconds": 269,
      "pipeline": "docs-index-deployment",
      "ref_type": "branch",
      "result": "FAILED",
      "state": "COMPLETED",
      "trigger": "MANUAL",
      "url": "https://bitbucket.org/atlassian/aui/pipelines/results/14541",
      "uuid": "{e09603d7-2497-40c8-98a5-f78b0e374be0}"
    },
    "… 23 more"
  ],
  "repo": "atlassian/aui",
  "total": 14538
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### What format should I use for the repo parameter?
Pass workspace/repo such as atlassian/aui, or pass a full bitbucket.org repository link.

### Can this endpoint trigger or stop a Bitbucket pipeline?
No. It is a read-only GET operation that lists public pipeline records without starting or altering builds.

### How is pipeline history ordered by default?
Results default to sort=-created_on (newest first). You can override sort as needed.

### How do I paginate through older builds?
Use page (default 1) and limit (1–100, default 25). Pass next_page back as page until it is null.

### What is the difference between state and result?
state indicates the pipeline lifecycle stage, while result reports the final outcome once execution completes.

### How do I bypass the 24-hour cache or shrink JSON size?
Pass fresh=1 to fetch live runs, raw=0 to omit bulky raw blocks, or fields to select specific paths.

## Available implementations
- apish: https://openany.si/bitbucket/bitbucket-pipelines-api/870d8be1-203c-451c-837e-2b8dd6e464ae/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
