---
title: "Create a comment on a snippet"
method: POST
path: "/snippets/{workspace}/{encoded_id}/comments"
tags: ["Snippets"]
---

# Create a comment on a snippet

`POST /snippets/{workspace}/{encoded_id}/comments`

Creates a new comment.

The only required field in the body is `content.raw`.

To create a threaded reply to an existing comment, include `parent.id`.

## Request body

- SnippetComment — A comment on a snippet.
  - `type` string, required
  - `links` object
    - `self` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `html` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
  - `snippet` Snippet — A snippet object.
    - `type` string, required
    - `id` integer
    - `title` string
    - `scm` 'git' — The DVCS used to store the snippet.
    - `created_on` string, date-time
    - `updated_on` string, date-time
    - `owner` Account — An account object.
      - `type` string, required
      - `links` AccountLinks — Links related to an Account.
        - `avatar` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
      - `created_on` string, date-time
      - `display_name` string
      - `uuid` string
    - `creator` Account — An account object.
      - `type` string, required
      - `links` AccountLinks — Links related to an Account.
        - `avatar` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
      - `created_on` string, date-time
      - `display_name` string
      - `uuid` string
    - `is_private` boolean

## Response `201`

The newly created comment.

- SnippetComment — A comment on a snippet.
  - `type` string, required
  - `links` object
    - `self` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `html` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
  - `snippet` Snippet — A snippet object.
    - `type` string, required
    - `id` integer
    - `title` string
    - `scm` 'git' — The DVCS used to store the snippet.
    - `created_on` string, date-time
    - `updated_on` string, date-time
    - `owner` Account — An account object.
      - `type` string, required
      - `links` AccountLinks — Links related to an Account.
        - `avatar` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
      - `created_on` string, date-time
      - `display_name` string
      - `uuid` string
    - `creator` Account — An account object.
      - `type` string, required
      - `links` AccountLinks — Links related to an Account.
        - `avatar` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
      - `created_on` string, date-time
      - `display_name` string
      - `uuid` string
    - `is_private` boolean

## Other responses

- `403` — If the authenticated user does not have access to the snippet.
- `404` — If the snippet does not exist.

---

[API](https://skmtc.net/bitbucket/apis/bitbucket-api.md) · [All operations](https://skmtc.net/bitbucket/apis/bitbucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bitbucket/bitbucket-api/versions/4ec8bd2515c5/schema)
