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

# Get commits for a pull request

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

## Request

- Base URL: `https://demo.gitea.com/api/v1`
- URL: `https://demo.gitea.com/api/v1/repos/{owner}/{repo}/pulls/{index}/commits`
- 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/commits/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

- `page` integer
- `limit` integer
- `verification` boolean
- `files` boolean

## Response `200`

CommitList

- Commit[]
  - `author` User: User represents a user
    - `active` boolean: Is user active
    - `avatar_url` string: URL to the user's avatar
    - `created` string, date-time
    - `description` string: the user's description
    - `email` string, email
    - `followers_count` integer: user counts
    - `following_count` integer
    - `full_name` string: the user's full name
    - `html_url` string: URL to the user's gitea page
    - `id` integer: the user's id
    - `is_admin` boolean: Is the user an administrator
    - `language` string: User locale
    - `last_login` string, date-time
    - `location` string: the user's location
    - `login` string: login of the user, same as `username`
    - `login_name` string: identifier of the user, provided by the external authenticator (if configured)
    - `prohibit_login` boolean: Is user login prohibited
    - `restricted` boolean: Is user restricted
    - `source_id` integer: The ID of the user's Authentication Source
    - `starred_repos_count` integer
    - `type` 'User' | 'Organization' | 'Bot': the user type
    - `visibility` 'public' | 'limited' | 'private': User visibility level option: public, limited, private
    - `website` string: the user's website
  - `commit` RepoCommit
    - `author` CommitUser
      - `date` string: Date is the commit date in string format
      - `email` string, email: Email is the person's email address
      - `name` string: Name is the person's name
    - `committer` CommitUser
      - `date` string: Date is the commit date in string format
      - `email` string, email: Email is the person's email address
      - `name` string: Name is the person's name
    - `message` string: Message is the commit message
    - `tree` CommitMeta
      - `created` string, date-time: Created is the time when the commit was created
      - `sha` string: SHA is the commit SHA hash
      - `url` string: URL is the API URL for the commit
    - `url` string: URL is the API URL for the commit
    - `verification` PayloadCommitVerification: PayloadCommitVerification represents the GPG verification of a commit
      - `payload` string: The signed payload content
      - `reason` string: The reason for the verification status
      - `signature` string: The GPG signature of the commit
      - `signer` PayloadUser: PayloadUser represents the author or committer of a commit
        - `email` string, email
        - `name` string: Full name of the commit author
        - `username` string: username of the user
      - `verified` boolean: Whether the commit signature is verified
  - `committer` User: User represents a user
    - `active` boolean: Is user active
    - `avatar_url` string: URL to the user's avatar
    - `created` string, date-time
    - `description` string: the user's description
    - `email` string, email
    - `followers_count` integer: user counts
    - `following_count` integer
    - `full_name` string: the user's full name
    - `html_url` string: URL to the user's gitea page
    - `id` integer: the user's id
    - `is_admin` boolean: Is the user an administrator
    - `language` string: User locale
    - `last_login` string, date-time
    - `location` string: the user's location
    - `login` string: login of the user, same as `username`
    - `login_name` string: identifier of the user, provided by the external authenticator (if configured)
    - `prohibit_login` boolean: Is user login prohibited
    - `restricted` boolean: Is user restricted
    - `source_id` integer: The ID of the user's Authentication Source
    - `starred_repos_count` integer
    - `type` 'User' | 'Organization' | 'Bot': the user type
    - `visibility` 'public' | 'limited' | 'private': User visibility level option: public, limited, private
    - `website` string: the user's website
  - `created` string, date-time: Created is the time when the commit was created
  - `files` CommitAffectedFiles[]: Files contains information about files affected by the commit
    - `filename` string: Filename is the path of the affected file
    - `status` string: Status indicates how the file was affected (added, modified, deleted)
  - `html_url` string: HTMLURL is the web URL for viewing the commit
  - `parents` CommitMeta[]: Parents contains the parent commit information
    - `created` string, date-time: Created is the time when the commit was created
    - `sha` string: SHA is the commit SHA hash
    - `url` string: URL is the API URL for the commit
  - `sha` string: SHA is the commit SHA hash
  - `stats` CommitStats: CommitStats is statistics for a RepoCommit
    - `additions` integer: Additions is the number of lines added
    - `deletions` integer: Deletions is the number of lines deleted
    - `total` integer: Total is the total number of lines changed
  - `url` string: URL is the API URL for the commit

## 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/commits/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)
