Updated on 2026-01-08 GMT+08:00

Replying to an MR Review

Description

This API is used to reply to an MR review.

URI

POST /v2/repositories/{repository_id}/merge_requests/{merge_request_iid}/discussions/{discussion_id}/notes

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Repository short ID

Minimum value: 1

Maximum value: 2,147,483,647

merge_request_iid

Yes

Integer

MR No.

Minimum value: 1

Maximum value: 2,147,483,647

discussion_id

Yes

String

Comment ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

body

Yes

String

Review content

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Response error

result

NoteDto object

Response result

status

String

Response status

Table 5 Error

Parameter

Type

Description

code

String

Error codes

message

String

Error message

Table 6 NoteDto

Parameter

Type

Description

id

Integer

note id

Minimum value: 1

Maximum value: 2,147,483,647

type

String

Note type

body

String

Review content

attachment

String

Attachment

author

UserBasicDto object

Author

created_at

String

Creation time

updated_at

String

Update time

system

Boolean

Whether the log is generated by the system

noteable_id

Integer

Target ID

Minimum value: 1

Maximum value: 2,147,483,647

noteable_type

String

Object type

commit_id

String

Associated commit ID

resolvable

Boolean

Whether can be resolved

is_reply

Boolean

Whether the review is replied

resolved_by

UserBasicDto object

Solver

noteable_iid

Integer

Target No.

Minimum value: 1

Maximum value: 2,147,483,647

discussion_id

String

Discussion ID

project

String

Project

diff_file

String

Changed file

diff

String

Changed content

archived

Boolean

Whether it is archived

review_categories

String

Review type

review_categories_cn

String

Review type in Chinese

review_categories_en

String

Review type

review_modules

String

Review module

severity

String

Severity

severity_cn

String

Severity in Chinese

severity_en

String

Severity

file_path

String

File path

line

String

Line No.

assignee

UserBasicDto object

Assignee

proposer

UserBasicDto object

Proposer

position

PositionDto object

Associated code location

resolved

Boolean

Whether it is resolved

is_outdated

Boolean

Whether it is outdated

Table 7 UserBasicDto

Parameter

Type

Description

id

Integer

User ID

Minimum value: 1

Maximum value: 2,147,483,647

name

String

Name

username

String

Username

state

String

Status

avatar_url

String

Avatar URL

avatar_path

String

Avatar path

email

String

Email

name_cn

String

Name in Chinese

web_url

String

Homepage

nick_name

String

Alias

tenant_name

String

Tenant name

Table 8 PositionDto

Parameter

Type

Description

base_sha

String

Base commit node of the source branch

start_sha

String

Latest commit node of the target branch

head_sha

String

Latest commit node of the source branch

old_path

String

Old file path

new_path

String

New file path

position_type

String

Change type

old_line

Integer

Old line No.

new_line

Integer

New line No.

Request Examples

POST https://{endpoint}/v2/repositories/{repository_id}/merge_requests/{merge_request_iid}/discussions/{discussion_id}/notes

{
  "body" : "Reply content"
}

Response Examples

Status code: 200

Request succeeded

{
  "result" : {
    "id" : 2111886200,
    "type" : "DiffNote",
    "body" : "Review content",
    "author" : {
      "id" : 1234,
      "name" : "beta",
      "username" : "c369c68f1ff84679b5a8ed904d8bff1c",
      "state" : "active",
      "name_cn" : "beta"
    },
    "created_at" : "2023-06-01T17:05:12.000+08:00",
    "updated_at" : "2023-06-01T17:05:12.000+08:00",
    "system" : false,
    "noteable_id" : 19387,
    "noteable_type" : "MergeRequest",
    "resolvable" : true,
    "is_reply" : true,
    "noteable_iid" : 2,
    "discussion_id" : "8bbe6d4e797169c4c1ce56507fdf1abc11f95601",
    "project" : "DevOpsqlcylxm00004/project-test",
    "diff_file" : "7",
    "diff" : "@@ -0,0 +1,0 @@\n+7",
    "archived" : false,
    "review_categories" : "regulations",
    "review_categories_cn" : "Programming regulations",
    "review_categories_en" : "Regulations",
    "review_modules" : "aaa,bbb",
    "severity" : "suggestion",
    "severity_cn" : "Suggestion",
    "severity_en" : "Suggestion",
    "assignee" : {
      "id" : 1234,
      "name" : "beta",
      "username" : "c369c68f1ff84679b5a8ed904d8bff1c",
      "state" : "active",
      "name_cn" : "beta"
    },
    "proposer" : {
      "id" : 1234,
      "name" : "beta",
      "username" : "c369c68f1ff84679b5a8ed904d8bff1c",
      "state" : "active",
      "name_cn" : "beta"
    },
    "position" : {
      "base_sha" : "973bcc0211c32dbaa8473561c6767f74e1a81471",
      "start_sha" : "973bcc0211c32dbaa8473561c6767f74e1a81471",
      "head_sha" : "f5bf0230f9b996ed6c0d64d2b2fef789d91b164c",
      "old_path" : "7",
      "new_path" : "7",
      "position_type" : "text",
      "new_line" : 1
    },
    "resolved" : false,
    "is_outdated" : false
  },
  "status" : "success"
}

Status Codes

Status Codes

Description

200

Request succeeded

Error Codes

See Error Codes.