1. Access a Pull Request URL. Let's use https://api.github.com/repos/github/gitignore/pulls/566 as an example.

  2. Parse the JSON object.


A Pull Request references two branches. The base branch is the merge target. Usually this is the master branch of the repository.

  • base.label is github:master, meaning it's the master branch for > github/gitignore.
  • base.ref is the branch name "master".
  • base.sha is the current SHA of that branch.

The head branch is what you're merging into the base.

  • head.label is fidelski:add-obvious-autotools-files, meaning it's the add-obvious-autotools-files branch for fidelski/gitignore.
  • head.ref is the branch name add-obvious-autotools-files.
  • head.sha is the current SHA of that branch.
Answer from technoweenie on Stack Overflow
🌐
GitHub
docs.github.com › en › rest › pulls
REST API endpoints for pull requests - GitHub Docs
REST API endpoints for pull requests · List pull requests · Create a pull request · Get a pull request · Update a pull request · List commits on a pull request · List pull requests files · Check if a pull request has been merged · Merge a pull request · Update a pull request branch ·
🌐
47degrees
47degrees.github.io › github4s › pull_request
Pull Request API - Github4s
import github4s.domain.NewPullRequestIssue val createPullRequestIssue = gh.pullRequests.createPullRequest( "47deg", "github4s", NewPullRequestIssue(105), "my-branch", "base-branch", Some(true)) createPullRequestIssue.flatMap(_.result match { case Left(e) => IO.println(s"Something went wrong: ${e.getMessage}") case Right(r) => IO.println(r) }) See the API doc for full reference. Merges the base HEAD into your pull request branch.
🌐
Graphite
graphite.com › guides › github-pull-request-api
GitHub pull request API
To create a pull request using the GitHub API, you need to POST data to the repository's pull requests endpoint. ... This request creates a new pull request from feature-branch into the main branch of the repository.
🌐
GitHub
docs2.lfe.io › v3 › pulls
Pull Requests | GitHub API
Pass the appropriate media type to fetch diff and patch formats. ... { "title": "Amazing new feature", "body": "Please pull this in!", "head": "octocat:new-feature", "base": "master" } You can also create a Pull Request from an existing Issue by passing an Issue number instead of title and body.
🌐
Pluralsight
pluralsight.com › tech insights & how-to guides › tech guides & tutorials
Open a Pull Request via the GitHub API | Pluralsight
November 2, 2020 - base: A required option that gives the API the name of the branch that you are attempting to alter · title: This option is not required. This is the title of your pull request. body: This option is not required. This is the pull request description. After running the above code, you can now navigate to the GitHub repo in your browser and see your submitted pull request! The GitHub developer API provides a rich layer of capabilities for interacting programmatically with your GitHub codebase.
🌐
GitHub
docs.github.com › en › enterprise-cloud@latest › rest › guides › using-the-rest-api-to-interact-with-your-git-database
Using the REST API to interact with your Git database - GitHub Enterprise Cloud Docs
If you are currently using polling ... from the default branch: Receive the pull request webhook. Call GET /repos/{owner}/{repo}/pulls/{pull_number} to start a background job for creating the merge commit candida...
Find elsewhere
🌐
I'd Rather Be Writing
idratherbewriting.com › learnapidoc › pubapis_github_pull_requests.html
Pull request workflows through GitHub | I'd Rather Be Writing Blog and API doc course
3 days ago - Click the New pull request button. ... Select the branch (“sme-review”) that you want to compare against the master.
🌐
GitHub API
tryapis.com › github › api › repos-list-pull-requests-associated-with-commit
GitHub API | List pull requests associated with a commit
Instantly send requests to the GitHub API. Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open pull requests associated with the commit.
🌐
Stateful
stateful.com › blog › github-pulls-api-manage-prs
How to Use the GitHub Pulls API to Manage Pull Requests • Stateful
May 6, 2022 - The GitHub API is powerful, but getting started might be frustrating. In this post, we'll walk you through a GitHub API pull request.
🌐
Towards Data Science
towardsdatascience.com › home › latest › how to get pull request data using github api
How to Get Pull Request Data Using GitHub API | Towards Data Science
January 13, 2025 - We’ve seen how to get the commit sha from the ui but we need to do it programmatically, which requires us to use the GitHub API. We can use the commits endpoint to get the commit data of a pull request. Let’s do it for pull request #59809 ...
🌐
Software Testing Help
softwaretestinghelp.com › home › github › github rest api tutorial – rest api support in github
GitHub REST API Tutorial - REST API Support In GitHub
April 1, 2025 - curl -X POST -u <UserName>:<Ge... branch\”,\”head\”: \”feature\”,\”base\”: \”master\”}” https://api.github.com/repos/<user-name>/<repo-name>/pulls ... curl -X GET -u <UserName>:<Generated-Token>https://api.github...
🌐
GitHub
docs.github.com › en › enterprise-server@3.10 › rest › pulls › pulls
REST API endpoints for pull requests - GitHub Enterprise Server 3.10 Docs
To open or update a pull request ... source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best ...
🌐
Medium
medium.com › @samarthgvasist › using-postman-to-create-a-github-pull-request-ac651785de81
Using Postman to Create a GitHub Pull Request | by Samarth G Vasist | Medium
September 6, 2021 - Here head and base being the required attributes refer to the name of the branch where changes are implemented and to the name of the branch where the changes have to be pulled into respectively. Title and body being optional refer to the title and the contents of the Pull request respectively. ... Finally click on SEND and the API request will be made to GitHub.
🌐
GitHub
docs.github.com › en › rest › commits › commits
REST API endpoints for commits - GitHub Docs
To list the open or merged pull requests associated with a branch, you can set the commit_sha parameter to the branch name. This endpoint works with the following fine-grained token types: ... This endpoint can be used without authentication ...
🌐
GitHub
github.com › github › developer.github.com › blob › master › content › v3 › pulls.md
developer.github.com/content/v3/pulls.md at master · github/developer.github.com
November 1, 2017 - The URL template to construct the API location for a Review comment in this Pull Request's repository. ... The API location of this Pull Request's commits. ... The API location of this Pull Request's commit statuses, which are the statuses of ...
Author   github
🌐
GitHub
docs.github.com › en › enterprise-cloud@latest › rest › pulls › pulls
REST API endpoints for pull requests - GitHub Enterprise Cloud Docs
To open or update a pull request ... source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best ...