Visual Review discussions API (deprecated)

Version history
caution
This feature was deprecated in GitLab 15.8 and is planned for removal in 17.0. This change is a breaking change.

Visual Review discussions are notes on merge requests sent as feedback from Visual Reviews.

Create new merge request thread

Creates a new thread to a single project merge request. This is similar to creating a note but other comments (replies) can be added to it later.

POST /projects/:id/merge_requests/:merge_request_iid/visual_review_discussions

Parameters:

AttributeTypeRequiredDescription
idinteger/stringyesThe ID or URL-encoded path of the project
merge_request_iidintegeryesThe IID of a merge request
bodystringyesThe content of the thread
positionhashnoPosition when creating a diff note
position[base_sha]stringyesBase commit SHA in the source branch
position[start_sha]stringyesSHA referencing commit in target branch
position[head_sha]stringyesSHA referencing HEAD of this merge request
position[position_type]stringyesType of the position reference. Either text or image.
position[new_path]stringnoFile path after change
position[new_line]integernoLine number after change (Only stored for text diff notes)
position[old_path]stringnoFile path before change
position[old_line]integernoLine number before change (Only stored for text diff notes)
position[width]integernoWidth of the image (Only stored for image diff notes)
position[height]integernoHeight of the image (Only stored for image diff notes)
position[x]integernoX coordinate (Only stored for image diff notes)
position[y]integernoY coordinate (Only stored for image diff notes)
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/visual_review_discussions?body=comment"