Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
This is the documentation of 1.26.4, which is no longer the latest release. See the latest release.

Merge a pull request

POST
/repos/{owner}/{repo}/pulls/{index}/merge
curl --request POST \
--url https://gitea.com/api/v1/repos/example/example/pulls/1/merge \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "delete_branch_after_merge": true, "do": "merge", "force_merge": true, "head_commit_id": "example", "merge_commit_id": "example", "merge_message_field": "example", "merge_title_field": "example", "merge_when_checks_succeed": true }'
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

index
required
integer format: int64

Index of the pull request to merge

Media typeapplication/json

MergePullRequestForm form for merging Pull Request

object
delete_branch_after_merge
boolean
do
required
string
Allowed values: merge rebase rebase-merge squash fast-forward-only manually-merged
force_merge
boolean
head_commit_id
string
merge_commit_id
string
merge_message_field
string
merge_title_field
string
merge_when_checks_succeed
boolean

APIEmpty is an empty response

Media typeapplication/json

APIForbiddenError is a forbidden error response

Media typeapplication/json
message
string
url
string

APINotFound is a not found empty response

Media typeapplication/json

APIEmpty is an empty response

Media typeapplication/json

APIError is error format response

Media typeapplication/json
message
string
url
string

APIRepoArchivedError is an error that is raised when an archived repo should be modified

Media typeapplication/json
message
string
url
string