> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Pull Request

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.

Lists details of a pull request by providing its number.

When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".

The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the *test* merge commit.

The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the *test* merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request:

* If merged as a [merge commit](https://docs.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit.
* If merged via a [squash](https://docs.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch.
* If [rebased](https://docs.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to.

Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats.

<Note>
  External Documentation

  To learn more, visit the [GitHub documentation](https://docs.github.com/rest/reference/pulls#get-a-pull-request).
</Note>

## Parameters

<div className="integrations-table">
  | Parameter   | Description                                                                   |
  | ----------- | ----------------------------------------------------------------------------- |
  | Owner       | The organization or person who owns the repository. github.com/{owner}/{repo} |
  | Pull Number | Pull number can be found in the pull request's URL.                           |
  | Repo        | Name of the repository owned by the owner. github.com/{owner}/{repo}          |
</div>

## Example Output

```json theme={"dark"}
{
	"url": "<string>",
	"id": 670100843,
	"node_id": "<string>",
	"html_url": "<string>",
	"diff_url": "<string>",
	"patch_url": "<string>",
	"issue_url": "<string>",
	"number": 1,
	"state": "<string>",
	"locked": false,
	"title": "<string>",
	"user": {
		"login": "<string>",
		"id": 13219051,
		"node_id": "<string>",
		"avatar_url": "<string>",
		"gravatar_id": "<string>",
		"url": "<string>",
		"html_url": "<string>",
		"followers_url": "<string>",
		"following_url": "<string>",
		"gists_url": "<string>",
		"starred_url": "<string>",
		"subscriptions_url": "<string>",
		"organizations_url": "<string>",
		"repos_url": "<string>",
		"events_url": "<string>",
		"received_events_url": "<string>",
		"type": "<string>",
		"user_view_type": "<string>",
		"site_admin": false
	},
	"body": null,
	"created_at": "2021-10-28T16:05:50Z",
	"updated_at": "2021-10-28T16:05:50Z",
	"closed_at": "2021-10-28T16:05:50Z",
	"merged_at": "2021-10-28T16:05:50Z",
	"merge_commit_sha": "<string>",
	"assignee": null,
	"assignees": [],
	"requested_reviewers": [],
	"requested_teams": [],
	"labels": [],
	"milestone": null,
	"draft": false,
	"commits_url": "<string>",
	"review_comments_url": "<string>",
	"review_comment_url": "<string>",
	"comments_url": "<string>",
	"statuses_url": "<string>",
	"head": {
		"label": "<string>",
		"ref": "<string>",
		"sha": "<string>",
		"user": {
			"login": "<string>",
			"id": 100899844,
			"node_id": "<string>",
			"avatar_url": "<string>",
			"gravatar_id": "<string>",
			"url": "<string>",
			"html_url": "<string>",
			"followers_url": "<string>",
			"following_url": "<string>",
			"gists_url": "<string>",
			"starred_url": "<string>",
			"subscriptions_url": "<string>",
			"organizations_url": "<string>",
			"repos_url": "<string>",
			"events_url": "<string>",
			"received_events_url": "<string>",
			"type": "<string>",
			"user_view_type": "<string>",
			"site_admin": false
		},
		"repo": {
			"id": 371480121,
			"node_id": "<string>",
			"name": "<string>",
			"full_name": "<string>",
			"private": false,
			"owner": {
				"login": "<string>",
				"id": 109986187,
				"node_id": "<string>",
				"avatar_url": "<string>",
				"gravatar_id": "<string>",
				"url": "<string>",
				"html_url": "<string>",
				"followers_url": "<string>",
				"following_url": "<string>",
				"gists_url": "<string>",
				"starred_url": "<string>",
				"subscriptions_url": "<string>",
				"organizations_url": "<string>",
				"repos_url": "<string>",
				"events_url": "<string>",
				"received_events_url": "<string>",
				"type": "<string>",
				"user_view_type": "<string>",
				"site_admin": false
			},
			"html_url": "<string>",
			"description": null,
			"fork": false,
			"url": "<string>",
			"forks_url": "<string>",
			"keys_url": "<string>",
			"collaborators_url": "<string>",
			"teams_url": "<string>",
			"hooks_url": "<string>",
			"issue_events_url": "<string>",
			"events_url": "<string>",
			"assignees_url": "<string>",
			"branches_url": "<string>",
			"tags_url": "<string>",
			"blobs_url": "<string>",
			"git_tags_url": "<string>",
			"git_refs_url": "<string>",
			"trees_url": "<string>",
			"statuses_url": "<string>",
			"languages_url": "<string>",
			"stargazers_url": "<string>",
			"contributors_url": "<string>",
			"subscribers_url": "<string>",
			"subscription_url": "<string>",
			"commits_url": "<string>",
			"git_commits_url": "<string>",
			"comments_url": "<string>",
			"issue_comment_url": "<string>",
			"contents_url": "<string>",
			"compare_url": "<string>",
			"merges_url": "<string>",
			"archive_url": "<string>",
			"downloads_url": "<string>",
			"issues_url": "<string>",
			"pulls_url": "<string>",
			"milestones_url": "<string>",
			"notifications_url": "<string>",
			"labels_url": "<string>",
			"releases_url": "<string>",
			"deployments_url": "<string>",
			"created_at": "2021-10-28T16:05:50Z",
			"updated_at": "2021-10-28T16:05:50Z",
			"pushed_at": "2021-10-28T16:05:50Z",
			"git_url": "<string>",
			"ssh_url": "<string>",
			"clone_url": "<string>",
			"svn_url": "<string>",
			"homepage": null,
			"size": 924,
			"stargazers_count": 1,
			"watchers_count": 1,
			"language": "<string>",
			"has_issues": true,
			"has_projects": true,
			"has_downloads": true,
			"has_wiki": true,
			"has_pages": false,
			"has_discussions": false,
			"forks_count": 1,
			"mirror_url": null,
			"archived": false,
			"disabled": false,
			"open_issues_count": 0,
			"license": {
				"key": "<string>",
				"name": "<string>",
				"spdx_id": "<string>",
				"url": "<string>",
				"node_id": "<string>"
			},
			"allow_forking": true,
			"is_template": false,
			"web_commit_signoff_required": false,
			"topics": [],
			"visibility": "<string>",
			"forks": 1,
			"open_issues": 2,
			"watchers": 1,
			"default_branch": "<string>"
		}
	},
	"base": {
		"label": "<string>",
		"ref": "<string>",
		"sha": "<string>",
		"user": {
			"login": "<string>",
			"id": 31926460,
			"node_id": "<string>",
			"avatar_url": "<string>",
			"gravatar_id": "<string>",
			"url": "<string>",
			"html_url": "<string>",
			"followers_url": "<string>",
			"following_url": "<string>",
			"gists_url": "<string>",
			"starred_url": "<string>",
			"subscriptions_url": "<string>",
			"organizations_url": "<string>",
			"repos_url": "<string>",
			"events_url": "<string>",
			"received_events_url": "<string>",
			"type": "<string>",
			"user_view_type": "<string>",
			"site_admin": false
		},
		"repo": {
			"id": 325971128,
			"node_id": "<string>",
			"name": "<string>",
			"full_name": "<string>",
			"private": false,
			"owner": {
				"login": "<string>",
				"id": 79338744,
				"node_id": "<string>",
				"avatar_url": "<string>",
				"gravatar_id": "<string>",
				"url": "<string>",
				"html_url": "<string>",
				"followers_url": "<string>",
				"following_url": "<string>",
				"gists_url": "<string>",
				"starred_url": "<string>",
				"subscriptions_url": "<string>",
				"organizations_url": "<string>",
				"repos_url": "<string>",
				"events_url": "<string>",
				"received_events_url": "<string>",
				"type": "<string>",
				"user_view_type": "<string>",
				"site_admin": false
			},
			"html_url": "<string>",
			"description": null,
			"fork": false,
			"url": "<string>",
			"forks_url": "<string>",
			"keys_url": "<string>",
			"collaborators_url": "<string>",
			"teams_url": "<string>",
			"hooks_url": "<string>",
			"issue_events_url": "<string>",
			"events_url": "<string>",
			"assignees_url": "<string>",
			"branches_url": "<string>",
			"tags_url": "<string>",
			"blobs_url": "<string>",
			"git_tags_url": "<string>",
			"git_refs_url": "<string>",
			"trees_url": "<string>",
			"statuses_url": "<string>",
			"languages_url": "<string>",
			"stargazers_url": "<string>",
			"contributors_url": "<string>",
			"subscribers_url": "<string>",
			"subscription_url": "<string>",
			"commits_url": "<string>",
			"git_commits_url": "<string>",
			"comments_url": "<string>",
			"issue_comment_url": "<string>",
			"contents_url": "<string>",
			"compare_url": "<string>",
			"merges_url": "<string>",
			"archive_url": "<string>",
			"downloads_url": "<string>",
			"issues_url": "<string>",
			"pulls_url": "<string>",
			"milestones_url": "<string>",
			"notifications_url": "<string>",
			"labels_url": "<string>",
			"releases_url": "<string>",
			"deployments_url": "<string>",
			"created_at": "2021-10-28T16:05:50Z",
			"updated_at": "2021-10-28T16:05:50Z",
			"pushed_at": "2021-10-28T16:05:50Z",
			"git_url": "<string>",
			"ssh_url": "<string>",
			"clone_url": "<string>",
			"svn_url": "<string>",
			"homepage": null,
			"size": 3599,
			"stargazers_count": 2,
			"watchers_count": 1,
			"language": "<string>",
			"has_issues": true,
			"has_projects": true,
			"has_downloads": true,
			"has_wiki": true,
			"has_pages": false,
			"has_discussions": false,
			"forks_count": 1,
			"mirror_url": null,
			"archived": false,
			"disabled": false,
			"open_issues_count": 2,
			"license": {
				"key": "<string>",
				"name": "<string>",
				"spdx_id": "<string>",
				"url": "<string>",
				"node_id": "<string>"
			},
			"allow_forking": true,
			"is_template": false,
			"web_commit_signoff_required": false,
			"topics": [],
			"visibility": "<string>",
			"forks": 2,
			"open_issues": 2,
			"watchers": 2,
			"default_branch": "<string>"
		}
	},
	"_links": {
		"self": {
			"href": "<string>"
		},
		"html": {
			"href": "<string>"
		},
		"issue": {
			"href": "<string>"
		},
		"comments": {
			"href": "<string>"
		},
		"review_comments": {
			"href": "<string>"
		},
		"review_comment": {
			"href": "<string>"
		},
		"commits": {
			"href": "<string>"
		},
		"statuses": {
			"href": "<string>"
		}
	},
	"author_association": "<string>",
	"auto_merge": null,
	"active_lock_reason": null,
	"merged": true,
	"mergeable": null,
	"rebaseable": null,
	"mergeable_state": "<string>",
	"merged_by": {
		"login": "<string>",
		"id": 7524168,
		"node_id": "<string>",
		"avatar_url": "<string>",
		"gravatar_id": "<string>",
		"url": "<string>",
		"html_url": "<string>",
		"followers_url": "<string>",
		"following_url": "<string>",
		"gists_url": "<string>",
		"starred_url": "<string>",
		"subscriptions_url": "<string>",
		"organizations_url": "<string>",
		"repos_url": "<string>",
		"events_url": "<string>",
		"received_events_url": "<string>",
		"type": "<string>",
		"user_view_type": "<string>",
		"site_admin": false
	},
	"comments": 2,
	"review_comments": 2,
	"maintainer_can_modify": false,
	"commits": 2,
	"additions": 65,
	"deletions": 35,
	"changed_files": 10
}
```

## Workflow Library Example

[Get Pull Request with Github and Send Results Via Email](https://library.blinkops.com/workflows/get-pull-request-with-github-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/get-pull-request-with-github-and-send-results-via-email/canvas" />
</div>
