GET
/repos/{owner}/{repo}/pullsList pull requests
Lists pull requests in a specified repository.
Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.raw+json: Returns the raw markdown body. Response will includebody. This is the default if you do not pass any specific media type.application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will includebody_text.application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will includebody_html.application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will includebody,body_text, andbody_html.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
statestringoptional
Either `open`, `closed`, or `all` to filter by state.
headstringoptional
Filter pulls by head user or head organization and branch name in the format of `user:ref-name` or `organization:ref-name`. For example: `github:new-script-format` or `octocat:test-branch`.
basestringoptional
Filter pulls by base branch name. Example: `gh-pages`.
sortstringoptional
What to sort results by. `popularity` will sort by the number of comments. `long-running` will sort by date created and will limit the results to pull requests that have been open for more than a month and have had activity within the past month.
directionstringoptional
The direction of the sort. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`.
per_pageintegeroptional
The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
pageintegeroptional
The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
200Response
urlstringrequired
idintegerrequired
node_idstringrequired
html_urlstringrequired
diff_urlstringrequired
patch_urlstringrequired
issue_urlstringrequired
commits_urlstringrequired
review_comments_urlstringrequired
review_comment_urlstringrequired
comments_urlstringrequired
statuses_urlstringrequired
numberintegerrequired
statestringrequired
lockedbooleanrequired
titlestringrequired
userobjectrequired
A GitHub user.
bodystringrequired
labelsarray<object>required
milestoneobjectrequired
A collection of related issues and pull requests.
active_lock_reasonstringoptional
created_atstringrequired
updated_atstringrequired
closed_atstringrequired
merged_atstringrequired
merge_commit_shastringrequired
assigneeobjectrequired
A GitHub user.
assigneesarray<SimpleUser>optional
requested_reviewersarray<SimpleUser>optional
requested_teamsarray<Team>optional
headobjectrequired
baseobjectrequired
_linksobjectrequired
author_associationstringrequired
How the author is associated with the repository.
auto_mergeobjectrequired
The status of auto merging a pull request.
stackobjectoptional
The stack information associated with a pull request.
draftbooleanoptional
Indicates whether or not the pull request is a draft.
304Not modified
422Validation failed, or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional
Error handling
A 422 is returned: Validation failed, or the endpoint has been spammed.