> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bitbucket Cloud open pull requests

> Mount Bitbucket Cloud open pull requests.

Follow the [REST app guide](https://docs.bijection.com/integrations/native-rest.md#mount-and-bind).
Bind the reviewed endpoint with `providerEndpoint` from `@bijectionhq/app-rest`.

Use a bearer repository access token or OAuth with pull-request read access to the selected repository.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
const provider = providerEndpoint(
  "bitbucket.repository.open-pull-requests.observations",
  "https://api.bitbucket.org",
  "/2.0/repositories/workspace/repository/pullrequests",
  auth,
  data,
);
```

Pass `provider` as `receivers.provider`, and the same label to the binder and as the app's `data`. Call `source.initialize`
with this profile.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{ profile: { mode: "provider", provider: "bitbucket.repository.open-pull-requests.observations", limit: 10 } }
```

One repository. Pull requests are keyed by repository PR ID. Sweeps continue using the next link’s page number or cursor on the reviewed repository path. Completed sweeps restart. A closed, merged, or missing PR leaves its last observation published.

Each response is bounded to 10 to 100 rows and 36 KiB. The app commits observations with their
next position. [Source health and controls](https://docs.bijection.com/integrations/native-rest.md#feed-contracts)
report failures and allow recovery.

[Provider API reference](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-get)

## Commits, branches, and tags

Use the same receiver factory with a protected label and a
repository credential with read access. Set the mode and use the corresponding
path suffix under `/2.0/repositories/WORKSPACE/REPOSITORY`.

| Mode | Path suffix | Observation key |
| - | - | - |
| `bitbucket.repository.commits.observations` | `/commits` | Commit hash |
| `bitbucket.repository.branches.observations` | `/refs/branches` | Branch name |
| `bitbucket.repository.tags.observations` | `/refs/tags` | Tag name |

Each mount accepts a requested limit of 10–100 and up to 36 KiB per page.
It takes the page value or cursor from Bitbucket's next link, then sends the
value to the reviewed route with the original field projection. A completed
walk restarts on the next poll. Missing refs and commits remain published.
A force update can change a ref's observed target without removing prior
commit observations.

[Commits](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/) ·
[Refs](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/) ·
[Pagination](https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.