Help Center/ CodeArts Repo/ API Reference/ APIs/ V4/ Discussion/ Updating Information Except Comments in the Merge Request's Review Comments
Updated on 2026-01-27 GMT+08:00

Updating Information Except Comments in the Merge Request's Review Comments

Function

This API is used to update information except comments in the merge request's review comments.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

codeartsrepo:repository:commentMergeRequest

Write

-

-

-

-

URI

PUT https://{hostURL}/v4/repositories/{repository_id}/merge-requests/{merge_request_iid}/discussions/{discussion_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Definition

You can query the project list to obtain the repository ID by calling the API used to query user's all repositories.

Constraints

N/A

Default Value

N/A

Value range:

1~2147483647

merge_request_iid

Yes

Integer

Definition

MR internal ID (IID).

Value range:

1~2147483647

discussion_id

Yes

String

Definition

Review comment ID, which is shared by the main comment and replies.

Range

String length: 40 characters.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token.

Constraints

N/A

Range

1–100,000 characters.

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

body

No

String

Definition

Comment content.

severity

No

String

Definition

Review comment severity.

Enumeration values:

  • suggestion

  • minor

  • major

  • fatal

assignee_id

No

String

Definition

Review comment assignee ID.

review_categories

No

String

Definition

Review comment type.

review_modules

No

String

Definition

Review comment module.

proposer_id

No

String

Definition

ID of a reviewer who gives review comments.

resolved

No

Boolean

Definition

Resolve or cancel a review comment. (Only this parameter needs to be transferred when needed.)

Response Parameters

Status code: 201

Table 4 Response body parameters

Parameter

Type

Description

id

Integer

Definition

Comment ID, which is not shared by the main comment and replies.

Value range:

1~2147483647

type

String

Definition:

Review types

Value range:

  • DiscussionNote: comment on the associated code line to be resolved

  • DiffNote: general

  • null: common comment

body

String

Definition

Comment content.

attachment

String

Definition

Attachment (deprecated).

author

UserBasicDto object

Definition

Comment author.

created_at

String

Definition

Creation time.

updated_at

String

Definition

Update time.

system

Boolean

Definition

Added by the system or not.

noteable_id

Integer

Definition

MR ID or issue ID.

Value range:

1~2147483647

noteable_type

String

Definition:

Comment type

Value range:

  • MergeRequest: review comments submitted in a merge request

  • Commit: review comments submitted on a code page or commit record

Enumeration values:

  • MergeRequest

  • Commit

commit_id

String

Definition

Commit record ID.

resolvable

Boolean

Definition

Whether need to be resolved.

is_reply

Boolean

Definition

Reply or not.

resolved_by

UserBasicDto object

Definition

Solver.

noteable_iid

Integer

Definition

MR IID or issue IID.

Value range:

1~2147483647

discussion_id

String

Definition

Review comment ID, which is shared by the main comment and replies.

repository

String

Definition

Repository path.

diff_file

String

Definition

Name of the file that contains the associated code lines.

diff

String

Definition

Code snippet associated with the lines of code.

archived

Boolean

Definition

Archived or not.

review_categories

String

Definition

Comment type key.

review_categories_cn

String

Definition

Comment type name (CN).

review_categories_en

String

Definition

MR version information.

review_modules

String

Definition

MR version information.

severity

String

Definition

Severity key.

Enumeration values:

  • suggestion

  • minor

  • major

  • fatal

severity_cn

String

Definition

Severity (CN).

Constraints

  • Suggestion

  • Minor

  • Major

  • Critical

severity_en

String

Definition

Severity.

Enumeration values:

  • Suggestion

  • Minor

  • Major

  • Fatal

file_path

String

Definition

File path (deprecated).

line

String

Definition

Line number (deprecated).

assignee

UserBasicDto object

Definition

Assignee.

proposer

UserBasicDto object

Definition

Reviewer.

position

PositionDto object

Definition

Associated code line location information.

resolved

Boolean

Definition

Resolved or not.

is_outdated

Boolean

Definition

Expired or not.

moderation_result

Boolean

Definition

Content approving result.

moderation_time

Long

Definition

Content approving time.

moderation_status

Integer

Definition

Content approving status.

Table 5 UserBasicDto

Parameter

Type

Description

id

Integer

Definition

User ID.

Value range:

1~2147483647

name

String

Definition

Username.

username

String

Definition

Username.

state

String

Definition:

User status

Value range:

  • active: available account

  • blocked: locked user

  • error: The user is not found

Enumeration values:

  • active

  • blocked

  • error

service_license_status

Integer

Service-level permission status. 0: disabled; 1: enabled

avatar_url

String

User profile picture URL

avatar_path

String

User profile picture path

email

String

User email

name_cn

String

Username (CN)

web_url

String

User homepage

nick_name

String

User alias

tenant_name

String

Tenant name

error_message

String

Definition

When some query APIs detect that the user permission in the transfer parameter is insufficient or the user does not exist, the user is returned but the field is not empty for information.

Table 6 PositionDto

Parameter

Type

Description

base_sha

String

Definition

Basic SHA value.

start_sha

String

Definition

Start SHA value.

head_sha

String

Definition

Latest SHA value.

old_path

String

Definition

Old file path.

new_path

String

Definition

New file path.

position_type

String

Definition

File type.

old_line

Integer

Definition

Old file line No.

new_line

Integer

Definition

New file line No.

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

error_msg

String

Definition

Error message.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

error_msg

String

Definition

Error message.

Example Requests

/v4/repositories/122/merge-requests/123/discussions/sasdsadsadsadasdsadasdsad

{
  "body" : "test",
  "severity" : "suggestion",
  "assignee_id" : 9124,
  "review_categories" : "category",
  "review_modules" : "module",
  "proposer_id" : 9124,
  "resolved" : false
}

Example Responses

Status code: 201

OK

{
  "id" : 1399939,
  "type" : "DiffNote",
  "body" : "test",
  "author" : {
    "id" : 1130646,
    "name" : "example_name",
    "username" : "7806db92698840d794a70e53e1295cb7",
    "state" : "active",
    "avatar_url" : null,
    "email" : "7806db92698840d794a70e53e1295cb7@example.com",
    "name_cn" : "example_name",
    "web_url" : "https://example.com/7806db92698840d794a70e53e1295cb7",
    "nick_name" : "example_name",
    "tenant_name" : "example_name"
  },
  "created_at" : "2025-01-06T14:54:43.000+08:00",
  "updated_at" : "2025-01-06T14:54:43.000+08:00",
  "system" : false,
  "noteable_id" : 1242586,
  "noteable_type" : "MergeRequest",
  "resolvable" : true,
  "is_reply" : false,
  "noteable_iid" : 1,
  "discussion_id" : "3da6d31d0b3d426de6b183d604de50b6b972d87c",
  "repository" : "07c8683c4bb0445393c5eab0ea354003/mr_test",
  "diff_file" : "README.md",
  "diff" : "@@ -20 +11 @@\\n\\\\ No newline at end of file\\n+# mr_test\\n",
  "archived" : false,
  "review_categories_cn" : null,
  "review_categories_en" : null,
  "severity" : "suggestion",
  "severity_cn" : "Suggestions",
  "severity_en" : "Suggestion",
  "assignee" : {
    "id" : 1130646,
    "name" : "example_name",
    "username" : "7806db92698840d794a70e53e1295cb7",
    "state" : "active",
    "avatar_url" : null,
    "email" : "7806db92698840d794a70e53e1295cb7@example.com",
    "name_cn" : "example_name",
    "web_url" : "https://example.com/7806db92698840d794a70e53e1295cb7",
    "nick_name" : "example_name",
    "tenant_name" : "example_name"
  },
  "proposer" : {
    "id" : 1130646,
    "name" : "example_name",
    "username" : "7806db92698840d794a70e53e1295cb7",
    "state" : "active",
    "avatar_url" : null,
    "email" : "7806db92698840d794a70e53e1295cb7@example.com",
    "name_cn" : "example_name",
    "web_url" : "https://example.com/7806db92698840d794a70e53e1295cb7",
    "nick_name" : "example_name",
    "tenant_name" : "example_name"
  },
  "position" : {
    "base_sha" : "cdb34fb2431d57aaf6701b4026425acde1d8a84c",
    "start_sha" : "cdb34fb2431d57aaf6701b4026425acde1d8a84c",
    "head_sha" : "2032553aab2bbe1855687885da9165412b3fa3a4",
    "old_path" : "README.md",
    "new_path" : "README.md",
    "position_type" : "text",
    "new_line" : 1
  },
  "resolved" : false,
  "is_outdated" : false,
  "moderation_result" : true,
  "moderation_time" : 1736146483268,
  "moderation_status" : 0
}

Status code: 401

Unauthorized

{
  "error_code" : "DEV.00000003",
  "error_msg" : "Authentication information expired."
}

Status code: 403

Bad Request

{
  "error_code" : "CH.004403",
  "error_msg" : "Insufficient permissions. Apply for the required permissions and try again."
}

Status Codes

Status Code

Description

201

OK

401

Unauthorized

403

Bad Request

Error Codes

See Error Codes.