---
title: "List pull requests by repository and number."
method: POST
path: "/get/pull_requests"
tags: ["get", "default"]
---

# List pull requests by repository and number.

`POST /get/pull_requests`

## Request

- Base URL: `{{ server_url }}/v1`
- URL: `{{ server_url }}/v1/get/pull_requests`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`
- TypeScript: <https://skmtc.dev/athenian/apis/title/docs/get/pull_requests/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- GetPullRequestsRequest: Request body of `/get/pull_requests`. Declaration of which PRs the user wants to list. The order of the requested PRs will be preserved in the response.
  - `account` integer, required: Account ID.
  - `prs` PullRequestNumbers[], required: List of repositories and PR numbers to list.
    - `repository` string, required: Repository name which uniquely identifies any repository in any service provider. The format matches the repository URL without the protocol part. No ".git" should be appended. We support a special syntax for repository sets: "{reposet id}" adds all the repositories from the given set.
    - `numbers` integer[], required
  - `environments` string[]: Deployment environments to apply. If omitted, any deployment counts.

## Response `200`

List of pull requests, in the requested order.

- PullRequestSet: List of pull requests together with the participant profile pictures.
  - `include` object, required: Mentioned deployments.
    - `users` object, required: Mapping user native (e.g., GitHub) login ID -> user details. The users are mentioned in the PRs from "PullRequestSet.data" or in the commits from "FilterCommitsRequest.data".
    - `deployments` object: Mapping deployment names to their details.
  - `data` PullRequest[], required: List of matched pull requests.
    - `repository` string, required: PR is/was open in this repository.
    - `number` integer, required: PR number.
    - `title` string, required: Title of the PR.
    - `size_added` integer, required: Overall number of lines added.
    - `size_removed` integer, required: Overall number of lines removed.
    - `files_changed` integer, required: Number of files changed in this PR.
    - `created` string, date-time, required: When this PR was created.
    - `updated` string, date-time, required: When this PR was last updated.
    - `closed` string, date-time: When this PR was last closed.
    - `comments` integer, required: Number of *regular* (not review) comments in this PR.
    - `commits` integer, required: Number of commits in this PR.
    - `review_requested` string, date-time: When was the first time the author of this PR requested a review.
    - `first_review` string, date-time: When the first review of this PR happened.
    - `approved` string, date-time: When this PR was approved.
    - `review_comments` integer: Number of review comments this PR received. A review comment is left at a specific line in a specific file. In other words: review summaries are *not* considered review comments; refer to `reviews`. Comments by the PR author are considered as `comments`, not as `review_comments`.
    - `reviews` integer: Number of times this PR was reviewed. Reviews by the PR author are not taken into account.
    - `merged` string, date-time: When this PR was merged.
    - `merged_with_failed_check_runs` string[]: PR was merged with these failed check runs.
    - `released` string, date-time: When this PR was released.
    - `release_url` string, url: URL of the earliest release that includes this merged PR.
    - `deployments` string[]: List of deployments that contain this PR.
    - `stage_timings` StageTimings, required: Time spent by the PR in each pipeline stage. The deployments are independent of the releases. If the release happens before the deployment, the deployment time measures from the release event. If the release happens after the deployment, the two values are independent and both measure from the PR merge event.
      - `wip` string, required: Time duration value.
      - `review` string: Time duration value.
      - `merge` string: Time duration value.
      - `release` string: Time duration value.
      - `deploy` object: Map from target environments to the values.
    - `events_time_machine` PullRequestEvent[]: List of PR events which happened until `date_to`. `date_from` does not matter.
    - `stages_time_machine` PullRequestStage[]: List of PR stages as of `date_to` (normally, of length 1).
    - `events_now` PullRequestEvent[], required: List of PR events that ever happened.
    - `stages_now` PullRequestStage[], required: List of current PR stages (normally, of length 1).
    - `participants` PullRequestParticipant[], required: List of developers related to this PR.
      - `id` string, required: Person identifier.
      - `status` string[], required
    - `labels` PullRequestLabel[]: List of PR labels.
      - `name` string, required
      - `description` string
      - `color` string, required: RGB 24-bit color in hex.
    - `jira` LinkedJIRAIssue[]: List of linked JIRA issues.
      - `id` string, required: JIRA issue key `PROJECT-###`.
      - `title` string, required: Title of this issue.
      - `epic` string: Identifier of the epic that owns this issue.
      - `labels` string[]: List of JIRA labels in this issue.
      - `type` string, required: Type of this issue.

## Other responses

- `400`: The request is invalid.
- `403`: Calling user is not allowed to access the specified pull requests.
- `404`: The specified account does not exist or the user is not a member.
- `422`: The account's installation has not finished yet.
- `424`: One or more logical repositories miss the release settings.

## Changes

- **2023-01-13** `da81d83d9501`: 1 breaking
  - the `prs` request property's minItems was increased to `1`
- **2023-01-13** `d08637dcd231`: 2 breaking, 1 info
  - the `include/allOf[#/components/schemas/IncludedDeployments]/deployments/additionalProperties/name` response property's maxLength was unset from `100` for the response status `200`
  - the `include/allOf[#/components/schemas/IncludedDeployments]/deployments/additionalProperties/name` response property's minLength was decreased from `1` to `0` for the response status `200`
  - the `include/allOf[#/components/schemas/IncludedDeployments]/deployments/additionalProperties/name` response's property pattern `^([^'\s]| ){1,100}$` was added for the status `200`
- **2022-12-23** `e561f70ed693`: 1 breaking
  - the `prs` request property's minItems was increased to `1`

[Operation history](https://skmtc.dev/athenian/apis/title/changes/get/pull_requests/post.md)

---

[API](https://skmtc.dev/athenian/apis/title.md) - [All operations](https://skmtc.dev/athenian/apis/title/llms.txt) - [OpenAPI document](https://skmtc.dev/athenian/apis/title/revisions/110c9f7cffdd?raw)
