Skip to main content

List Pull Requests

Returns all pull requests on the specified repository.

By default only open pull requests are returned. This can be controlled using the state query parameter. To retrieve pull requests that are in one of multiple states, repeat the state parameter for each individual state.

This endpoint also supports filtering and sorting of the results. See filtering and sorting for more details.

External Documentation

To learn more, visit the Bitbucket documentation.

Parameters

ParameterDescription
Repo SlugThis can either be the repository slug or the UUID of the repository,surrounded by curly-braces, for example: {repository UUID}.
StateOnly return pull requests that are in this state.
Workspace SlugThis can either be the workspace ID (slug) or the workspace UUIDsurrounded by curly-braces, for example: {workspace UUID}.

Example Output

{
"values": [
{
"comment_count": 0,
"task_count": 0,
"type": "pullrequest",
"id": 31,
"title": "bhjg created online with Bitbucket",
"description": "bhjg created online with Bitbucket",
"state": "OPEN",
"merge_commit": null,
"close_source_branch": true,
"closed_by": null,
"author": {
"display_name": "David Korochik",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/%7B54af34e6-01f7-4a1d-a643-b7687553909d%7D"
},
"avatar": {
"href": "https://secure.gravatar.com/avatar/d5977080980b9212b5ff014e1cd1641c?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FDK-5.png"
},
"html": {
"href": "https://bitbucket.org/%7B54af34e6-01f7-4a1d-a643-b7687553909d%7D/"
}
},
"type": "user",
"uuid": "{54af34e6-01f7-4a1d-a643-b7687553909d}",
"account_id": "618c35eafba4d0006ad8a3aa",
"nickname": "David Korochik"
},
"reason": "",
"created_on": "2023-02-06T12:24:07.924404+00:00",
"updated_on": "2023-02-06T12:24:08.984122+00:00",
"destination": {
"branch": {
"name": "master"
},
"commit": {
"type": "commit",
"hash": "7dded1edaa57",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/commit/7dded1edaa57"
},
"html": {
"href": "https://bitbucket.org/david2kk/triggers/commits/7dded1edaa57"
}
}
},
"repository": {
"type": "repository",
"full_name": "david2kk/triggers",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers"
},
"html": {
"href": "https://bitbucket.org/david2kk/triggers"
},
"avatar": {
"href": "https://bytebucket.org/ravatar/%7Ba17d5b9a-6b9f-4248-af61-a13577a7ce6e%7D?ts=default"
}
},
"name": "triggers",
"uuid": "{a17d5b9a-6b9f-4248-af61-a13577a7ce6e}"
}
},
"source": {
"branch": {
"name": "David-Korochik/bhjg-created-online-with-bitbucket-1675686243720"
},
"commit": {
"type": "commit",
"hash": "895a85fa4319",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/commit/895a85fa4319"
},
"html": {
"href": "https://bitbucket.org/david2kk/triggers/commits/895a85fa4319"
}
}
},
"repository": {
"type": "repository",
"full_name": "david2kk/triggers",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers"
},
"html": {
"href": "https://bitbucket.org/david2kk/triggers"
},
"avatar": {
"href": "https://bytebucket.org/ravatar/%7Ba17d5b9a-6b9f-4248-af61-a13577a7ce6e%7D?ts=default"
}
},
"name": "triggers",
"uuid": "{a17d5b9a-6b9f-4248-af61-a13577a7ce6e}"
}
},
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/pullrequests/31"
},
"html": {
"href": "https://bitbucket.org/david2kk/triggers/pull-requests/31"
},
"commits": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/pullrequests/31/commits"
},
"approve": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/pullrequests/31/approve"
},
"request-changes": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/pullrequests/31/request-changes"
},
"diff": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/diff/david2kk/triggers:895a85fa4319%0D7dded1edaa57?from_pullrequest_id=31&topic=true"
},
"diffstat": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/diffstat/david2kk/triggers:895a85fa4319%0D7dded1edaa57?from_pullrequest_id=31&topic=true"
},
"comments": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/pullrequests/31/comments"
},
"activity": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/pullrequests/31/activity"
},
"merge": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/pullrequests/31/merge"
},
"decline": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/pullrequests/31/decline"
},
"statuses": {
"href": "https://api.bitbucket.org/2.0/repositories/david2kk/triggers/pullrequests/31/statuses"
}
},
"summary": {
"type": "rendered",
"raw": "bhjg created online with Bitbucket",
"markup": "markdown",
"html": "<p>bhjg created online with Bitbucket</p>"
}
},
],
"pagelen": 50,
"size": 3,
"page": 1
}

Workflow Library Example

List Pull Requests with Bitbucket and Send Results Via Email

Workflow LibraryPreview this Workflow on desktop