Create a 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 in the GitHub Help documentation.
To open or update a pull request in a public repository, you must have write access to the head or the 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.
You can create a new pull request.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
Path Parameters
Body
application/json
Body
The title of the new pull request.
The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace head
with a user like this: username:branch
.
The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository.
The contents of the pull request.
Indicates whether maintainers can modify the pull request.
Indicates whether the pull request is a draft. See “Draft Pull Requests” in the GitHub Help documentation to learn more.
Example:1
Response
application/json
Response
Response
Pull Request
Pull requests let you tell others about changes you’ve pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.
Example:https://api.github.com/repos/octocat/Hello-World/pulls/1347
Example:1
Example:MDExOlB1bGxSZXF1ZXN0MQ==
Example:https://github.com/octocat/Hello-World/pull/1347
Example:https://github.com/octocat/Hello-World/pull/1347.diff
Example:https://github.com/octocat/Hello-World/pull/1347.patch
Example:https://api.github.com/repos/octocat/Hello-World/issues/1347
Example:https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits
Example:https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments
Example:https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}
Example:https://api.github.com/repos/octocat/Hello-World/issues/1347/comments
Example:https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e
Number uniquely identifying the pull request within its repository.
Example:42
State of this Pull Request. Either open
or closed
.
Allowed values:openclosed
Example:open
Example:true
The title of the pull request.
Example:Amazing new feature
Simple User
Show Child Parameters
Example:Please pull these awesome changes
Show Child Parameters
A collection of related issues and pull requests.
Show Child Parameters
Example:too heated
Example:2011-01-26T19:01:12Z
Example:2011-01-26T19:01:12Z
Example:2011-01-26T19:01:12Z
Example:2011-01-26T19:01:12Z
Example:e5bd3914e2e596debea16f433f57875b5b90bcd6
Simple User
Show Child Parameters
Simple User
Show Child Parameters
Simple User
Show Child Parameters
Groups of organization members that gives permissions on specified repositories.
Show Child Parameters
Show Child Parameters
Show Child Parameters
Show Child Parameters
How the author is associated with the repository.
Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
Example:OWNER
Indicates whether or not the pull request is a draft.
Example:false
Example:true
Example:true
Example:clean
Simple User
Show Child Parameters
Example:10
Example:0
Indicates whether maintainers can modify the pull request.
Example:true
Example:3
Example:100
Example:3
Example:5
Path Parameters
Body
List review comments in a repository
Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID.
Query Parameters
Allowed values:createdupdatedcreated_at
Can be either asc
or desc
. Ignored without sort
parameter.
Allowed values:ascdesc
Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ
.
Results per page (max 100)
Default:30
Page number of the results to fetch.
Default:1
Path Parameters
Response
200 application/json
Response
Response
Pull Request Review Comments are comments on a portion of the Pull Request’s diff.
URL for the pull request review comment
Example:https://api.github.com/repos/octocat/Hello-World/pulls/comments/1
The ID of the pull request review to which the comment belongs.
Example:42
The ID of the pull request review comment.
Example:1
The node ID of the pull request review comment.
Example:MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw
The diff of the line that the comment refers to.
Example:@@ -16,33 +16,40 @@ public class Connection : IConnection...
The relative path of the file to which the comment applies.
Example:config/database.yaml
The line index in the diff to which the comment applies.
Example:1
The index of the original line in the diff to which the comment applies.
Example:4
The SHA of the commit to which the comment applies.
Example:6dcb09b5b57875f334f61aebed695e2e4193db5e
The SHA of the original commit to which the comment applies.
Example:9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840
The comment ID to reply to.
Example:8
Simple User
Show Child Parameters
The text of the comment.
Example:We should probably include a check for null values here.
Example:2011-04-14T16:00:49Z
Example:2011-04-14T16:00:49Z
HTML URL for the pull request review comment.
Example:https://github.com/octocat/Hello-World/pull/1#discussion-diff-1
URL for the pull request that the review comment belongs to.
Example:https://api.github.com/repos/octocat/Hello-World/pulls/1
How the author is associated with the repository.
Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
Example:OWNER
Show Child Parameters
The first line of the range for a multi-line comment.
Example:2
The first line of the range for a multi-line comment.
Example:2
The side of the first line of the range for a multi-line comment.
Allowed values:LEFTRIGHT
Default:RIGHT
The line of the blob to which the comment applies. The last line of the range for a multi-line comment
Example:2
The line of the blob to which the comment applies. The last line of the range for a multi-line comment
Example:2
The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment
Allowed values:LEFTRIGHT
Default:RIGHT
Show Child Parameters
Example:"<p>comment body</p>"
Example:"comment body"
Path Parameters
Query Parameters
Get a review comment for a pull request
Provides details for a review comment.
Path Parameters
comment_id parameter
Response
application/json
Response
Response
Pull Request Review Comment
Pull Request Review Comments are comments on a portion of the Pull Request’s diff.
URL for the pull request review comment
Example:https://api.github.com/repos/octocat/Hello-World/pulls/comments/1
The ID of the pull request review to which the comment belongs.
Example:42
The ID of the pull request review comment.
Example:1
The node ID of the pull request review comment.
Example:MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw
The diff of the line that the comment refers to.
Example:@@ -16,33 +16,40 @@ public class Connection : IConnection...
The relative path of the file to which the comment applies.
Example:config/database.yaml
The line index in the diff to which the comment applies.
Example:1
The index of the original line in the diff to which the comment applies.
Example:4
The SHA of the commit to which the comment applies.
Example:6dcb09b5b57875f334f61aebed695e2e4193db5e
The SHA of the original commit to which the comment applies.
Example:9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840
The comment ID to reply to.
Example:8
Simple User
Show Child Parameters
The text of the comment.
Example:We should probably include a check for null values here.
Example:2011-04-14T16:00:49Z
Example:2011-04-14T16:00:49Z
HTML URL for the pull request review comment.
Example:https://github.com/octocat/Hello-World/pull/1#discussion-diff-1
URL for the pull request that the review comment belongs to.
Example:https://api.github.com/repos/octocat/Hello-World/pulls/1
How the author is associated with the repository.
Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
Example:OWNER
Show Child Parameters
The first line of the range for a multi-line comment.
Example:2
The first line of the range for a multi-line comment.
Example:2
The side of the first line of the range for a multi-line comment.
Allowed values:LEFTRIGHT
Default:RIGHT
The line of the blob to which the comment applies. The last line of the range for a multi-line comment
Example:2
The line of the blob to which the comment applies. The last line of the range for a multi-line comment
Example:2
The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment
Allowed values:LEFTRIGHT
Default:RIGHT
Show Child Parameters
Example:"<p>comment body</p>"
Example:"comment body"
Path Parameters
Update a review comment for a pull request
Enables you to edit a review comment.
Path Parameters
comment_id parameter
Body
application/json
Body
The text of the reply to the review comment.
Response
200 application/json
Response
Response
Pull Request Review Comment
Pull Request Review Comments are comments on a portion of the Pull Request’s diff.
URL for the pull request review comment
Example:https://api.github.com/repos/octocat/Hello-World/pulls/comments/1
The ID of the pull request review to which the comment belongs.
Example:42
The ID of the pull request review comment.
Example:1
The node ID of the pull request review comment.
Example:MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw
The diff of the line that the comment refers to.
Example:@@ -16,33 +16,40 @@ public class Connection : IConnection...
The relative path of the file to which the comment applies.
Example:config/database.yaml
The line index in the diff to which the comment applies.
Example:1
The index of the original line in the diff to which the comment applies.
Example:4
The SHA of the commit to which the comment applies.
Example:6dcb09b5b57875f334f61aebed695e2e4193db5e
The SHA of the original commit to which the comment applies.
Example:9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840
The comment ID to reply to.
Example:8
Simple User
Show Child Parameters
The text of the comment.
Example:We should probably include a check for null values here.
Example:2011-04-14T16:00:49Z
Example:2011-04-14T16:00:49Z
HTML URL for the pull request review comment.
Example:https://github.com/octocat/Hello-World/pull/1#discussion-diff-1
URL for the pull request that the review comment belongs to.
Example:https://api.github.com/repos/octocat/Hello-World/pulls/1
How the author is associated with the repository.
Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
Example:OWNER
Show Child Parameters
The first line of the range for a multi-line comment.
Example:2
The first line of the range for a multi-line comment.
Example:2
The side of the first line of the range for a multi-line comment.
Allowed values:LEFTRIGHT
Default:RIGHT
The line of the blob to which the comment applies. The last line of the range for a multi-line comment
Example:2
The line of the blob to which the comment applies. The last line of the range for a multi-line comment
Example:2
The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment
Allowed values:LEFTRIGHT
Default:RIGHT
Show Child Parameters
Example:"<p>comment body</p>"
Example:"comment body"
Path Parameters
Body
Delete a review comment for a pull request
Deletes a review comment.
Path Parameters
comment_id parameter
Response
Response
Response