---
title: "Get changed files for a pull request"
method: GET
path: "/repos/{owner}/{repo}/pulls/{index}/files"
tags: ["repository"]
---

# Get changed files for a pull request

`GET /repos/{owner}/{repo}/pulls/{index}/files`

## Request

- Base URL: `https://demo.gitea.com/api/v1`
- URL: `https://demo.gitea.com/api/v1/repos/{owner}/{repo}/pulls/{index}/files`
- Auth: one of:
  - HTTP basic
  - API key in query parameter `token`
  - API key in query parameter `access_token`
  - API key in header `Authorization`
  - API key in query parameter `sudo`
  - API key in header `Sudo`
  - API key in header `X-GITEA-OTP`
- TypeScript: <https://skmtc.dev/gitea/apis/gitea-api/docs/repos/:owner/:repo/pulls/:index/files/get.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `owner` string, required
- `repo` string, required
- `index` integer, required

## Query parameters

- `skip-to` string
- `whitespace` 'ignore-all' | 'ignore-change' | 'ignore-eol' | 'show-all'
- `page` integer
- `limit` integer

## Response `200`

ChangedFileList

- ChangedFile[]
  - `additions` integer: The number of lines added to the file
  - `changes` integer: The total number of changes to the file
  - `contents_url` string: The API URL to get the file contents
  - `deletions` integer: The number of lines deleted from the file
  - `filename` string: The name of the changed file
  - `html_url` string: The HTML URL to view the file changes
  - `previous_filename` string: The previous filename if the file was renamed
  - `raw_url` string: The raw URL to download the file
  - `status` string: The status of the file change (added, modified, deleted, etc.)

## Other responses

- `default`: APIError is error format response

## Changes

- **2026-10-28** `7ef50c4c527f`: 1 info
  - removed the non-success response with the status `404`
- **2026-10-07** `b0b1b4890863`: 1 warning
  - the optional response header `X-Total` removed for the status `200`

[Operation history](https://skmtc.dev/gitea/apis/gitea-api/changes/repos/:owner/:repo/pulls/:index/files/get.md)

---

[API](https://skmtc.dev/gitea/apis/gitea-api.md) - [All operations](https://skmtc.dev/gitea/apis/gitea-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitea/apis/gitea-api/revisions/d712da0399fd?raw)
