v50

latestOpenAPI 3.0.3MITraw.githubusercontent.com2024-01-0382859610.0 MB
pulls

List pull requests files

Note: Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default.

get/repos/{owner}/{repo}/pulls/{pull_number}/files

Path parameters

ownerstring required

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

repostring required

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

pull_numberinteger required

The number that identifies the pull request.

Query parameters

per_pageinteger

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

pageinteger

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

Response

Response

shastring required
filenamestring required
status'added' | 'removed' | 'modified' | 'renamed' | 'copied' | 'changed' | 'unchanged' required
additionsinteger required
deletionsinteger required
changesinteger required
blob_urlstring uri required
raw_urlstring uri required
contents_urlstring uri required
patchstring
previous_filenamestring

Example response

[
  {
    "sha": "bbcd538c8e72b8c175046e27cc8f907076331401",
    "filename": "file1.txt",
    "status": "added",
    "additions": 103,
    "deletions": 21,
    "changes": 124,
    "blob_url": "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt",
    "raw_url": "https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt",
    "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e",
    "patch": "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test",
    "previous_filename": "file.txt"
  }
]