Skip to content

Update a draft note

PUT
/api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes/{draft_note_id}

Updates a draft note for a specified merge request.

id
required
string

The ID of a project.

merge_request_iid
required
integer

The ID of a merge request.

draft_note_id
required
integer

The ID of a draft note

Media type application/json
object
note

The content of a note.

string
nullable
position

Position when creating a note

object
base_sha
required

Base commit SHA in the source branch

string
nullable
start_sha
required

SHA referencing commit in target branch

string
nullable
head_sha
required

SHA referencing HEAD of this merge request

string
nullable
position_type
required

Type of the position reference

string
>= 1 characters
Allowed values: text image file
new_path

File path after change

string
nullable
new_line

Line number after change

integer
nullable
old_path

File path before change

string
nullable
old_line

Line number before change

integer
nullable
width

Width of the image

integer
nullable
height

Height of the image

integer
nullable
x

X coordinate in the image

integer
nullable
y

Y coordinate in the image

integer
nullable
line_range

Line range for a multi-line note

object
start

Start line for a multi-line note

object
line_code

Start line code for multi-line note

string
nullable
type

Start line type for multi-line note

string
nullable
old_line

Start old_line line number

integer
nullable
new_line

Start new_line line number

integer
nullable
end

End line for a multi-line note

object
line_code

End line code for multi-line note

string
nullable
type

End line type for multi-line note

string
nullable
old_line

End old_line line number

integer
nullable
new_line

End new_line line number

integer
nullable

OK

Media type application/json
object
id
integer format: int64
author_id
integer format: int64
merge_request_id
integer format: int64
resolve_discussion
boolean
discussion_id
string
note
string
commit_id
string
line_code
string
position
object
Example
{
"id": 2,
"author_id": 4,
"merge_request_id": 52,
"resolve_discussion": true,
"discussion_id": "6a9c1750b37d513a43987b574953fceb50b03ce7",
"note": "This is a note",
"commit_id": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
"line_code": "1c497fbb3a46b78edf0_2_4",
"position": {
"base_sha": "aa149113",
"start_sha": "b3a0a8c4",
"head_sha": "be3020c7",
"old_path": "example.md",
"new_path": "example.md",
"position_type": "text",
"old_line": 2,
"new_line": 4,
"line_range": {
"start": {
"line_code": "1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_2_4",
"type": null,
"old_line": 2,
"new_line": 4
},
"end": {
"line_code": "1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_2_4",
"type": null,
"old_line": 2,
"new_line": 4
}
}
}
}

Bad Request

Unauthorized

Not found