provider pulls GET
/repos/{owner}/{repo}/pulls @utdk/github
/repos/{owner}/{repo}/pulls List 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](https://docs.github.com/github/getting-started-with-github/githubs-products)
in the GitHub Help documentation.
This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. 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 include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
- owner path required
- The account owner of the repository. The name is not case sensitive.
- string
- repo path required
- The name of the repository without the `.git` extension. The name is not case sensitive.
- string
- state query
- Either `open`, `closed`, or `all` to filter by state.
- enum: open, closed, all
- head query
- 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`.
- string
- base query
- Filter pulls by base branch name. Example: `gh-pages`.
- string
- sort query
- 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.
- enum: created, updated, popularity, long-running
- direction query
- The direction of the sort. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`.
- enum: asc, desc
- per_page query
- 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)."
- integer
- page query
- 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)."
- integer
Try it
Authentication
Configure credentials for GitHub v3 REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import github from '@utdk/github';
await github.pulls.list({
"state": "open",
"sort": "created",
"per_page": 30,
"page": 1
})