Create a merge request
POST
/v3/projects/{id}/merge_requests
projects
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'http://gitlab.example.com/v3/projects//merge_requests' \
--data-urlencode 'title=' \
--data-urlencode 'source_branch=' \
--data-urlencode 'target_branch='
响应示例响应示例
{
"id": "string",
"iid": "string",
"project_id": "string",
"title": "string",
"description": "string",
"state": "string",
"created_at": "string",
"updated_at": "string",
"target_branch": "string",
"source_branch": "string",
"upvotes": "string",
"downvotes": "string",
"author": {
"name": "string",
"username": "string",
"id": "string",
"state": "string",
"avatar_url": "string",
"web_url": "string"
},
"assignee": {
"name": "string",
"username": "string",
"id": "string",
"state": "string",
"avatar_url": "string",
"web_url": "string"
},
"source_project_id": "string",
"target_project_id": "string",
"labels": "string",
"work_in_progress": "string",
"milestone": {
"id": "string",
"iid": "string",
"project_id": "string",
"title": "string",
"description": "string",
"state": "string",
"created_at": "string",
"updated_at": "string",
"due_date": "string",
"start_date": "string"
},
"merge_when_build_succeeds": "string",
"merge_status": "string",
"sha": "string",
"merge_commit_sha": "string",
"subscribed": "string",
"user_notes_count": "string",
"should_remove_source_branch": "string",
"force_remove_source_branch": "string",
"web_url": "string"
}
请求参数
Path 参数
id
string
必需
Body 参数application/x-www-form-urlencoded
title
string
必需
source_branch
string
必需
target_branch
string
必需
target_project_id
integer <int32>
可选
description
string
可选
assignee_id
integer <int32>
可选
milestone_id
integer <int32>
可选
labels
string
可选
remove_source_branch
boolean
可选
返回响应
修改于 2025-04-16 11:00:09