跳到主要内容

Pull Request Event

Description of parameters for the Merge Request event

Request Headers

Parameter NameTypeDescription
User-Agentstring
Content-Typestring
X-GitCode-EventstringEvent type, Merge Request Hook represents the merge request event
X-GitCode-DeliverystringUnique request ID

Request Parameters

Parameter NameParameter TypeDescription
produce_random_idstringRandomly generated event ID
event_typestringEvent type, here is "merge_request"
object_kindstringObject type, here is "merge_request"
git_branchstringGit branch name
git_commit_nostringCurrent commit SHA
git_target_branch_commit_nostringTarget branch commit SHA
manual_buildboolean
virtual_merge_buildboolean
uuidstringUnique identifier for the event
labelsarrayList of labels
issuesarrayList of associated issues
object_attributes.idintegerMerge request ID
object_attributes.iidintegerMerge request ID in the project
object_attributes.titlestringMerge request title
object_attributes.descriptionstringMerge request description
object_attributes.statestringMerge request state (opened: open, merged: merged, closed: closed)
object_attributes.created_atstringCreation time
object_attributes.updated_atstringUpdate time
object_attributes.actionstringAction type (open: opened, update: updated, merge: merged, close: closed)
object_attributes.work_in_progressbooleanWhether it's an ongoing work
object_attributes.merge_statusstringMerge status (unchecked: unchecked)
object_attributes.merge_when_pipeline_succeedsbooleanWhether to automatically merge after pipeline succeeds
object_attributes.source_branchstringSource branch name
object_attributes.target_branchstringTarget branch name
object_attributes.source_project_idintegerSource project ID
object_attributes.target_project_idintegerTarget project ID
object_attributes.author_idintegerAuthor ID
object_attributes.urlstringWeb access URL for the merge request
object_attributes.need_reviewbooleanWhether review is needed
object_attributes.need_testbooleanWhether testing is needed
object_attributes.conflictbooleanWhether there are conflicts
object_attributes.total_time_spentinteger
object_attributes.oldrevstringOld version commit number
object_attributes.update_reasonstringReason for update
object_attributes.reviewer_listarrayReviewer list
object_attributes.assignee_listarrayAssignee list
object_attributes.last_commit.idstringLast commit SHA value
object_attributes.last_commit.messagestringLast commit message
object_attributes.last_commit.timestampstringLast commit timestamp
object_attributes.last_commit.urlstringLast commit details page URL
object_attributes.last_commit.author.namestringLast commit author name
object_attributes.last_commit.author.emailstringLast commit author email
object_attributes.target_branch_commit.idstringTarget branch commit SHA value
object_attributes.target_branch_commit.messagestringTarget branch commit message
object_attributes.target_branch_commit.timestampstringTarget branch commit timestamp
object_attributes.target_branch_commit.urlstringTarget branch commit details page URL
object_attributes.target_branch_commit.author.namestringTarget branch commit author name
object_attributes.target_branch_commit.author.emailstringTarget branch commit author email
object_attributes.merge_params.force_remove_source_branchbooleanWhether to force delete the source branch
object_attributes.source.idintegerSource project ID
object_attributes.source.namestringSource project name
object_attributes.source.path_with_namespacestringSource project path with namespace
object_attributes.source.namespacestringSource project namespace
object_attributes.source.visibility_levelintegerSource project visibility level (0: private, 1: public)
object_attributes.source.web_urlstringSource project web access URL
object_attributes.source.urlstringSource project Git repository URL
object_attributes.source.http_urlstringSource project HTTP clone address
object_attributes.source.ssh_urlstringSource project SSH clone address
object_attributes.source.git_http_urlstringSource project Git HTTP clone address
object_attributes.source.git_ssh_urlstringSource project Git SSH clone address
object_attributes.source.homepagestringSource project homepage
object_attributes.source.avatar_urlstringSource project avatar URL
object_attributes.source.default_branchstringSource project default branch
object_attributes.targetobjectTarget project information (fields same as source)
object_attributes.author.idintegerAuthor ID
object_attributes.author.namestringAuthor name
object_attributes.author.usernamestringAuthor login name
object_attributes.author.emailstringAuthor email
object_attributes.author.avatar_urlstringAuthor avatar URL
changes.merge_params.currentstringCurrent merge parameter settings
changes.patchset_locked.currentboolean
changes.merge_when_pipeline_succeeds.currentbooleanCurrent setting for automatic merging after pipeline succeeds
changes.iid.currentintegerCurrent merge request IID
changes.target_branch.currentstringCurrent target branch
changes.created_at.currentstringCurrent creation time
changes.description.currentstringCurrent description
changes.close_issue_when_merge.currentbooleanWhether to automatically close associated issues when merged
changes.moderation_result.currentboolean
changes.source_project_id.currentintegerCurrent source project ID
changes.title.currentstringCurrent title
changes.current_patchset_id.currentinteger
changes.source_branch.currentstringCurrent source branch
changes.squash.currentbooleanWhether to squash commits currently
changes.updated_at.currentstringCurrent update time
changes.merge_status.currentstringCurrent merge status
changes.moderation_time.currentintegerCurrent moderation time
changes.latest_merge_request_diff_id.currentintegerCurrent latest merge request diff ID
changes.id.currentintegerCurrent merge request ID
changes.state.currentstringCurrent state
changes.author_id.currentintegerCurrent author ID
changes.target_project_id.currentintegerCurrent target project ID
projectobjectProject information (fields same as object_attributes.source)
repositoryobjectRepository information (fields same as object_attributes.source)
userobjectUser information triggering the event (fields same as object_attributes.author)

Request Parameters Example

{
"produce_random_id": "f2378f237c994e368e28b40e25210a97",
"event_type": "merge_request",
"object_kind": "merge_request",
"object_attributes": {
"id": 6830111,
"iid": 27,
"title": "update: Update file README.md",
"description": "update: Update file README.md",
"state": "opened",
"created_at": "2025-05-07T14:43:39+08:00",
"updated_at": "2025-05-07T14:43:40+08:00",
"action": "open",
"work_in_progress": false,
"merge_status": "unchecked",
"merge_when_pipeline_succeeds": false,
"source_branch": "test333",
"target_branch": "main",
"source_project_id": 1848674,
"target_project_id": 1848674,
"author_id": 173794,
"url": "https://gitcode.com/xiaogang_o/test/merge_requests/27",
"need_review": false,
"need_test": false,
"conflict": false,
"total_time_spent": 0,
"merge_params": {
"force_remove_source_branch": false
},
"reviewer_list": [],
"assignee_list": [],
"oldrev": "",
"update_reason": "",
"last_commit": {
"id": "23adec6d9afeb011992b73d700c854ee9388205f",
"message": "update: Update file README.md Signed-off-by: xiaogang <xiaogang@csdn.net>",
"timestamp": "2024-12-06T06:46:48Z",
"url": "https://gitcode.com/xiaogang_o/test/commits/detail/23adec6d9afeb011992b73d700c854ee9388205f",
"author": {
"name": "xiaogang",
"email": "xiaogang@csdn.net"
}
}
},
"changes": {
"merge_params": {
"current": "force_remove_source_branch: false"
},
"patchset_locked": {
"current": false
},
"squash": {
"current": false
},
"close_issue_when_merge": {
"current": false
}
},
"project": {
"id": 1848674,
"name": "test",
"web_url": "https://gitcode.com/xiaogang_o/test",
"git_ssh_url": "git@gitcode.com:xiaogang_o/test.git",
"git_http_url": "https://gitcode.com/xiaogang_o/test.git",
"namespace": "xiaogang_o",
"visibility_level": 0,
"path_with_namespace": "xiaogang_o/test",
"default_branch": "main"
},
"user": {
"id": 173794,
"name": "xiaogang_o",
"username": "xiaogang_o",
"email": "xiaogang@csdn.net",
"avatar_url": "https://cdn-img.gitcode.com/ee/ca/756863eec250a6a067148d4d4fe71d28c3b9716a6f79c03a9f460543fa3dc838.jpg?time=1711433667506"
},
"manual_build": false,
"virtual_merge_build": true,
"git_branch": "merge-requests/27/merge",
"git_commit_no": "7083553a6d16960c879dd601db307b565f2994bb",
"git_target_branch_commit_no": "d55f9d34de9537bddaae80d6dcfe07aaa15e957a",
"uuid": "27_637deb9c-5c95-480f-8530-4d91006c72df"
}