Use this API to manage discussions. This includes comments, threads, and system notes about changes to an object (for example, when a milestone changes).

To manage label notes, use the resource label events API.

List all discussions for an issue

GET /api/v4/projects/{id}/issues/{noteable_id}/discussions

Lists all discussions for a specified issue.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the issue
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Create an issue discussion

POST /api/v4/projects/{id}/issues/{noteable_id}/discussions

Creates a discussion for a specified issue. Replies can be added to it later.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the issue

Request body (application/json)

PropertyTypeDescription
body
Required
StringThe content of a note
created_atStringThe creation date of the note

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Retrieve a discussion for an issue

GET /api/v4/projects/{id}/issues/{noteable_id}/discussions/{discussion_id}

Retrieves a specified discussion for an issue.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
discussion_id
Path, required
StringThe ID of a discussion
noteable_id
Path, required
IntegerThe ID of the issue

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Resolve or unresolve an issue discussion

PUT /api/v4/projects/{id}/issues/{noteable_id}/discussions/{discussion_id}

Resolves or unresolves a specified issue discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the issue
discussion_id
Path, required
StringThe ID of a discussion

Request body (application/json)

PropertyTypeDescription
resolved
Required
BooleanMark discussion resolved/unresolved

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

List comments in an issue discussion

GET /api/v4/projects/{id}/issues/{noteable_id}/discussions/{discussion_id}/notes

Lists the comments in a specified issue discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
discussion_id
Path, required
StringThe ID of a discussion
noteable_id
Path, required
IntegerThe ID of the issue

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Add a comment to an issue discussion

POST /api/v4/projects/{id}/issues/{noteable_id}/discussions/{discussion_id}/notes

Adds a comment to a specified issue discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the issue
discussion_id
Path, required
StringThe ID of a discussion

Request body (application/json)

PropertyTypeDescription
body
Required
StringThe content of a note
created_atStringThe creation date of the note

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesNote
400Bad Request—
404Not Found—

Retrieve a comment from an issue discussion

GET /api/v4/projects/{id}/issues/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Retrieves a specified comment from a issue discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the issue
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

Update a comment in an issue discussion

PUT /api/v4/projects/{id}/issues/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Updates or changes the status of a specified comment in a issue discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the issue
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Request body (application/json)

PropertyTypeDescription
bodyStringThe content of a note
resolvedBooleanMark note resolved/unresolved

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

Delete a comment from an issue discussion

DELETE /api/v4/projects/{id}/issues/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Deletes a specified comment from a issue discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the issue
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

List all discussions for a merge request

GET /api/v4/projects/{id}/merge_requests/{noteable_id}/discussions

Lists all discussions for a specified merge request.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the merge request
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Create a merge request discussion

POST /api/v4/projects/{id}/merge_requests/{noteable_id}/discussions

Creates a discussion for a specified merge request. Replies can be added to it later.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the merge request

Request body (application/json)

PropertyTypeDescription
body
Required
StringThe content of a note
created_atStringThe creation date of the note
positionObjectPosition when creating a note
position.base_sha
Required
StringBase commit SHA in the source branch
position.head_sha
Required
StringSHA referencing HEAD of this merge request
position.heightIntegerHeight of the image
position.line_rangeObjectMulti-line start and end
position.line_range.endObjectEnd line for a multi-line note
position.line_range.end.line_codeStringEnd line code for multi-line note
position.line_range.end.new_lineIntegerEnd new_line line number
position.line_range.end.old_lineIntegerEnd old_line line number
position.line_range.end.typeStringEnd line type for multi-line note
position.line_range.startObjectStart line for a multi-line note
position.line_range.start.line_codeStringStart line code for multi-line note
position.line_range.start.new_lineIntegerStart new_line line number
position.line_range.start.old_lineIntegerStart old_line line number
position.line_range.start.typeStringStart line type for multi-line note
position.new_lineIntegerLine number after change
position.new_pathStringFile path after change
position.old_lineIntegerLine number before change
position.old_pathStringFile path before change
position.position_type
Required
StringType of the position reference
Allowed values: text, image, file
Minimum length: 1
position.start_sha
Required
StringSHA referencing commit in target branch
position.widthIntegerWidth of the image
position.xIntegerX coordinate in the image
position.yIntegerY coordinate in the image

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Retrieve a discussion for a merge request

GET /api/v4/projects/{id}/merge_requests/{noteable_id}/discussions/{discussion_id}

Retrieves a specified discussion for a merge request.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
discussion_id
Path, required
StringThe ID of a discussion
noteable_id
Path, required
IntegerThe ID of the merge request

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Resolve or unresolve a merge request discussion

PUT /api/v4/projects/{id}/merge_requests/{noteable_id}/discussions/{discussion_id}

Resolves or unresolves a specified merge request discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the merge request
discussion_id
Path, required
StringThe ID of a discussion

Request body (application/json)

PropertyTypeDescription
resolved
Required
BooleanMark discussion resolved/unresolved

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

List comments in a merge request discussion

GET /api/v4/projects/{id}/merge_requests/{noteable_id}/discussions/{discussion_id}/notes

Lists the comments in a specified merge request discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
discussion_id
Path, required
StringThe ID of a discussion
noteable_id
Path, required
IntegerThe ID of the merge request

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Add a comment to a merge request discussion

POST /api/v4/projects/{id}/merge_requests/{noteable_id}/discussions/{discussion_id}/notes

Adds a comment to a specified merge request discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the merge request
discussion_id
Path, required
StringThe ID of a discussion

Request body (application/json)

PropertyTypeDescription
body
Required
StringThe content of a note
created_atStringThe creation date of the note

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesNote
400Bad Request—
404Not Found—

Retrieve a comment from a merge request discussion

GET /api/v4/projects/{id}/merge_requests/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Retrieves a specified comment from a merge request discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the merge request
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

Update a comment in a merge request discussion

PUT /api/v4/projects/{id}/merge_requests/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Updates or changes the status of a specified comment in a merge request discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the merge request
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Request body (application/json)

PropertyTypeDescription
bodyStringThe content of a note
resolvedBooleanMark note resolved/unresolved

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

Delete a comment from a merge request discussion

DELETE /api/v4/projects/{id}/merge_requests/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Deletes a specified comment from a merge request discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the merge request
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

List all discussions for a commit

GET /api/v4/projects/{id}/repository/commits/{noteable_id}/discussions

Lists all discussions for a specified commit.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
StringThe ID of the commit
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Create a commit discussion

POST /api/v4/projects/{id}/repository/commits/{noteable_id}/discussions

Creates a discussion for a specified commit. Replies can be added to it later.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
StringThe ID of the commit

Request body (application/json)

PropertyTypeDescription
body
Required
StringThe content of a note
created_atStringThe creation date of the note
positionObjectPosition when creating a note
position.base_sha
Required
StringBase commit SHA in the source branch
position.head_sha
Required
StringSHA referencing HEAD of this merge request
position.heightIntegerHeight of the image
position.new_lineIntegerLine number after change
position.new_pathStringFile path after change
position.old_lineIntegerLine number before change
position.old_pathStringFile path before change
position.position_type
Required
StringType of the position reference
Allowed values: text, image, file
Minimum length: 1
position.start_sha
Required
StringSHA referencing commit in target branch
position.widthIntegerWidth of the image
position.xIntegerX coordinate in the image
position.yIntegerY coordinate in the image

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Retrieve a discussion for a commit

GET /api/v4/projects/{id}/repository/commits/{noteable_id}/discussions/{discussion_id}

Retrieves a specified discussion for a commit.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
discussion_id
Path, required
StringThe ID of a discussion
noteable_id
Path, required
StringThe ID of the commit

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

List comments in a commit discussion

GET /api/v4/projects/{id}/repository/commits/{noteable_id}/discussions/{discussion_id}/notes

Lists the comments in a specified commit discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
discussion_id
Path, required
StringThe ID of a discussion
noteable_id
Path, required
StringThe ID of the commit

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Add a comment to a commit discussion

POST /api/v4/projects/{id}/repository/commits/{noteable_id}/discussions/{discussion_id}/notes

Adds a comment to a specified commit discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
StringThe ID of the commit
discussion_id
Path, required
StringThe ID of a discussion

Request body (application/json)

PropertyTypeDescription
body
Required
StringThe content of a note
created_atStringThe creation date of the note

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesNote
400Bad Request—
404Not Found—

Retrieve a comment from a commit discussion

GET /api/v4/projects/{id}/repository/commits/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Retrieves a specified comment from a commit discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
StringThe ID of the commit
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

Update a comment in a commit discussion

PUT /api/v4/projects/{id}/repository/commits/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Updates or changes the status of a specified comment in a commit discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
StringThe ID of the commit
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Request body (application/json)

PropertyTypeDescription
bodyStringThe content of a note
resolvedBooleanMark note resolved/unresolved

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

Delete a comment from a commit discussion

DELETE /api/v4/projects/{id}/repository/commits/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Deletes a specified comment from a commit discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
StringThe ID of the commit
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

List all discussions for a snippet

GET /api/v4/projects/{id}/snippets/{noteable_id}/discussions

Lists all discussions for a specified snippet.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the snippet
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Create a snippet discussion

POST /api/v4/projects/{id}/snippets/{noteable_id}/discussions

Creates a discussion for a specified snippet. Replies can be added to it later.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the snippet

Request body (application/json)

PropertyTypeDescription
body
Required
StringThe content of a note
created_atStringThe creation date of the note

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Retrieve a discussion for a snippet

GET /api/v4/projects/{id}/snippets/{noteable_id}/discussions/{discussion_id}

Retrieves a specified discussion for a snippet.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
discussion_id
Path, required
StringThe ID of a discussion
noteable_id
Path, required
IntegerThe ID of the snippet

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

List comments in a snippet discussion

GET /api/v4/projects/{id}/snippets/{noteable_id}/discussions/{discussion_id}/notes

Lists the comments in a specified snippet discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
discussion_id
Path, required
StringThe ID of a discussion
noteable_id
Path, required
IntegerThe ID of the snippet

Responses

CodeDescriptionSchema
200OKAPIEntitiesDiscussion
400Bad Request—
404Not Found—

Add a comment to a snippet discussion

POST /api/v4/projects/{id}/snippets/{noteable_id}/discussions/{discussion_id}/notes

Adds a comment to a specified snippet discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the snippet
discussion_id
Path, required
StringThe ID of a discussion

Request body (application/json)

PropertyTypeDescription
body
Required
StringThe content of a note
created_atStringThe creation date of the note

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesNote
400Bad Request—
404Not Found—

Retrieve a comment from a snippet discussion

GET /api/v4/projects/{id}/snippets/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Retrieves a specified comment from a snippet discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the snippet
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

Update a comment in a snippet discussion

PUT /api/v4/projects/{id}/snippets/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Updates or changes the status of a specified comment in a snippet discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the snippet
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Request body (application/json)

PropertyTypeDescription
bodyStringThe content of a note
resolvedBooleanMark note resolved/unresolved

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

Delete a comment from a snippet discussion

DELETE /api/v4/projects/{id}/snippets/{noteable_id}/discussions/{discussion_id}/notes/{note_id}

Deletes a specified comment from a snippet discussion.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of a project
noteable_id
Path, required
IntegerThe ID of the snippet
discussion_id
Path, required
StringThe ID of a discussion
note_id
Path, required
IntegerThe ID of a note

Responses

CodeDescriptionSchema
200OKAPIEntitiesNote
400Bad Request—
404Not Found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesDiscussion

PropertyTypeDescription
idStringExample: 6a9c1750b37d513a43987b574953fceb50b03ce7
individual_noteBooleanExample: false
notesAPIEntitiesNote—
resolvableBoolean—
resolvedBoolean—

APIEntitiesNote

PropertyTypeDescription
authorAPIEntitiesUserBasic—
bodyStringExample: Note body.
commands_changesObject—
commit_idStringExample: 7b09ce7e6f80347baf0316c8c94cdba9a0a7e91d
confidentialBooleanExample: false
created_atString (date-time)Example: 2022-01-31T15:10:44.988Z
idInteger (int64)Example: 1
importedBooleanExample: false
imported_fromStringExample: github
internalBooleanExample: false
noteable_idInteger (int64)Example: 1
noteable_iidIntegerExample: 1
noteable_typeStringExample: Issue
positionObject—
project_idInteger (int64)Example: 1
resolvableBooleanExample: false
resolvedBooleanExample: false
resolved_atString (date-time)Example: 2022-01-31T15:10:44.988Z
resolved_byAPIEntitiesUserBasic—
suggestionsAPIEntitiesSuggestion—
systemBooleanExample: false
typeStringExample: DiscussionNote
updated_atString (date-time)Example: 2022-01-31T15:10:44.988Z

APIEntitiesSuggestion

PropertyTypeDescription
appliableBooleanExample: true
appliedBooleanExample: false
from_contentStringExample: Original content
from_lineIntegerExample: 1
idInteger (int64)Example: 1
to_contentStringExample: New content
to_lineIntegerExample: 1

APIEntitiesUserBasic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringExample: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)Example: 1
lockedBoolean—
nameStringExample: Administrator
public_emailStringExample: john@example.com
stateStringExample: active
usernameStringExample: admin
web_urlStringExample: https://gitlab.example.com/root