GET /repos/{owner}/{repo}/pulls

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

Servers

Path parameters

Name Type Required Description
repo String Yes

The name of the repository without the .git extension. The name is not case sensitive.

owner String Yes

The account owner of the repository. The name is not case sensitive.

Query parameters

Name Type Required Description
page Integer No

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Default value: 1

direction String No

The direction of the sort. Default: desc when sort is created or sort is not specified, otherwise asc.

Possible values:

  • "desc"
  • "asc"
head String No

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.

sort String No

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.

Possible values:

  • "updated"
  • "created"
  • "popularity"
  • "long-running"

Default value: "created"

per_page Integer No

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Default value: 30

base String No

Filter pulls by base branch name. Example: gh-pages.

state String No

Either open, closed, or all to filter by state.

Possible values:

  • "open"
  • "closed"
  • "all"

Default value: "open"

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.