---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.2
alternate:
  - https://yandex.ru/support/wiki/en/api-ref/comments/pagescomments__create_comment.md
  - https://yandex.ru/support/wiki/ru/api-ref/comments/pagescomments__create_comment.md
  - href: https://yandex.ru/support/wiki/ru/api-ref/comments/pagescomments__create_comment.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.ru/support/wiki/ru/llms.txt?revision=r21947862
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/support/wiki/ru/llms.txt?revision=r21947862

<div class="openapi">

# Добавить комментарий

<!-- markdownlint-disable-file -->

Добавляет комментарий на страницу. Пользователь должен иметь доступ к чтению страницы; комментарии
должны быть включены в организации и на странице.

Для ответа в существующей ветке передайте ее начальный комментарий в `thread_id`. Поле `parent_id`
указывает комментарий, на который добавляется ответ, и само по себе не привязывает новый
комментарий к ветке.

Общие заголовки и способы аутентификации описаны в разделе [Доступ к API](https://yandex.ru/support/wiki/ru/api-ref/access.md#headers). Примеры сценариев приведены в разделе [Примеры использования API](https://yandex.ru/support/wiki/ru/api-ref/examples.md).

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://api.wiki.yandex.net/v1/pages/{idx}/comments
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_idx_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Идентификатор страницы. Значение `idx` совпадает со значением поля `id` в ответе `GET /v1/pages?slug=…` или `POST /v1/pages`.
{.table-cell}
||
|#{.json-schema-properties}

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "body": "example",
  "inline_text": "example",
  "parent_id": 0,
  "thread_id": 0
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_body_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Текст комментария

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_inline_text_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Фрагмент текста страницы, к которому относится комментарий

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_parent_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Идентификатор комментария на этой странице, на который добавляется ответ
{.table-cell}
||
||

_thread_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Идентификатор начального комментария ветки на этой странице. Для нового обсуждения не передавайте поле.
{.table-cell}
||
|#{.json-schema-properties}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "id": 0,
  "body": "example",
  "inline_text": "example",
  "parent_id": 0,
  "author": {
    "id": 0,
    "identity": {
      "uid": "example",
      "cloud_uid": "example"
    },
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  },
  "thread_id": 0,
  "created_at": "2025-01-01T00:00:00Z",
  "is_deleted": true,
  "resolve_status": "resolved",
  "reactions": [
    {
      "type": "like",
      "author": null,
      "created_at": "2025-01-01T00:00:00Z"
    }
  ]
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_author_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
{% cut "**All of 1 type**" %}{.json-schema-combinators data-marker=and}

- **UserSchema**

  **Type**: [UserSchema](#entity-UserSchema)

  Информация о пользователе

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  {
    "id": 0,
    "identity": {
      "uid": "example",
      "cloud_uid": "example"
    },
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  }
  ```

  {% endcut %}

{% endcut %}

Автор комментария

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_body_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Текст комментария

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_created_at_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;date-time&gt;

Дата и время создания комментария

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Уникальный идентификатор комментария
{.table-cell}
||
||

_is_deleted_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: boolean

Признак удаленного комментария
{.table-cell}
||
||

_reactions_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [CommentReactionSchema](#entity-CommentReactionSchema)[]

Реакции на комментарий

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "type": "like",
    "author": {
      "id": 0,
      "identity": null,
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    },
    "created_at": "2025-01-01T00:00:00Z"
  }
]
```

{% endcut %}
{.table-cell}
||
||

_resolve_status_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
{% cut "**All of 1 type**" %}{.json-schema-combinators data-marker=and}

- **CommentResolveStatus**

  **Type**: [CommentResolveStatus](#entity-CommentResolveStatus)

  Статус решения комментария:
  - `resolved` — комментарий решен
  - `unresolved` — комментарий не решен

  _Enum:_{.json-schema-reset .json-schema-value} `resolved`, `unresolved`

{% endcut %}

Статус решения комментария

_Example:_{.json-schema-reset .json-schema-example} `resolved`
{.table-cell}
||
||

_inline_text_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Текст, к которому привязан комментарий (для инлайн-комментариев)

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_parent_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

ID родительского комментария (для ответов в ветке)
{.table-cell}
||
||

_thread_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

ID ветки комментариев
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### UserIdentity {#entity-UserIdentity}

Идентификатор пользователя

#|
|| **Name** | **Description** ||
||

_cloud_uid_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Идентификатор пользователя в облаке

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_uid_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Идентификатор пользователя в Яндексе

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "uid": "example",
  "cloud_uid": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### UserSchema {#entity-UserSchema}

Информация о пользователе

#|
|| **Name** | **Description** ||
||

_affiliation_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Принадлежность пользователя

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_display_name_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Отображаемое имя пользователя

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Внутренний идентификатор пользователя
{.table-cell}
||
||

_is_dismissed_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: boolean

Пользователь уволен
{.table-cell}
||
||

_username_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Логин пользователя

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_identity_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**All of 1 type**" %}{.json-schema-combinators data-marker=and}

- **UserIdentity**

  **Type**: [UserIdentity](#entity-UserIdentity)

  Идентификатор пользователя

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  {
    "uid": "example",
    "cloud_uid": "example"
  }
  ```

  {% endcut %}

{% endcut %}

Идентификатор пользователя в системе

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "uid": "example",
  "cloud_uid": "example"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### CommentResolveStatus {#entity-CommentResolveStatus}

Статус решения комментария:
- `resolved` — комментарий решен
- `unresolved` — комментарий не решен

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `resolved`, `unresolved`

</div>

<div class="openapi-entity">

### ReactionType {#entity-ReactionType}

Тип реакции на комментарий:
- `like` — нравится
- `hooray` — ура
- `confused` — в замешательстве
- `heart` — сердце
- `rocket` — ракета
- `eyes` — вижу
- `fire` — огонь
- `ok` — ок
- `facepalm` — фейспалм
- `check` — галочка
- `laugh` — смех
- `dislike` — не нравится

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `like`, `hooray`, `confused`, `heart`, `rocket`, `eyes`, `fire`, `ok`, `facepalm`, `check`, `laugh`, `dislike`

</div>

<div class="openapi-entity">

### CommentReactionSchema {#entity-CommentReactionSchema}

#|
|| **Name** | **Description** ||
||

_author_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
{% cut "**All of 1 type**" %}{.json-schema-combinators data-marker=and}

- **UserSchema**

  **Type**: [UserSchema](#entity-UserSchema)

  Информация о пользователе

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  {
    "id": 0,
    "identity": {
      "uid": "example",
      "cloud_uid": "example"
    },
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  }
  ```

  {% endcut %}

{% endcut %}

Пользователь, поставивший реакцию

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_created_at_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;date-time&gt;

Дата и время добавления реакции

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_type_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
{% cut "**All of 1 type**" %}{.json-schema-combinators data-marker=and}

- **ReactionType**

  **Type**: [ReactionType](#entity-ReactionType)

  Тип реакции на комментарий:
  - `like` — нравится
  - `hooray` — ура
  - `confused` — в замешательстве
  - `heart` — сердце
  - `rocket` — ракета
  - `eyes` — вижу
  - `fire` — огонь
  - `ok` — ок
  - `facepalm` — фейспалм
  - `check` — галочка
  - `laugh` — смех
  - `dislike` — не нравится

  _Enum:_{.json-schema-reset .json-schema-value} `like`, `hooray`, `confused`, `heart`, `rocket`, `eyes`, `fire`, `ok`, `facepalm`, `check`, `laugh`, `dislike`

{% endcut %}

Тип реакции

_Example:_{.json-schema-reset .json-schema-example} `like`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "type": "like",
  "author": {
    "id": 0,
    "identity": {
      "uid": "example",
      "cloud_uid": "example"
    },
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  },
  "created_at": "2025-01-01T00:00:00Z"
}
```

{% endcut %}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.