Documentation Index
Fetch the complete documentation index at: https://mintlify.com/go-gitea/gitea/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Pull Requests API enables you to manage pull requests in your repositories. You can create PRs, list them with various filters, update their properties, merge them, and check merge status.Pull Request Object
The PullRequest object represents a pull request with the following structure:The unique identifier of the pull request
The pull request number (index) in the repository
The title of the pull request
The description body content of the pull request
The current state of the pull request. Possible values:
open, closedWhether the pull request is a draft (work in progress)
The user who created the pull request
Information about the target (base) branch
Information about the source (head) branch
The commit SHA of the merge base
Whether the pull request can be merged
Whether the pull request has been merged
Timestamp when the PR was merged (RFC 3339 format)
The user who merged the pull request
Whether maintainers can edit the pull request
Array of label objects attached to the pull request
Array of user objects assigned to review the pull request
Array of user objects requested to review the pull request
The number of comments on the pull request
The number of review comments on the pull request diff
The number of lines added in the pull request
The number of lines deleted in the pull request
The number of files changed in the pull request
Operations
- List Pull Requests
- Get Pull Request
- Create Pull Request
- Update Pull Request
- Merge Pull Request
List Repository Pull Requests
List all pull requests in a specific repository.Endpoint:GET /api/v1/repos/{owner}/{repo}/pullsPath Parameters
Owner of the repository
Name of the repository
Query Parameters
Filter by pull request state. Options:
open, closed, allFilter by target base branch of the pull request
Sort order. Options:
oldest, recentupdate, recentclose, leastupdate, mostcomment, leastcomment, priorityFilter by milestone ID
Array of label IDs to filter by
Filter by pull request author username
Page number for pagination (1-based)
Number of items per page
Example Request
Response
Additional Operations
Check Merge Status
Check if a pull request has been merged. Endpoint:GET /api/v1/repos/{owner}/{repo}/pulls/{index}/merge
Path Parameters
Owner of the repository
Name of the repository
Index number of the pull request
Example Request
Response
- 204 No Content - Pull request has been merged
- 404 Not Found - Pull request has not been merged
Update Pull Request Branch
Merge the base branch into the head branch to update the pull request. Endpoint:POST /api/v1/repos/{owner}/{repo}/pulls/{index}/update
Path Parameters
Owner of the repository
Name of the repository
Index number of the pull request
Query Parameters
How to update the pull request. Options:
merge, rebaseExample Request
Response (200 OK)
No response body is returned on success.Cancel Auto-Merge
Cancel a scheduled auto-merge for a pull request. Endpoint:DELETE /api/v1/repos/{owner}/{repo}/pulls/{index}/merge
Path Parameters
Owner of the repository
Name of the repository
Index number of the pull request
Example Request
Response (204 No Content)
No response body is returned on success.Get Pull Request by Base and Head
Get a pull request by specifying base and head branches. Endpoint:GET /api/v1/repos/{owner}/{repo}/pulls/{base}/{head}
Path Parameters
Owner of the repository
Name of the repository
Base branch name
Head branch. Format:
branch or username:branch for forksExample Request
Get Pull Request Commits
Get all commits for a pull request. Endpoint:GET /api/v1/repos/{owner}/{repo}/pulls/{index}/commits
Query Parameters
Page number for pagination
Number of items per page
Include verification for every commit
Include list of affected files for every commit
Example Request
Get Pull Request Files
Get all changed files in a pull request. Endpoint:GET /api/v1/repos/{owner}/{repo}/pulls/{index}/files
Query Parameters
Skip to given file
Whitespace behavior. Options:
ignore-all, ignore-change, ignore-eol, show-allPage number for pagination
Number of items per page
Example Request
Download Diff or Patch
Download the diff or patch file for a pull request. Endpoint:GET /api/v1/repos/{owner}/{repo}/pulls/{index}.{diffType}
Path Parameters
Output format. Options:
diff, patchQuery Parameters
Whether to include binary file changes
Example Request
Error Responses
User does not have permission to perform the operation
Repository or pull request not found
Operation not allowed (e.g., cannot merge a work-in-progress PR)
Merge conflict or duplicate pull request
Validation error (e.g., invalid base/head branches)
Repository is archived and cannot be modified