[Skip to main content](https://docs.gitlab.com/api/discussions/#skipTarget) [Go to GitLab Docs homepage](https://docs.gitlab.com/)
`/`
[What's new?](https://about.gitlab.com/releases/whats-new/)
English
  * Language
  * English
  * 日本語


v18.10
  *     * [18.10 (not yet released)](https://docs.gitlab.com/api/discussions/)
  *     * [18.9 (recently released)](https://docs.gitlab.com/18.9/api/discussions/)
    * [18.8](https://docs.gitlab.com/18.8/api/discussions/)
    * [18.7](https://archives.docs.gitlab.com/18.7/api/discussions/)
  *     * [17.11](https://archives.docs.gitlab.com/17.11/api/discussions/)
    * [16.11](https://archives.docs.gitlab.com/16.11/ee/api/discussions.html)
  *     * [Archives](https://docs.gitlab.com/archives)


Select theme and layout
  * Light mode
  * Dark mode
  * Auto


  * Fixed width
  * Fluid width


[What's new?](https://about.gitlab.com/releases/whats-new/) [Get free trial](https://gitlab.com/-/trial_registrations/new?glm_source=docs.gitlab.com&amp;glm_content=navigation-cta-docs)
Toggle menu
  * [Use GitLab](https://docs.gitlab.com/user/)
  * [GitLab Duo](https://docs.gitlab.com/user/gitlab_duo/)
  * [Extend](https://docs.gitlab.com/api/)
  * [Install](https://docs.gitlab.com/install/)
  * [Administer](https://docs.gitlab.com/administration/)
  * [Subscribe](https://docs.gitlab.com/subscriptions/)
  * [Contribute](https://docs.gitlab.com/development/)
  * [Solutions](https://docs.gitlab.com/solutions/)


Select a topicUse GitLab GitLab Duo Extend Install Administer Subscribe Contribute Solutions
[Getting started](https://docs.gitlab.com/api/get_started/get_started_extending/)
[Tutorials](https://docs.gitlab.com/tutorials/develop/)
[Integrations](https://docs.gitlab.com/integration/)
[Webhooks](https://docs.gitlab.com/user/project/integrations/webhooks/)
[REST API](https://docs.gitlab.com/api/rest/)
[Resources](https://docs.gitlab.com/api/api_resources/)
[.gitignore (templates)](https://docs.gitlab.com/api/templates/gitignores/)
[.gitlab-ci.yml (templates)](https://docs.gitlab.com/api/templates/gitlab_ci_ymls/)
[Access requests](https://docs.gitlab.com/api/access_requests/)
[Agent for Kubernetes](https://docs.gitlab.com/api/cluster_agents/)
[AI Catalog admin](https://docs.gitlab.com/api/admin/ai_catalog/)
[Alert management](https://docs.gitlab.com/api/alert_management_alerts/)
[Application appearance](https://docs.gitlab.com/api/appearance/)
[Application settings](https://docs.gitlab.com/api/settings/)
[Application statistics](https://docs.gitlab.com/api/statistics/)
[Applications](https://docs.gitlab.com/api/applications/)
[Attestations](https://docs.gitlab.com/api/attestations/)
[Audit events](https://docs.gitlab.com/api/audit_events/)
[Avatar](https://docs.gitlab.com/api/avatar/)
[Branches](https://docs.gitlab.com/api/branches/)
[Broadcast messages](https://docs.gitlab.com/api/broadcast_messages/)
[Cluster discovery (certificate-based) (deprecated)](https://docs.gitlab.com/api/cluster_discovery/)
[Code Suggestions](https://docs.gitlab.com/api/code_suggestions/)
[Commits](https://docs.gitlab.com/api/commits/)
[Compliance and policy settings](https://docs.gitlab.com/api/compliance_policy_settings/)
[Composer](https://docs.gitlab.com/api/packages/composer/)
[Conan v1](https://docs.gitlab.com/api/packages/conan_v1/)
[Conan v2](https://docs.gitlab.com/api/packages/conan_v2/)
[Container registry](https://docs.gitlab.com/api/container_registry/)
[Container repository protection rules](https://docs.gitlab.com/api/container_repository_protection_rules/)
[Container registry protection tag rules](https://docs.gitlab.com/api/container_registry_protection_tag_rules/)
[Container virtual registry](https://docs.gitlab.com/api/container_virtual_registries/)
[Custom attributes](https://docs.gitlab.com/api/custom_attributes/)
[Database migrations](https://docs.gitlab.com/api/database_migrations/)
[Data management](https://docs.gitlab.com/api/admin/data_management/)
[Debian](https://docs.gitlab.com/api/packages/debian/)
[Debian group distributions](https://docs.gitlab.com/api/packages/debian_group_distributions/)
[Debian project distributions](https://docs.gitlab.com/api/packages/debian_project_distributions/)
[Dependencies](https://docs.gitlab.com/api/dependencies/)
[Dependency list export](https://docs.gitlab.com/api/dependency_list_export/)
[Dependency Proxy](https://docs.gitlab.com/api/dependency_proxy/)
[Deploy keys](https://docs.gitlab.com/api/deploy_keys/)
[Deploy tokens](https://docs.gitlab.com/api/deploy_tokens/)
[Deployments](https://docs.gitlab.com/api/deployments/)
[Discussions](https://docs.gitlab.com/api/discussions/)
[Dockerfile (templates)](https://docs.gitlab.com/api/templates/dockerfiles/)
[DORA4 metrics](https://docs.gitlab.com/api/dora/metrics/)
[Emoji reactions](https://docs.gitlab.com/api/emoji_reactions/)
[Environments](https://docs.gitlab.com/api/environments/)
[Epics (deprecated)](https://docs.gitlab.com/api/epics/)
[Error tracking](https://docs.gitlab.com/api/error_tracking/)
[Events](https://docs.gitlab.com/api/events/)
[Experiments](https://docs.gitlab.com/api/experiments/)
[External status checks](https://docs.gitlab.com/api/status_checks/)
[Feature flags](https://docs.gitlab.com/api/feature_flags/)
[Feature flag user lists](https://docs.gitlab.com/api/feature_flag_user_lists/)
[Freeze periods](https://docs.gitlab.com/api/freeze_periods/)
[Geo nodes (deprecated)](https://docs.gitlab.com/api/geo_nodes/)
[Geo sites](https://docs.gitlab.com/api/geo_sites/)
[GitLab Duo Chat completions](https://docs.gitlab.com/api/chat/)
[GitLab Pages](https://docs.gitlab.com/api/pages/)
[GLQL](https://docs.gitlab.com/api/glql/)
[Go Proxy](https://docs.gitlab.com/api/packages/go_proxy/)
[Google Cloud integration](https://docs.gitlab.com/api/google_cloud_integration/)
[Groups](https://docs.gitlab.com/api/groups/)
[Helm](https://docs.gitlab.com/api/packages/helm/)
[Import](https://docs.gitlab.com/api/import/)
[Instance CI/CD variables](https://docs.gitlab.com/api/instance_level_ci_variables/)
[Invitations](https://docs.gitlab.com/api/invitations/)
[Issues](https://docs.gitlab.com/api/issues/)
[Issues (epic) (deprecated)](https://docs.gitlab.com/api/epic_issues/)
[Issues statistics](https://docs.gitlab.com/api/issues_statistics/)
[Jobs](https://docs.gitlab.com/api/jobs/)
[Job artifacts](https://docs.gitlab.com/api/job_artifacts/)
[Job token scopes](https://docs.gitlab.com/api/project_job_token_scopes/)
[Keys](https://docs.gitlab.com/api/keys/)
[License](https://docs.gitlab.com/api/license/)
[Licenses (templates)](https://docs.gitlab.com/api/templates/licenses/)
[Linked epics (deprecated)](https://docs.gitlab.com/api/linked_epics/)
[Links (issue)](https://docs.gitlab.com/api/issue_links/)
[Links (epic) (deprecated)](https://docs.gitlab.com/api/epic_links/)
[Lint .gitlab-ci.yml](https://docs.gitlab.com/api/lint/)
[Markdown](https://docs.gitlab.com/api/markdown/)
[Maven](https://docs.gitlab.com/api/packages/maven/)
[Maven virtual registry](https://docs.gitlab.com/api/maven_virtual_registries/)
[Member roles](https://docs.gitlab.com/api/member_roles/)
[Merge request approvals](https://docs.gitlab.com/api/merge_request_approvals/)
[Merge request approval settings](https://docs.gitlab.com/api/merge_request_approval_settings/)
[Merge request context commits](https://docs.gitlab.com/api/merge_request_context_commits/)
[Merge requests](https://docs.gitlab.com/api/merge_requests/)
[Merge trains](https://docs.gitlab.com/api/merge_trains/)
[Metadata](https://docs.gitlab.com/api/metadata/)
[Model registry](https://docs.gitlab.com/api/model_registry/)
[Namespaces](https://docs.gitlab.com/api/namespaces/)
[Notes (comments)](https://docs.gitlab.com/api/notes/)
[Notification settings](https://docs.gitlab.com/api/notification_settings/)
[npm](https://docs.gitlab.com/api/packages/npm/)
[NuGet](https://docs.gitlab.com/api/packages/nuget/)
[Organizations](https://docs.gitlab.com/api/organizations/)
[Packages](https://docs.gitlab.com/api/packages/)
[Pages domains](https://docs.gitlab.com/api/pages_domains/)
[Personal access tokens](https://docs.gitlab.com/api/personal_access_tokens/)
[Pipeline schedules](https://docs.gitlab.com/api/pipeline_schedules/)
[Pipeline trigger tokens](https://docs.gitlab.com/api/pipeline_triggers/)
[Pipelines](https://docs.gitlab.com/api/pipelines/)
[Plan limits](https://docs.gitlab.com/api/plan_limits/)
[Product analytics](https://docs.gitlab.com/api/product_analytics/)
[Projects](https://docs.gitlab.com/api/projects/)
[PyPI](https://docs.gitlab.com/api/packages/pypi/)
[Repositories](https://docs.gitlab.com/api/repositories/)
[Repository files](https://docs.gitlab.com/api/repository_files/)
[Repository submodules](https://docs.gitlab.com/api/repository_submodules/)
[Resource group](https://docs.gitlab.com/api/resource_groups/)
[Resource iteration events](https://docs.gitlab.com/api/resource_iteration_events/)
[Resource label events](https://docs.gitlab.com/api/resource_label_events/)
[Resource milestone events](https://docs.gitlab.com/api/resource_milestone_events/)
[Resource state events](https://docs.gitlab.com/api/resource_state_events/)
[Resource weight events](https://docs.gitlab.com/api/resource_weight_events/)
[Ruby gems](https://docs.gitlab.com/api/packages/rubygems/)
[Runners](https://docs.gitlab.com/api/runners/)
[Runner controllers](https://docs.gitlab.com/api/runner_controllers/)
[Runner controller tokens](https://docs.gitlab.com/api/runner_controller_tokens/)
[Search](https://docs.gitlab.com/api/search/)
[Search migrations](https://docs.gitlab.com/api/search_admin/)
[Secure files](https://docs.gitlab.com/api/secure_files/)
[Service accounts](https://docs.gitlab.com/api/service_accounts/)
[Service Ping](https://docs.gitlab.com/api/usage_data/)
[Sidekiq metrics](https://docs.gitlab.com/api/sidekiq_metrics/)
[Sidekiq queues](https://docs.gitlab.com/api/admin_sidekiq_queues/)
[Snippet repository storage moves](https://docs.gitlab.com/api/snippet_repository_storage_moves/)
[Snippets](https://docs.gitlab.com/api/snippets/)
[Suggestions](https://docs.gitlab.com/api/suggestions/)
[System hooks](https://docs.gitlab.com/api/system_hooks/)
[Tags](https://docs.gitlab.com/api/tags/)
[Terraform registry](https://docs.gitlab.com/api/packages/terraform-modules/)
[To-Do List](https://docs.gitlab.com/api/todos/)
[Token information](https://docs.gitlab.com/api/admin/token/)
[Topics](https://docs.gitlab.com/api/topics/)
[Users](https://docs.gitlab.com/api/users/)
[Version](https://docs.gitlab.com/api/version/)
[Virtual registries cleanup policies](https://docs.gitlab.com/api/virtual_registries_cleanup_policies/)
[Vulnerabilities](https://docs.gitlab.com/api/vulnerabilities/)
[Vulnerability archive export](https://docs.gitlab.com/api/vulnerability_archive_exports/)
[Vulnerability export](https://docs.gitlab.com/api/vulnerability_exports/)
[Vulnerability findings](https://docs.gitlab.com/api/vulnerability_findings/)
[Web commits](https://docs.gitlab.com/api/web_commits/)
[Authentication](https://docs.gitlab.com/api/rest/authentication/)
[Third-party clients](https://docs.gitlab.com/api/rest/third_party_clients/)
[Deprecations and removals](https://docs.gitlab.com/api/rest/deprecations/)
[OpenAPI](https://docs.gitlab.com/api/openapi/openapi_interactive/)
[Automate storage management](https://docs.gitlab.com/user/storage_management_automation/)
[Troubleshooting](https://docs.gitlab.com/api/rest/troubleshooting/)
[GraphQL API](https://docs.gitlab.com/api/graphql/)
[OAuth 2.0 identity provider API](https://docs.gitlab.com/api/oauth2/)
[GitLab Duo CLI (duo)](https://docs.gitlab.com/user/gitlab_duo_cli/)
[GitLab CLI (glab)](https://docs.gitlab.com/cli/)
[Editor and IDE extensions](https://docs.gitlab.com/editor_extensions/)
/
  1. [GitLab Docs](https://docs.gitlab.com/)
  2. [Extend](https://docs.gitlab.com/api/)
  3. [REST API](https://docs.gitlab.com/api/rest/)
  4. [Resources](https://docs.gitlab.com/api/api_resources/)
  5. [Discussions](https://docs.gitlab.com/api/discussions/)


* * *
# Discussions API
  * Tier: Free, Premium, Ultimate
  * Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated


Use this API to manage [discussions](https://docs.gitlab.com/user/discussions/). This includes [comments, threads](https://docs.gitlab.com/user/discussions/), and system notes about changes to an object (for example, when a milestone changes).
To manage label notes, use the [resource label events API](https://docs.gitlab.com/api/resource_label_events/).
## Understand note types in the API[](https://docs.gitlab.com/api/discussions/#understand-note-types-in-the-api "Permalink")
Not all discussion types are equally available in the API:
  * Note: A comment left on the _root_ of an issue, merge request, commit, or snippet.
  * Discussion: A collection, often called a _thread_ , of `DiscussionNotes` in an issue, merge request, commit, or snippet.
  * DiscussionNote: An individual item in a discussion on an issue, merge request, commit, or snippet. Items of type `DiscussionNote` are not returned as part of the Note API. Not available in the [Events API](https://docs.gitlab.com/api/events/).


## Discussions pagination[](https://docs.gitlab.com/api/discussions/#discussions-pagination "Permalink")
By default, `GET` requests return 20 results at a time because the API results are paginated.
Read more on [pagination](https://docs.gitlab.com/api/rest/#pagination).
## Issues[](https://docs.gitlab.com/api/discussions/#issues "Permalink")
### List project issue discussion items[](https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items "Permalink")
Gets a list of all discussion items for a single issue.
```
GET /projects/:id/issues/:issue_iid/discussions
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`issue_iid` | integer | Yes | The IID of an issue.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the following response attributes:
Attribute | Type | Description
---|---|---
`id` | string | The ID of the discussion.
`individual_note` | boolean | If `true`, an individual note or part of a discussion.
`notes` | array | Array of note objects in the discussion.
`notes[].id` | integer | The ID of the note.
`notes[].type` | string | The type of note (`DiscussionNote` or `null`).
`notes[].body` | string | The content of the note.
`notes[].author` | object | The author of the note.
`notes[].created_at` | string | When the note was created (ISO 8601 format).
`notes[].updated_at` | string | When the note was last updated (ISO 8601 format).
`notes[].system` | boolean | If `true`, a system note.
`notes[].noteable_id` | integer | The ID of the noteable object.
`notes[].noteable_type` | string | The type of the noteable object.
`notes[].project_id` | integer | The ID of the project.
`notes[].resolvable` | boolean | If `true`, the note can be resolved.
Example request:
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions"
```

Example response:
json
```
[
  {
    "id": "6a9c1750b37d513a43987b574953fceb50b03ce7",
    "individual_note": false,
    "notes": [
      {
        "id": 1126,
        "type": "DiscussionNote",
        "body": "discussion text",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-03T21:54:39.668Z",
        "updated_at": "2018-03-03T21:54:39.668Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Issue",
        "project_id": 5,
        "noteable_iid": null
      },
      {
        "id": 1129,
        "type": "DiscussionNote",
        "body": "reply to the discussion",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T13:38:02.127Z",
        "updated_at": "2018-03-04T13:38:02.127Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Issue",
        "project_id": 5,
        "noteable_iid": null,
        "resolvable": false
      }
    ]
  },
  {
    "id": "87805b7c09016a7058e91bdbe7b29d1f284a39e6",
    "individual_note": true,
    "notes": [
      {
        "id": 1128,
        "type": null,
        "body": "a single comment",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T09:17:22.520Z",
        "updated_at": "2018-03-04T09:17:22.520Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Issue",
        "project_id": 5,
        "noteable_iid": null,
        "resolvable": false
      }
    ]
  }
]
```

### Get single issue discussion item[](https://docs.gitlab.com/api/discussions/#get-single-issue-discussion-item "Permalink")
Returns a single discussion item for a specific project issue.
```
GET /projects/:id/issues/:issue_iid/discussions/:discussion_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`discussion_id` | integer | Yes | The ID of a discussion item.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`issue_iid` | integer | Yes | The IID of an issue.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the same response attributes as [List project issue discussion items](https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items).
Example request:
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/<discussion_id>"
```

### Create new issue thread[](https://docs.gitlab.com/api/discussions/#create-new-issue-thread "Permalink")
Creates a new thread to a single project issue. Similar to creating a note, but other comments (replies) can be added to it later.
```
POST /projects/:id/issues/:issue_iid/discussions
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`issue_iid` | integer | Yes | The IID of an issue.
`created_at` | string | No | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights.
If successful, returns [`201 Created`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the same response attributes as [List project issue discussion items](https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items).
Example request:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions?body=comment"
```

### Add note to existing issue thread[](https://docs.gitlab.com/api/discussions/#add-note-to-existing-issue-thread "Permalink")
Adds a new note to the thread. This can also [create a thread from a single comment](https://docs.gitlab.com/user/discussions/#create-a-thread-by-replying-to-a-standard-comment).
Notes can be added to other items than comments, such as system notes, making them threads.
```
POST /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the note or reply.
`discussion_id` | integer | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`issue_iid` | integer | Yes | The IID of an issue.
`created_at` | string | No | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights.
If successful, returns [`201 Created`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the created note object.
Example request:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/<discussion_id>/notes?body=comment"
```

### Modify existing issue thread note[](https://docs.gitlab.com/api/discussions/#modify-existing-issue-thread-note "Permalink")
Modify existing thread note of an issue.
```
PUT /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the note or reply.
`discussion_id` | integer | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`issue_iid` | integer | Yes | The IID of an issue.
`note_id` | integer | Yes | The ID of a thread note.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the updated note object.
Example request:
shell
```
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/<discussion_id>/notes/1108?body=comment"
```

### Delete an issue thread note[](https://docs.gitlab.com/api/discussions/#delete-an-issue-thread-note "Permalink")
Deletes an existing thread note of an issue.
```
DELETE /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`discussion_id` | integer | Yes | The ID of a discussion.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`issue_iid` | integer | Yes | The IID of an issue.
`note_id` | integer | Yes | The ID of a discussion note.
If successful, returns [`204 No Content`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes).
Example request:
shell
```
curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/636"
```

## Snippets[](https://docs.gitlab.com/api/discussions/#snippets "Permalink")
### List project snippet discussion items[](https://docs.gitlab.com/api/discussions/#list-project-snippet-discussion-items "Permalink")
Gets a list of all discussion items for a single snippet.
```
GET /projects/:id/snippets/:snippet_id/discussions
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`snippet_id` | integer | Yes | The ID of a snippet.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the same response attributes as [List project issue discussion items](https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items), with `noteable_type` set to `Snippet`.
Example request:
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions"
```

Example response:
json
```
[
  {
    "id": "6a9c1750b37d513a43987b574953fceb50b03ce7",
    "individual_note": false,
    "notes": [
      {
        "id": 1126,
        "type": "DiscussionNote",
        "body": "discussion text",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-03T21:54:39.668Z",
        "updated_at": "2018-03-03T21:54:39.668Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Snippet",
        "project_id": 5,
        "noteable_iid": null
      },
      {
        "id": 1129,
        "type": "DiscussionNote",
        "body": "reply to the discussion",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T13:38:02.127Z",
        "updated_at": "2018-03-04T13:38:02.127Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Snippet",
        "project_id": 5,
        "noteable_iid": null,
        "resolvable": false
      }
    ]
  },
  {
    "id": "87805b7c09016a7058e91bdbe7b29d1f284a39e6",
    "individual_note": true,
    "notes": [
      {
        "id": 1128,
        "type": null,
        "body": "a single comment",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T09:17:22.520Z",
        "updated_at": "2018-03-04T09:17:22.520Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Snippet",
        "project_id": 5,
        "noteable_iid": null,
        "resolvable": false
      }
    ]
  }
]
```

### Get single snippet discussion item[](https://docs.gitlab.com/api/discussions/#get-single-snippet-discussion-item "Permalink")
Returns a single discussion item for a specific project snippet.
```
GET /projects/:id/snippets/:snippet_id/discussions/:discussion_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`discussion_id` | integer | Yes | The ID of a discussion item.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`snippet_id` | integer | Yes | The ID of a snippet.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the same response attributes as [List project snippet discussion items](https://docs.gitlab.com/api/discussions/#list-project-snippet-discussion-items).
Example request:
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/<discussion_id>"
```

### Create new snippet thread[](https://docs.gitlab.com/api/discussions/#create-new-snippet-thread "Permalink")
Creates a new thread to a single project snippet. Similar to creating a note, but other comments (replies) can be added to it later.
```
POST /projects/:id/snippets/:snippet_id/discussions
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of a discussion.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`snippet_id` | integer | Yes | The ID of a snippet.
`created_at` | string | No | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights.
If successful, returns [`201 Created`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the created discussion object.
Example request:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions?body=comment"
```

### Add note to existing snippet thread[](https://docs.gitlab.com/api/discussions/#add-note-to-existing-snippet-thread "Permalink")
Adds a new note to the thread.
```
POST /projects/:id/snippets/:snippet_id/discussions/:discussion_id/notes
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the note or reply.
`discussion_id` | integer | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`snippet_id` | integer | Yes | The ID of a snippet.
`created_at` | string | No | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights.
If successful, returns [`201 Created`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the created note object.
Example request:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/<discussion_id>/notes?body=comment"
```

### Modify existing snippet thread note[](https://docs.gitlab.com/api/discussions/#modify-existing-snippet-thread-note "Permalink")
Modify existing thread note of a snippet.
```
PUT /projects/:id/snippets/:snippet_id/discussions/:discussion_id/notes/:note_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the note or reply.
`discussion_id` | integer | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`note_id` | integer | Yes | The ID of a thread note.
`snippet_id` | integer | Yes | The ID of a snippet.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the updated note object.
Example request:
shell
```
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/<discussion_id>/notes/1108?body=comment"
```

### Delete a snippet thread note[](https://docs.gitlab.com/api/discussions/#delete-a-snippet-thread-note "Permalink")
Deletes an existing thread note of a snippet.
```
DELETE /projects/:id/snippets/:snippet_id/discussions/:discussion_id/notes/:note_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`discussion_id` | integer | Yes | The ID of a discussion.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`note_id` | integer | Yes | The ID of a discussion note.
`snippet_id` | integer | Yes | The ID of a snippet.
If successful, returns [`204 No Content`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes).
Example request:
shell
```
curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/636"
```

## Epics[](https://docs.gitlab.com/api/discussions/#epics "Permalink")
  * Tier: Ultimate
  * Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated


The Epics REST API was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/460668) in GitLab 17.0 and is planned for removal in v5 of the API. This change is a breaking change.
Use the Work Items API instead:
  * GitLab 17.4 to 18.0: Required when [the new look for epics](https://docs.gitlab.com/user/group/epics/#epics-as-work-items) is enabled.
  * GitLab 18.1 and later: Required for all installations.


For more information, see the [API migration guide](https://docs.gitlab.com/api/graphql/epic_work_items_api_migration_guide/).
### List group epic discussion items[](https://docs.gitlab.com/api/discussions/#list-group-epic-discussion-items "Permalink")
Gets a list of all discussion items for a single epic.
```
GET /groups/:id/epics/:epic_id/discussions
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`epic_id` | integer | Yes | The ID of an epic.
`id` | integer or string | Yes | The ID or [URL-encoded path](https://docs.gitlab.com/api/rest/#namespaced-paths) of the group.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the same response attributes as [List project issue discussion items](https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items), with `noteable_type` set to `Epic`.
Example request:
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions"
```

Example response:
json
```
[
  {
    "id": "6a9c1750b37d513a43987b574953fceb50b03ce7",
    "individual_note": false,
    "notes": [
      {
        "id": 1126,
        "type": "DiscussionNote",
        "body": "discussion text",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-03T21:54:39.668Z",
        "updated_at": "2018-03-03T21:54:39.668Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Epic",
        "project_id": 5,
        "noteable_iid": null,
        "resolvable": false
      },
      {
        "id": 1129,
        "type": "DiscussionNote",
        "body": "reply to the discussion",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T13:38:02.127Z",
        "updated_at": "2018-03-04T13:38:02.127Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Epic",
        "project_id": 5,
        "noteable_iid": null,
        "resolvable": false
      }
    ]
  },
  {
    "id": "87805b7c09016a7058e91bdbe7b29d1f284a39e6",
    "individual_note": true,
    "notes": [
      {
        "id": 1128,
        "type": null,
        "body": "a single comment",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T09:17:22.520Z",
        "updated_at": "2018-03-04T09:17:22.520Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Epic",
        "project_id": 5,
        "noteable_iid": null,
        "resolvable": false
      }
    ]
  }
]
```

### Get single epic discussion item[](https://docs.gitlab.com/api/discussions/#get-single-epic-discussion-item "Permalink")
Returns a single discussion item for a specific group epic.
```
GET /groups/:id/epics/:epic_id/discussions/:discussion_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`discussion_id` | integer | Yes | The ID of a discussion item.
`epic_id` | integer | Yes | The ID of an epic.
`id` | integer or string | Yes | The ID or [URL-encoded path](https://docs.gitlab.com/api/rest/#namespaced-paths) of the group.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the same response attributes as [List group epic discussion items](https://docs.gitlab.com/api/discussions/#list-group-epic-discussion-items).
Example request:
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/<discussion_id>"
```

### Create new epic thread[](https://docs.gitlab.com/api/discussions/#create-new-epic-thread "Permalink")
Creates a new thread to a single group epic. Similar to creating a note, but other comments (replies) can be added to it later.
```
POST /groups/:id/epics/:epic_id/discussions
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the thread.
`epic_id` | integer | Yes | The ID of an epic.
`id` | integer or string | Yes | The ID or [URL-encoded path](https://docs.gitlab.com/api/rest/#namespaced-paths) of the group.
`created_at` | string | No | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights.
If successful, returns [`201 Created`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the created discussion object.
Example request:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions?body=comment"
```

### Add note to existing epic thread[](https://docs.gitlab.com/api/discussions/#add-note-to-existing-epic-thread "Permalink")
Adds a new note to the thread. This can also [create a thread from a single comment](https://docs.gitlab.com/user/discussions/#create-a-thread-by-replying-to-a-standard-comment).
```
POST /groups/:id/epics/:epic_id/discussions/:discussion_id/notes
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the note or reply.
`discussion_id` | integer | Yes | The ID of a thread.
`epic_id` | integer | Yes | The ID of an epic.
`id` | integer or string | Yes | The ID or [URL-encoded path](https://docs.gitlab.com/api/rest/#namespaced-paths) of the group.
`created_at` | string | No | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights.
If successful, returns [`201 Created`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the created note object.
Example request:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/<discussion_id>/notes?body=comment"
```

### Modify existing epic thread note[](https://docs.gitlab.com/api/discussions/#modify-existing-epic-thread-note "Permalink")
Modify existing thread note of an epic.
```
PUT /groups/:id/epics/:epic_id/discussions/:discussion_id/notes/:note_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of a note or reply.
`discussion_id` | integer | Yes | The ID of a thread.
`epic_id` | integer | Yes | The ID of an epic.
`id` | integer or string | Yes | The ID or [URL-encoded path](https://docs.gitlab.com/api/rest/#namespaced-paths) of the group.
`note_id` | integer | Yes | The ID of a thread note.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the updated note object.
Example request:
shell
```
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/<discussion_id>/notes/1108?body=comment"
```

### Delete an epic thread note[](https://docs.gitlab.com/api/discussions/#delete-an-epic-thread-note "Permalink")
Deletes an existing thread note of an epic.
```
DELETE /groups/:id/epics/:epic_id/discussions/:discussion_id/notes/:note_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`discussion_id` | integer | Yes | The ID of a thread.
`epic_id` | integer | Yes | The ID of an epic.
`id` | integer or string | Yes | The ID or [URL-encoded path](https://docs.gitlab.com/api/rest/#namespaced-paths) of the group.
`note_id` | integer | Yes | The ID of a thread note.
If successful, returns [`204 No Content`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes).
Example request:
shell
```
curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/636"
```

## Merge requests[](https://docs.gitlab.com/api/discussions/#merge-requests "Permalink")
### List project merge request discussion items[](https://docs.gitlab.com/api/discussions/#list-project-merge-request-discussion-items "Permalink")
Gets a list of all discussion items for a single merge request.
```
GET /projects/:id/merge_requests/:merge_request_iid/discussions
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`merge_request_iid` | integer | Yes | The IID of a merge request.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the following response attributes:
Attribute | Type | Description
---|---|---
`id` | string | The ID of the discussion.
`individual_note` | boolean | If `true`, an individual note or part of a discussion.
`notes` | array | Array of note objects in the discussion.
`notes[].id` | integer | The ID of the note.
`notes[].type` | string | The type of note (`DiscussionNote`, `DiffNote`, or `null`).
`notes[].body` | string | The content of the note.
`notes[].author` | object | The author of the note.
`notes[].created_at` | string | When the note was created (ISO 8601 format).
`notes[].updated_at` | string | When the note was last updated (ISO 8601 format).
`notes[].system` | boolean | If `true`, a system note.
`notes[].noteable_id` | integer | The ID of the noteable object.
`notes[].noteable_type` | string | The type of the noteable object.
`notes[].project_id` | integer | The ID of the project.
`notes[].resolved` | boolean | If `true`, the note is resolved (merge requests only).
`notes[].resolvable` | boolean | If `true`, the note can be resolved.
`notes[].resolved_by` | object | The user who resolved the note.
`notes[].resolved_at` | string | When the note was resolved (ISO 8601 format).
`notes[].position` | object | Position information for diff notes.
`notes[].suggestions` | array | Array of suggestion objects for the note.
Diff comments also contain position information:
Example request:
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions"
```

Example response:
json
```
[
  {
    "id": "6a9c1750b37d513a43987b574953fceb50b03ce7",
    "individual_note": false,
    "notes": [
      {
        "id": 1126,
        "type": "DiscussionNote",
        "body": "discussion text",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-03T21:54:39.668Z",
        "updated_at": "2018-03-03T21:54:39.668Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "MergeRequest",
        "project_id": 5,
        "noteable_iid": null,
        "resolved": false,
        "resolvable": true,
        "resolved_by": null,
        "resolved_at": null
      },
      {
        "id": 1129,
        "type": "DiscussionNote",
        "body": "reply to the discussion",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T13:38:02.127Z",
        "updated_at": "2018-03-04T13:38:02.127Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "MergeRequest",
        "project_id": 5,
        "noteable_iid": null,
        "resolved": false,
        "resolvable": true,
        "resolved_by": null
      }
    ]
  },
  {
    "id": "87805b7c09016a7058e91bdbe7b29d1f284a39e6",
    "individual_note": true,
    "notes": [
      {
        "id": 1128,
        "type": null,
        "body": "a single comment",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T09:17:22.520Z",
        "updated_at": "2018-03-04T09:17:22.520Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "MergeRequest",
        "project_id": 5,
        "noteable_iid": null,
        "resolved": false,
        "resolvable": true,
        "resolved_by": null
      }
    ]
  }
]
```

Diff comments also contain position:
json
```
[
  {
    "id": "87805b7c09016a7058e91bdbe7b29d1f284a39e6",
    "individual_note": false,
    "notes": [
      {
        "id": 1128,
        "type": "DiffNote",
        "body": "diff comment",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T09:17:22.520Z",
        "updated_at": "2018-03-04T09:17:22.520Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "MergeRequest",
        "project_id": 5,
        "noteable_iid": null,
        "commit_id": "4803c71e6b1833ca72b8b26ef2ecd5adc8a38031",
        "position": {
          "base_sha": "b5d6e7b1613fca24d250fa8e5bc7bcc3dd6002ef",
          "start_sha": "7c9c2ead8a320fb7ba0b4e234bd9529a2614e306",
          "head_sha": "4803c71e6b1833ca72b8b26ef2ecd5adc8a38031",
          "old_path": "package.json",
          "new_path": "package.json",
          "position_type": "text",
          "old_line": 27,
          "new_line": 27,
          "line_range": {
            "start": {
              "line_code": "588440f66559714280628a4f9799f0c4eb880a4a_10_10",
              "type": "new",
              "old_line": null,
              "new_line": 10
            },
            "end": {
              "line_code": "588440f66559714280628a4f9799f0c4eb880a4a_11_11",
              "type": "old",
              "old_line": 11,
              "new_line": 11
            }
          }
        },
        "resolved": false,
        "resolvable": true,
        "resolved_by": null,
        "suggestions": [
          {
            "id": 1,
            "from_line": 27,
            "to_line": 27,
            "appliable": true,
            "applied": false,
            "from_content": "x",
            "to_content": "b"
          }
        ]
      }
    ]
  }
]
```

### Get single merge request discussion item[](https://docs.gitlab.com/api/discussions/#get-single-merge-request-discussion-item "Permalink")
Returns a single discussion item for a specific project merge request.
```
GET /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`discussion_id` | string | Yes | The ID of a discussion item.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`merge_request_iid` | integer | Yes | The IID of a merge request.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the same response attributes as [List project merge request discussion items](https://docs.gitlab.com/api/discussions/#list-project-merge-request-discussion-items).
Example request:
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/<discussion_id>"
```

### Create new merge request thread[](https://docs.gitlab.com/api/discussions/#create-new-merge-request-thread "Permalink")
Creates a new thread to a single project merge request. Similar to creating a note but other comments (replies) can be added to it later. For other approaches, see [Post comment to commit](https://docs.gitlab.com/api/commits/#post-comment-to-commit) in the Commits API, and [Create a merge request note](https://docs.gitlab.com/api/notes/#create-a-merge-request-note) in the Notes API.
```
POST /projects/:id/merge_requests/:merge_request_iid/discussions
```

Supported attributes for all comments:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`merge_request_iid` | integer | Yes | The IID of a merge request.
`commit_id` | string | No | SHA referencing commit to start this discussion on.
`created_at` | string | No | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights.
`position` | hash | No | Position when creating a diff note.
`position[base_sha]` | string | Yes (if `position*` is supplied) | Base commit SHA in the source branch.
`position[head_sha]` | string | Yes (if `position*` is supplied) | SHA referencing HEAD of this merge request.
`position[start_sha]` | string | Yes (if `position*` is supplied) | SHA referencing commit in target branch.
`position[position_type]` | string | Yes (if position* is supplied) | Type of the position reference. Allowed values: `text`, `image`, or `file`. `file` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423046) in GitLab 16.4.
`position[new_path]` | string | Yes (if the position type is `text`) | File path after change.
`position[old_path]` | string | Yes (if the position type is `text`) | File path before change.
`position[new_line]` | integer | No | For `text` diff notes, the line number after change.
`position[old_line]` | integer | No | For `text` diff notes, the line number before change.
`position[line_range]` | hash | No | Line range for a multi-line diff note.
`position[width]` | integer | No | For `image` diff notes, width of the image.
`position[height]` | integer | No | For `image` diff notes, height of the image.
`position[x]` | float | No | For `image` diff notes, X coordinate.
`position[y]` | float | No | For `image` diff notes, Y coordinate.
If successful, returns [`201 Created`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the created discussion object.
#### Create a new thread on the overview page[](https://docs.gitlab.com/api/discussions/#create-a-new-thread-on-the-overview-page "Permalink")
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions?body=comment"
```

#### Create a new thread in the merge request diff[](https://docs.gitlab.com/api/discussions/#create-a-new-thread-in-the-merge-request-diff "Permalink")
  * Both `position[old_path]` and `position[new_path]` are required and must refer to the file path before and after the change.
  * To create a thread on an added line (highlighted in green in the merge request diff), use `position[new_line]` and don’t include `position[old_line]`.
  * To create a thread on a removed line (highlighted in red in the merge request diff), use `position[old_line]` and don’t include `position[new_line]`.
  * To create a thread on an unchanged line, include both `position[new_line]` and `position[old_line]` for the line. These positions might not be the same if earlier changes in the file changed the line number. For the discussion about a fix, see [issue 32516](https://gitlab.com/gitlab-org/gitlab/-/issues/325161).
  * If you specify incorrect `base`, `head`, `start`, or `SHA` parameters, you might run into the bug described in [issue #296829](https://gitlab.com/gitlab-org/gitlab/-/issues/296829).


To create a new thread:
  1. [Get the latest merge request version](https://docs.gitlab.com/api/merge_requests/#retrieve-merge-request-diff-versions):
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/versions"
```

  2. Note the details of the latest version, which is listed first in the response array.
json
```
[
  {
    "id": 164560414,
    "head_commit_sha": "f9ce7e16e56c162edbc9e480108041cf6b0291fe",
    "base_commit_sha": "5e6dffa282c5129aa67cd227a0429be21bfdaf80",
    "start_commit_sha": "5e6dffa282c5129aa67cd227a0429be21bfdaf80",
    "created_at": "2021-03-30T09:18:27.351Z",
    "merge_request_id": 93958054,
    "state": "collected",
    "real_size": "2"
  },
  "previous versions are here"
]
```

  3. Create a new diff thread. This example creates a thread on an added line:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --form 'position[position_type]=text' \
  --form 'position[base_sha]=<use base_commit_sha from the versions response>' \
  --form 'position[head_sha]=<use head_commit_sha from the versions response>' \
  --form 'position[start_sha]=<use start_commit_sha from the versions response>' \
  --form 'position[new_path]=file.js' \
  --form 'position[old_path]=file.js' \
  --form 'position[new_line]=18' \
  --form 'body=test comment body' \
  --url "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions"
```



#### Parameters for multiline comments[](https://docs.gitlab.com/api/discussions/#parameters-for-multiline-comments "Permalink")
Supported attributes for multiline comments only:
Attribute | Type | Required | Description
---|---|---|---
`position[line_range][end][line_code]` | string | Yes |  [Line code](https://docs.gitlab.com/api/discussions/#line-code) for the end line.
`position[line_range][end][type]` | string | Yes | Use `new` for lines added by this commit, otherwise `old`.
`position[line_range][end][old_line]` | integer | No | Old line number of the end line.
`position[line_range][end][new_line]` | integer | No | New line number of the end line.
`position[line_range][start][line_code]` | string | Yes |  [Line code](https://docs.gitlab.com/api/discussions/#line-code) for the start line.
`position[line_range][start][type]` | string | Yes | Use `new` for lines added by this commit, otherwise `old`.
`position[line_range][start][old_line]` | integer | No | Old line number of the start line.
`position[line_range][start][new_line]` | integer | No | New line number of the start line.
`position[line_range][end]` | hash | No | Multiline note ending line.
`position[line_range][start]` | hash | No | Multiline note starting line.
The `old_line` and `new_line` parameters inside the `line_range` attribute display the range for multi-line comments. For example, “Comment on lines +296 to +297”.
#### Line code[](https://docs.gitlab.com/api/discussions/#line-code "Permalink")
A line code is of the form `<SHA>_<old>_<new>`, like this: `adc83b19e793491b1c6ea0fd8b46cd9f32e292fc_5_5`
  * `<SHA>` is the SHA1 hash of the filename.
  * `<old>` is the line number before the change.
  * `<new>` is the line number after the change.


For example, if a commit (`<COMMIT_ID>`) deletes line 463 in the README, you can comment on the deletion by referencing line 463 in the old file:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --form "note=Very clever to remove this unnecessary line!" \
  --form "path=README" \
  --form "line=463" \
  --form "line_type=old" \
  --url "https://gitlab.com/api/v4/projects/47/repository/commits/<COMMIT_ID>/comments"
```

If a commit (`<COMMIT_ID>`) adds line 157 to `hello.rb`, you can comment on the addition by referencing line 157 in the new file:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --form "note=This is brilliant!" \
  --form "path=hello.rb" \
  --form "line=157" \
  --form "line_type=new" \
  --url "https://gitlab.com/api/v4/projects/47/repository/commits/<COMMIT_ID>/comments"
```

### Resolve a merge request thread[](https://docs.gitlab.com/api/discussions/#resolve-a-merge-request-thread "Permalink")
Resolve or reopen a thread of discussion in a merge request.
Prerequisites:
  * You must have the Developer, Maintainer, or Owner role, or be the author of the change being reviewed.


```
PUT /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`discussion_id` | string | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`merge_request_iid` | integer | Yes | The IID of a merge request.
`resolved` | boolean | Yes | If `true`, resolve or reopen the discussion.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the updated discussion object.
Example request:
shell
```
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/<discussion_id>?resolved=true"
```

### Add note to existing merge request thread[](https://docs.gitlab.com/api/discussions/#add-note-to-existing-merge-request-thread "Permalink")
Adds a new note to the thread. This can also [create a thread from a single comment](https://docs.gitlab.com/user/discussions/#create-a-thread-by-replying-to-a-standard-comment).
```
POST /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the note or reply.
`discussion_id` | string | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`merge_request_iid` | integer | Yes | The IID of a merge request.
`created_at` | string | No | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights.
If successful, returns [`201 Created`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the created note object.
Example request:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/<discussion_id>/notes?body=comment"
```

### Modify an existing merge request thread note[](https://docs.gitlab.com/api/discussions/#modify-an-existing-merge-request-thread-note "Permalink")
Modify or resolve an existing thread note of a merge request.
```
PUT /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`discussion_id` | string | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`merge_request_iid` | integer | Yes | The IID of a merge request.
`note_id` | integer | Yes | The ID of a thread note.
`body` | string | No | The content of the note or reply. Exactly one of `body` or `resolved` must be set.
`resolved` | boolean | No | Resolve or reopen the note. Exactly one of `body` or `resolved` must be set.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the updated note object.
Example request:
shell
```
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/<discussion_id>/notes/1108?body=comment"
```

Resolving a note:
shell
```
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/<discussion_id>/notes/1108?resolved=true"
```

### Delete a merge request thread note[](https://docs.gitlab.com/api/discussions/#delete-a-merge-request-thread-note "Permalink")
Deletes an existing thread note of a merge request.
```
DELETE /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`discussion_id` | string | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`merge_request_iid` | integer | Yes | The IID of a merge request.
`note_id` | integer | Yes | The ID of a thread note.
If successful, returns [`204 No Content`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes).
Example request:
shell
```
curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/636"
```

## Commits[](https://docs.gitlab.com/api/discussions/#commits "Permalink")
### List project commit discussion items[](https://docs.gitlab.com/api/discussions/#list-project-commit-discussion-items "Permalink")
Gets a list of all discussion items for a single commit.
```
GET /projects/:id/repository/commits/:commit_id/discussions
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`commit_id` | string | Yes | The SHA of a commit.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the same response attributes as [List project issue discussion items](https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items), with `noteable_type` set to `Commit`.
Example request:
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/repository/commits/<commit_id>/discussions"
```

Example response:
json
```
[
  {
    "id": "6a9c1750b37d513a43987b574953fceb50b03ce7",
    "individual_note": false,
    "notes": [
      {
        "id": 1126,
        "type": "DiscussionNote",
        "body": "discussion text",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-03T21:54:39.668Z",
        "updated_at": "2018-03-03T21:54:39.668Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Commit",
        "project_id": 5,
        "noteable_iid": null,
        "resolvable": false
      },
      {
        "id": 1129,
        "type": "DiscussionNote",
        "body": "reply to the discussion",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T13:38:02.127Z",
        "updated_at": "2018-03-04T13:38:02.127Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Commit",
        "project_id": 5,
        "noteable_iid": null,
        "resolvable": false
      }
    ]
  },
  {
    "id": "87805b7c09016a7058e91bdbe7b29d1f284a39e6",
    "individual_note": true,
    "notes": [
      {
        "id": 1128,
        "type": null,
        "body": "a single comment",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T09:17:22.520Z",
        "updated_at": "2018-03-04T09:17:22.520Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Commit",
        "project_id": 5,
        "noteable_iid": null,
        "resolvable": false
      }
    ]
  }
]
```

Diff comments contain also position:
json
```
[
  {
    "id": "87805b7c09016a7058e91bdbe7b29d1f284a39e6",
    "individual_note": false,
    "notes": [
      {
        "id": 1128,
        "type": "DiffNote",
        "body": "diff comment",
        "attachment": null,
        "author": {
          "id": 1,
          "name": "root",
          "username": "root",
          "state": "active",
          "avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
          "web_url": "http://localhost:3000/root"
        },
        "created_at": "2018-03-04T09:17:22.520Z",
        "updated_at": "2018-03-04T09:17:22.520Z",
        "system": false,
        "noteable_id": 3,
        "noteable_type": "Commit",
        "project_id": 5,
        "noteable_iid": null,
        "position": {
          "base_sha": "b5d6e7b1613fca24d250fa8e5bc7bcc3dd6002ef",
          "start_sha": "7c9c2ead8a320fb7ba0b4e234bd9529a2614e306",
          "head_sha": "4803c71e6b1833ca72b8b26ef2ecd5adc8a38031",
          "old_path": "package.json",
          "new_path": "package.json",
          "position_type": "text",
          "old_line": 27,
          "new_line": 27
        },
        "resolvable": false
      }
    ]
  }
]
```

### Get single commit discussion item[](https://docs.gitlab.com/api/discussions/#get-single-commit-discussion-item "Permalink")
Returns a single discussion item for a specific project commit
```
GET /projects/:id/repository/commits/:commit_id/discussions/:discussion_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`commit_id` | string | Yes | The SHA of a commit.
`discussion_id` | string | Yes | The ID of a discussion item.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the same response attributes as [List project commit discussion items](https://docs.gitlab.com/api/discussions/#list-project-commit-discussion-items).
Example request:
shell
```
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/repository/commits/<commit_id>/discussions/<discussion_id>"
```

### Create new commit thread[](https://docs.gitlab.com/api/discussions/#create-new-commit-thread "Permalink")
Creates a new thread to a single project commit. Similar to creating a note but other comments (replies) can be added to it later.
```
POST /projects/:id/repository/commits/:commit_id/discussions
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the thread.
`commit_id` | string | Yes | The SHA of a commit.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`created_at` | string | No | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights.
`position` | hash | No | Position when creating a diff note.
`position[base_sha]` | string | Yes (if `position*` is supplied) | SHA of the parent commit.
`position[head_sha]` | string | Yes (if `position*` is supplied) | The SHA of this commit. Same as `commit_id`.
`position[start_sha]` | string | Yes (if `position*` is supplied) | SHA of the parent commit.
`position[position_type]` | string | Yes (if `position*` is supplied) | Type of the position reference. Allowed values: `text`, `image`, or `file`. `file` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423046) in GitLab 16.4.
`position[new_path]` | string | No | File path after change.
`position[new_line]` | integer | No | Line number after change.
`position[old_path]` | string | No | File path before change.
`position[old_line]` | integer | No | Line number before change.
`position[height]` | integer | No | For `image` diff notes, image height.
`position[width]` | integer | No | For `image` diff notes, image width.
`position[x]` | integer | No | For `image` diff notes, X coordinate.
`position[y]` | integer | No | For `image` diff notes, Y coordinate.
If successful, returns [`201 Created`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the created discussion object.
Example request:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/repository/commits/<commit_id>/discussions?body=comment"
```

The rules for creating the API request are the same as when [creating a new thread in the merge request diff](https://docs.gitlab.com/api/discussions/#create-a-new-thread-in-the-merge-request-diff). The exceptions:
  * `base_sha`
  * `head_sha`
  * `start_sha`


### Add note to existing commit thread[](https://docs.gitlab.com/api/discussions/#add-note-to-existing-commit-thread "Permalink")
Adds a new note to the thread.
```
POST /projects/:id/repository/commits/:commit_id/discussions/:discussion_id/notes
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | Yes | The content of the note or reply.
`commit_id` | string | Yes | The SHA of a commit.
`discussion_id` | string | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`created_at` | string | No | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights.
If successful, returns [`201 Created`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the created note object.
Example request:
shell
```
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/repository/commits/<commit_id>/discussions/<discussion_id>/notes?body=comment"
```

### Modify an existing commit thread note[](https://docs.gitlab.com/api/discussions/#modify-an-existing-commit-thread-note "Permalink")
Modify or resolve an existing thread note of a commit.
```
PUT /projects/:id/repository/commits/:commit_id/discussions/:discussion_id/notes/:note_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`body` | string | No | The content of a note.
`commit_id` | string | Yes | The SHA of a commit.
`discussion_id` | string | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`note_id` | integer | Yes | The ID of a thread note.
If successful, returns [`200 OK`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes) and the updated note object.
Example request:
shell
```
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/repository/commits/<commit_id>/discussions/<discussion_id>/notes/1108?body=comment"
```

Resolving a note:
shell
```
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/repository/commits/<commit_id>/discussions/<discussion_id>/notes/1108?resolved=true"
```

### Delete a commit discussion note[](https://docs.gitlab.com/api/discussions/#delete-a-commit-discussion-note "Permalink")
Deletes an existing discussion note of a commit.
```
DELETE /projects/:id/repository/commits/:commit_id/discussions/:discussion_id/notes/:note_id
```

Supported attributes:
Attribute | Type | Required | Description
---|---|---|---
`commit_id` | string | Yes | The SHA of a commit.
`discussion_id` | string | Yes | The ID of a thread.
`id` | integer or string | Yes | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths).
`note_id` | integer | Yes | The ID of a thread note.
If successful, returns [`204 No Content`](https://docs.gitlab.com/api/rest/troubleshooting/#status-codes).
Example request:
shell
```
curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/repository/commits/<commit_id>/discussions/<discussion_id>/notes/636"
```

Was this page helpful?YesNo
Edit this page
  *     * [ Open in Web IDE`.`Quickly and easily edit multiple files. ](https://gitlab.com/-/ide/project/gitlab-org/gitlab/edit/master/-/doc/api/discussions.md)
    * [ View page sourceEdit this file only. ](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/discussions.md)
    * [ Create an issueSuggest improvements. ](https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Documentation)


  * [Understand note types in the API](https://docs.gitlab.com/api/discussions/#understand-note-types-in-the-api)
  * [Discussions pagination](https://docs.gitlab.com/api/discussions/#discussions-pagination)
  * [Issues](https://docs.gitlab.com/api/discussions/#issues)
  * [List project issue discussion items](https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items)
  * [Get single issue discussion item](https://docs.gitlab.com/api/discussions/#get-single-issue-discussion-item)
  * [Create new issue thread](https://docs.gitlab.com/api/discussions/#create-new-issue-thread)
  * [Add note to existing issue thread](https://docs.gitlab.com/api/discussions/#add-note-to-existing-issue-thread)
  * [Modify existing issue thread note](https://docs.gitlab.com/api/discussions/#modify-existing-issue-thread-note)
  * [Delete an issue thread note](https://docs.gitlab.com/api/discussions/#delete-an-issue-thread-note)
  * [Snippets](https://docs.gitlab.com/api/discussions/#snippets)
  * [List project snippet discussion items](https://docs.gitlab.com/api/discussions/#list-project-snippet-discussion-items)
  * [Get single snippet discussion item](https://docs.gitlab.com/api/discussions/#get-single-snippet-discussion-item)
  * [Create new snippet thread](https://docs.gitlab.com/api/discussions/#create-new-snippet-thread)
  * [Add note to existing snippet thread](https://docs.gitlab.com/api/discussions/#add-note-to-existing-snippet-thread)
  * [Modify existing snippet thread note](https://docs.gitlab.com/api/discussions/#modify-existing-snippet-thread-note)
  * [Delete a snippet thread note](https://docs.gitlab.com/api/discussions/#delete-a-snippet-thread-note)
  * [Epics](https://docs.gitlab.com/api/discussions/#epics)
  * [List group epic discussion items](https://docs.gitlab.com/api/discussions/#list-group-epic-discussion-items)
  * [Get single epic discussion item](https://docs.gitlab.com/api/discussions/#get-single-epic-discussion-item)
  * [Create new epic thread](https://docs.gitlab.com/api/discussions/#create-new-epic-thread)
  * [Add note to existing epic thread](https://docs.gitlab.com/api/discussions/#add-note-to-existing-epic-thread)
  * [Modify existing epic thread note](https://docs.gitlab.com/api/discussions/#modify-existing-epic-thread-note)
  * [Delete an epic thread note](https://docs.gitlab.com/api/discussions/#delete-an-epic-thread-note)
  * [Merge requests](https://docs.gitlab.com/api/discussions/#merge-requests)
  * [List project merge request discussion items](https://docs.gitlab.com/api/discussions/#list-project-merge-request-discussion-items)
  * [Get single merge request discussion item](https://docs.gitlab.com/api/discussions/#get-single-merge-request-discussion-item)
  * [Create new merge request thread](https://docs.gitlab.com/api/discussions/#create-new-merge-request-thread)
  * [Create a new thread on the overview page](https://docs.gitlab.com/api/discussions/#create-a-new-thread-on-the-overview-page)
  * [Create a new thread in the merge request diff](https://docs.gitlab.com/api/discussions/#create-a-new-thread-in-the-merge-request-diff)
  * [Parameters for multiline comments](https://docs.gitlab.com/api/discussions/#parameters-for-multiline-comments)
  * [Line code](https://docs.gitlab.com/api/discussions/#line-code)
  * [Resolve a merge request thread](https://docs.gitlab.com/api/discussions/#resolve-a-merge-request-thread)
  * [Add note to existing merge request thread](https://docs.gitlab.com/api/discussions/#add-note-to-existing-merge-request-thread)
  * [Modify an existing merge request thread note](https://docs.gitlab.com/api/discussions/#modify-an-existing-merge-request-thread-note)
  * [Delete a merge request thread note](https://docs.gitlab.com/api/discussions/#delete-a-merge-request-thread-note)
  * [Commits](https://docs.gitlab.com/api/discussions/#commits)
  * [List project commit discussion items](https://docs.gitlab.com/api/discussions/#list-project-commit-discussion-items)
  * [Get single commit discussion item](https://docs.gitlab.com/api/discussions/#get-single-commit-discussion-item)
  * [Create new commit thread](https://docs.gitlab.com/api/discussions/#create-new-commit-thread)
  * [Add note to existing commit thread](https://docs.gitlab.com/api/discussions/#add-note-to-existing-commit-thread)
  * [Modify an existing commit thread note](https://docs.gitlab.com/api/discussions/#modify-an-existing-commit-thread-note)
  * [Delete a commit discussion note](https://docs.gitlab.com/api/discussions/#delete-a-commit-discussion-note)


[![GitLab Docs logo](https://docs.gitlab.com/gitlab-logo-footer.svg)](https://docs.gitlab.com/)
  * [Facebook](https://www.facebook.com/gitlab)
  * [LinkedIn](https://www.linkedin.com/company/gitlab-com)
  * [Twitter](https://twitter.com/gitlab)
  * [YouTube](https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg)

[![Creative Commons License](https://docs.gitlab.com/by-sa.svg)](https://creativecommons.org/licenses/by-sa/4.0/)
Company
  * [About GitLab](https://about.gitlab.com/company/)
  * [View pricing](https://about.gitlab.com/pricing/)
  * [Try GitLab for free](https://about.gitlab.com/free-trial/)


Feedback
  * [View page source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/discussions.md)
  * [Edit in Web IDE](https://gitlab.com/-/ide/project/gitlab-org/gitlab/edit/master/-/doc/api/discussions.md)
  * [Contribute to GitLab](https://about.gitlab.com/community/contribute/)
  * [Suggest updates](https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Documentation)


Help & Community
  * [Get certified](https://university.gitlab.com/pages/certifications)
  * [Get support](https://about.gitlab.com/support/)
  * [Post on the GitLab forum](https://forum.gitlab.com/new-topic?title=topic%20title&body=topic%20body&tags=docs-feedback)


Resources
  * [Terms](https://about.gitlab.com/terms/)
  * [Privacy statement](https://about.gitlab.com/privacy/)
  * [Use of generative AI](https://docs.gitlab.com/legal/use_generative_ai/)
  * [Acceptable use of user licenses](https://docs.gitlab.com/legal/licensing_policy/)
  * Cookie Preferences


![](https://cdn.bizible.com/ipv?_biz_r=&_biz_h=800054037&_biz_u=10503924d6784ad3f2d352558587a67a&_biz_l=https%3A%2F%2Fdocs.gitlab.com%2Fapi%2Fduo_agent_platform_flows%2F&_biz_t=1772174256190&_biz_i=Duo%20Agent%20Platform%20flows%20API%20%7C%20GitLab%20Docs&_biz_n=38&rnd=32168&cdn_o=a&_biz_z=1772174256305)![](https://cdn.bizible.com/ipv?_biz_r=&_biz_h=800054037&_biz_u=10503924d6784ad3f2d352558587a67a&_biz_l=https%3A%2F%2Fdocs.gitlab.com%2Fapi%2Fdiscussions%2F&_biz_t=1772174256304&_biz_i=Discussions%20API%20%7C%20GitLab%20Docs&_biz_n=39&rnd=41271&cdn_o=a&_biz_z=1772174256306)
![Company Logo](https://cdn.cookielaw.org/logos/aa14a5c8-79e3-442a-8177-464ad850b19d/e46c1d0d-1f66-481f-bc06-5427671431da/253e6fee-c4c0-4b60-bc35-79cdae5dda32/gitlab-logo-100.png)
## Privacy Preference Center
## Privacy Preference Center
  * ### Your Privacy
  * ### Strictly Necessary Cookies
  * ### Functionality Cookies
  * ### Performance and Analytics Cookies
  * ### Targeting and Advertising Cookies
  * ### Ad User Data
  * ### Ad Personalization


#### Your Privacy
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
[Cookie Policy](https://about.gitlab.com/privacy/cookies/)
**User ID:** 42fad8d5-ed56-4786-8d74-3c72635252d2
_This User ID will be used as a unique identifier while storing and accessing your preferences for future._
**Timestamp:** --
#### Strictly Necessary Cookies
Always Active
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, enabling you to securely log into the site, filling in forms, or using the customer checkout. GitLab processes any personal data collected through these cookies on the basis of our legitimate interest.
Cookies Details
#### Functionality Cookies
Functionality Cookies
These cookies enable helpful but non-essential website functions that improve your website experience. By recognizing you when you return to our website, they may, for example, allow us to personalize our content for you or remember your preferences. If you do not allow these cookies then some or all of these services may not function properly. GitLab processes any personal data collected through these cookies on the basis of your consent
Cookies Details
#### Performance and Analytics Cookies
Performance and Analytics Cookies
These cookies allow us and our third-party service providers to recognize and count the number of visitors on our websites and to see how visitors move around our websites when they are using it. This helps us improve our products and ensures that users can easily find what they need on our websites. These cookies usually generate aggregate statistics that are not associated with an individual. To the extent any personal data is collected through these cookies, GitLab processes that data on the basis of your consent.
Cookies Details
#### Targeting and Advertising Cookies
Targeting and Advertising Cookies
These cookies enable different advertising related functions. They may allow us to record information about your visit to our websites, such as pages visited, links followed, and videos viewed so we can make our websites and the advertising displayed on it more relevant to your interests. They may be set through our website by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant advertisements on other websites. GitLab processes any personal data collected through these cookies on the basis of your consent.
Cookies Details
#### Ad User Data
Ad User Data
Sets consent for sending user data to Google for advertising purposes.
Cookies Details
#### Ad Personalization
Ad Personalization
Sets consent for personalized advertising.
Cookies Details
Back Button
### Cookie List
Filter Button
Consent Leg.Interest
checkbox label label
checkbox label label
checkbox label label
Clear
  * checkbox label label


Apply Cancel
Confirm My Choices
Allow All
[![Powered by Onetrust](https://cdn.cookielaw.org/logos/static/powered_by_logo.svg)](https://www.onetrust.com/products/cookie-consent/)
