# Bitbucket pull request API

Get Bitbucket Pull Request data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as id, output, repo, and retrieve structured data including numeric pull request identifier, draft pull request indicator, participant approval status flag, comment text content, and reported comment count to audit review approvals, read threaded review feedback, and verify merge status.

Documentation: https://openany.si/market/apis/bitbucket/bitbucket-pull-request-api/?offering=d726c288-73e9-466c-a240-927ca4ccc35f
API ID: d726c288-73e9-466c-a240-927ca4ccc35f
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/bitbucket/v1/pull-request
Page update time: 2026-12-03T02:55:00.321Z
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. Price update time: not supplied.
Contract update time: 2026-12-03T02:38:58.978Z. 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": []
  }
}
```

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Bitbucket pull request 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."
        },
        "id": {
          "type": "integer",
          "description": "Pull request number."
        },
        "comments_page": {
          "type": "integer",
          "description": "Page of comments, 100 per page (default 1)."
        },
        "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",
        "id"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "author": {
      "type": "object",
      "properties": {
        "avatar": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "nickname": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "uuid": {
          "type": "string"
        }
      }
    },
    "cached": {
      "type": "boolean"
    },
    "close_source_branch": {
      "type": "boolean"
    },
    "closed_by": {
      "type": "object",
      "properties": {
        "avatar": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "nickname": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "uuid": {
          "type": "string"
        }
      }
    },
    "comment_count": {
      "type": "integer"
    },
    "comments": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "body": {
                "type": "string"
              },
              "created_at": {
                "type": "string"
              },
              "id": {
                "type": "integer"
              },
              "inline": {
                "type": "null"
              },
              "parent_id": {
                "type": "null"
              },
              "updated_at": {
                "type": "string"
              },
              "user": {
                "type": "object",
                "properties": {
                  "avatar": {
                    "type": "string"
                  },
                  "display_name": {
                    "type": "string"
                  },
                  "nickname": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "uuid": {
                    "type": "string"
                  }
                }
              }
            }
          },
          {
            "type": "string"
          }
        ]
      }
    },
    "comments_next_page": {
      "type": "null"
    },
    "comments_total": {
      "type": "integer"
    },
    "created_at": {
      "type": "string"
    },
    "credits_used": {
      "type": "integer"
    },
    "description": {
      "type": "string"
    },
    "destination_branch": {
      "type": "string"
    },
    "draft": {
      "type": "boolean"
    },
    "id": {
      "type": "integer"
    },
    "merge_commit": {
      "type": "string"
    },
    "participants": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "approved": {
                "type": "boolean"
              },
              "role": {
                "type": "string"
              },
              "state": {
                "type": "null"
              },
              "user": {
                "type": "object",
                "properties": {
                  "avatar": {
                    "type": "string"
                  },
                  "display_name": {
                    "type": "string"
                  },
                  "nickname": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "url": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "uuid": {
                    "type": "string"
                  }
                }
              }
            }
          },
          {
            "type": "string"
          }
        ]
      }
    },
    "reason": {
      "type": "null"
    },
    "reviewers": {
      "type": "array",
      "items": {}
    },
    "source_branch": {
      "type": "string"
    },
    "source_repo": {
      "type": "string"
    },
    "state": {
      "type": "string"
    },
    "task_count": {
      "type": "integer"
    },
    "title": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "url": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Official example · Official documentation response · Supplier-tr
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/bitbucket/v1/pull-request?id=5485&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
{
  "author": {
    "avatar": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/D-6.png",
    "display_name": "dc-core-bot",
    "nickname": "dc-core-bot",
    "type": "user",
    "url": "https://bitbucket.org/%7B9196eaf9-6f9d-404f-a451-5bc9bb347ca9%7D/",
    "uuid": "{9196eaf9-6f9d-404f-a451-5bc9bb347ca9}"
  },
  "cached": false,
  "close_source_branch": true,
  "closed_by": {
    "avatar": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/SH-5.png",
    "display_name": "Simon Holzmayer",
    "nickname": "Simon Holzmayer",
    "type": "user",
    "url": "https://bitbucket.org/%7Bf1b43ade-378b-474f-948b-c74096b16b62%7D/",
    "uuid": "{f1b43ade-378b-474f-948b-c74096b16b62}"
  },
  "comment_count": 3,
  "comments": [
    {
      "body": "This PR now includes the following changes:\n\n* @{557057:2ff479f7-af2d-45d0-aaaf-94d454f548f7}: f28b9ae\n* @{712020:13f1ffe5-75eb-4b3e-9b22-83…",
      "created_at": "2026-11-02T15:27:20.666491+00:00",
      "id": 2011980009,
      "inline": null,
      "parent_id": null,
      "updated_at": "2026-11-02T15:27:20.687150+00:00",
      "user": {
        "avatar": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/D-6.png",
        "display_name": "dc-core-bot",
        "nickname": "dc-core-bot",
        "type": "user",
        "url": "https://bitbucket.org/%7B9196eaf9-6f9d-404f-a451-5bc9bb347ca9%7D/",
        "uuid": "{9196eaf9-6f9d-404f-a451-5bc9bb347ca9}"
      }
    },
    {
      "body": "This PR now includes the following changes:\n\n* @{557057:2ff479f7-af2d-45d0-aaaf-94d454f548f7}: 382f14a\n* @{712020:13f1ffe5-75eb-4b3e-9b22-83…",
      "created_at": "2026-11-03T09:17:01.422711+00:00",
      "id": 2012039329,
      "inline": null,
      "parent_id": null,
      "updated_at": "2026-11-03T09:17:01.443388+00:00",
      "user": {
        "avatar": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/D-6.png",
        "display_name": "dc-core-bot",
        "nickname": "dc-core-bot",
        "type": "user",
        "url": "https://bitbucket.org/%7B9196eaf9-6f9d-404f-a451-5bc9bb347ca9%7D/",
        "uuid": "{9196eaf9-6f9d-404f-a451-5bc9bb347ca9}"
      }
    },
    "… 1 more"
  ],
  "comments_next_page": null,
  "comments_total": 3,
  "created_at": "2026-11-02T15:27:17.490748+00:00",
  "credits_used": 1,
  "description": "Note: This PR is created by the upmerge automation.\n\n***⚠️ Attention: there are 1 unresolved merge conflicts.***\n\nConflict markers are left …",
  "destination_branch": "release/10.2.x",
  "draft": false,
  "id": 5485,
  "merge_commit": "280d938504e0",
  "participants": [
    {
      "approved": false,
      "role": "PARTICIPANT",
      "state": null,
      "user": {
        "avatar": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/712020:94072633-6f6e-4364-9f08-8c013269bb9f/8cbcfda7-4444-46fe-a8ef-02…",
        "display_name": "dc-core-bot",
        "nickname": "dc-core-bot",
        "type": "app_user",
        "url": null,
        "uuid": "{ab0b7204-a3d4-4280-bbc2-2ee0d9131892}"
      }
    },
    {
      "approved": false,
      "role": "PARTICIPANT",
      "state": null,
      "user": {
        "avatar": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/D-6.png",
        "display_name": "dc-core-bot",
        "nickname": "dc-core-bot",
        "type": "user",
        "url": "https://bitbucket.org/%7B9196eaf9-6f9d-404f-a451-5bc9bb347ca9%7D/",
        "uuid": "{9196eaf9-6f9d-404f-a451-5bc9bb347ca9}"
      }
    },
    "… 1 more"
  ],
  "reason": null,
  "reviewers": [],
  "source_branch": "issue/10.2.x/upmerge",
  "source_repo": "atlassian/aui",
  "state": "MERGED",
  "task_count": 3,
  "title": "Upmerge release/9.12.x into release/10.2.x",
  "updated_at": "2026-11-03T15:48:55.062870+00:00",
  "url": "https://bitbucket.org/atlassian/aui/pull-requests/5485"
}
```

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

## Available implementations
- apish: https://openany.si/market/apis/bitbucket/bitbucket-pull-request-api/?offering=d726c288-73e9-466c-a240-927ca4ccc35f

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