Merge a pull request
POST
/repos/{owner}/{repo}/pulls/{index}/merge
const url = 'https://gitea.com/api/v1/repos/example/example/pulls/1/merge';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"Do":"merge","MergeCommitID":"example","MergeMessageField":"example","MergeTitleField":"example","delete_branch_after_merge":true,"force_merge":true,"head_commit_id":"example","merge_when_checks_succeed":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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 '{ "Do": "merge", "MergeCommitID": "example", "MergeMessageField": "example", "MergeTitleField": "example", "delete_branch_after_merge": true, "force_merge": true, "head_commit_id": "example", "merge_when_checks_succeed": true }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”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
Request Body
Section titled “Request Body”MergePullRequestForm form for merging Pull Request
object
Do
required
string
MergeCommitID
string
MergeMessageField
string
MergeTitleField
string
delete_branch_after_merge
boolean
force_merge
boolean
head_commit_id
string
merge_when_checks_succeed
boolean
MergePullRequestForm form for merging Pull Request
object
Do
required
string
MergeCommitID
string
MergeMessageField
string
MergeTitleField
string
delete_branch_after_merge
boolean
force_merge
boolean
head_commit_id
string
merge_when_checks_succeed
boolean
Responses
Section titled “Responses”APIEmpty is an empty response
Media typeapplication/json
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
Headers
Section titled “Headers”message
string
url
string
APIRepoArchivedError is an error that is raised when an archived repo should be modified
Media typeapplication/json
Headers
Section titled “Headers”message
string
url
string