Adding a comment

Adds a comment to the page. The user must have read access to the page. Comments
must be enabled in the organization and on the page.

To reply in an existing thread, pass its initial comment in thread_id. The parent_id field
specifies the comment that the reply addresses. This field alone does not add the new
comment to the thread.

For common headers and authentication methods, see Access to the API. For sample scenarios, see API usage examples.

Request

POST

https://api.wiki.yandex.net/v1/pages/{idx}/comments

Path parameters

Name

Description

idx

Type: integer

Page ID. The value of idx is the same as the id field value in the response to GET /v1/pages?slug=… or POST /v1/pages.

Body

application/json
{
  "body": "example",
  "inline_text": "example",
  "parent_id": 0,
  "thread_id": 0
}

Name

Description

body

Type: string

The comment text

Example: example

inline_text

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

The fragment of page text that the comment refers to

Example: example

parent_id

Any of 2 types
  • Type: integer

  • Type: null

    Example: null

ID of the comment on this page to reply to

Example: 0

thread_id

Any of 2 types
  • Type: integer

  • Type: null

    Example: null

ID of the initial comment in a thread on this page. Omit the field to start a new discussion.

Example: 0

Responses

200 OK

OK

Body

application/json
{
  "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"
    }
  ]
}

Name

Description

author

Type: UserSchema

Comment author

User information

Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}

body

Type: string

The comment text

Example: example

created_at

Type: string<date-time>

The date and time when the comment was created

Example: 2025-01-01T00:00:00Z

id

Type: integer

The unique comment ID

is_deleted

Type: boolean

Indicates whether the comment has been deleted

reactions

Type: CommentReactionSchema[]

Reactions to the comment

Example
[
  {
    "type": "like",
    "author": {
      "id": 0,
      "identity": {
        "uid": null,
        "cloud_uid": null
      },
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    },
    "created_at": "2025-01-01T00:00:00Z"
  }
]

resolve_status

Type: CommentResolveStatus

Comment resolution status

Comment resolution status:

  • resolved: The comment is resolved.
  • unresolved: The comment is unresolved.

Enum: resolved, unresolved

inline_text

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

Text that the comment is attached to (for inline comments)

Example: example

parent_id

Any of 2 types
  • Type: integer

  • Type: null

    Example: null

Parent comment ID (for replies in a thread)

Example: 0

thread_id

Any of 2 types
  • Type: integer

  • Type: null

    Example: null

Comment thread ID

Example: 0

UserIdentity

User ID

Name

Description

cloud_uid

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

User identifier in the cloud

Example: example

uid

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

Yandex user ID

Example: example

Example
{
  "uid": "example",
  "cloud_uid": "example"
}

UserSchema

User information

Name

Description

affiliation

Type: string

User affiliation

Example: example

display_name

Type: string

User display name

Example: example

id

Type: integer

Internal user identifier

is_dismissed

Type: boolean

The user is dismissed

username

Type: string

User login

Example: example

identity

Any of 2 types
  • UserIdentity

    Type: UserIdentity

    User ID

    Example
    {
      "uid": "example",
      "cloud_uid": "example"
    }
    
  • Type: null

    Example: null

User identifier in the system

Example
{
  "uid": "example",
  "cloud_uid": "example"
}
Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}

CommentResolveStatus

Comment resolution status:

  • resolved: The comment is resolved.
  • unresolved: The comment is unresolved.

Type: string

Enum: resolved, unresolved

ReactionType

Comment reaction type:

  • like: Like.
  • hooray: Hooray.
  • confused: Confused.
  • heart: Heart.
  • rocket: Rocket.
  • eyes: Seen.
  • fire: Fire.
  • ok: OK.
  • facepalm: Facepalm.
  • check: Check mark.
  • laugh: Laugh.
  • dislike: Dislike.

Type: string

Enum: like, hooray, confused, heart, rocket, eyes, fire, ok, facepalm, check, laugh, dislike

CommentReactionSchema

Name

Description

author

Type: UserSchema

User who added the reaction

User information

Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}

created_at

Type: string<date-time>

Date and time when the reaction was added

Example: 2025-01-01T00:00:00Z

type

Type: ReactionType

Reaction type

Comment reaction type:

  • like: Like.
  • hooray: Hooray.
  • confused: Confused.
  • heart: Heart.
  • rocket: Rocket.
  • eyes: Seen.
  • fire: Fire.
  • ok: OK.
  • facepalm: Facepalm.
  • check: Check mark.
  • laugh: Laugh.
  • dislike: Dislike.

Enum: like, hooray, confused, heart, rocket, eyes, fire, ok, facepalm, check, laugh, dislike

Example
{
  "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"
}