> ## Documentation Index
> Fetch the complete documentation index at: https://learn.social.plus/llms.txt
> Use this file to discover all available pages before exploring further.

# Comments Overview

> Create, query, update, delete, and react to comments on posts, stories, and custom content.

Use the comment repository when you need discussions on posts, stories, or custom content. Comment creation supports text, optional image attachments, metadata, user mentions, and replies through `parentId`.

<Info>
  A reply is a normal comment with `parentId` set to another comment ID. There is no separate reply API in the SDK.
</Info>

## Comment Targets

| Reference type | Use it for                                | SDK value                          |
| -------------- | ----------------------------------------- | ---------------------------------- |
| Post           | Comments on Social posts                  | `post` / `.post` / `POST`          |
| Story          | Comments on story content                 | `story` / `.story` / `STORY`       |
| Content        | Comments on your own external content IDs | `content` / `.content` / `CONTENT` |

## Comment Shape

The exact property names vary by platform, but the SDK model centers on the same fields.

| Concept           | TypeScript                     | iOS                            | Android                                  | Flutter                        |
| ----------------- | ------------------------------ | ------------------------------ | ---------------------------------------- | ------------------------------ |
| Comment ID        | `comment.commentId`            | `comment.commentId`            | `comment.getCommentId()`                 | `comment.commentId`            |
| Parent comment    | `comment.parentId`             | `comment.parentId`             | `comment.getParentId()`                  | `comment.parentId`             |
| Reference         | `referenceId`, `referenceType` | `referenceId`, `referenceType` | `comment.getReference()`                 | `referenceId`, `referenceType` |
| Text data         | `comment.data.text`            | `comment.data` text value      | `comment.getData()`                      | `comment.data`                 |
| Image attachments | `comment.attachments`          | `comment.attachments`          | `comment.getAttachments()`               | `comment.attachments`          |
| Reply count       | `childrenNumber`               | `childrenNumber`               | `getChildCount()`                        | `childrenNumber`               |
| Reactions         | `reactions`, `myReactions`     | reaction properties on comment | `getReactionCount()`, `getMyReactions()` | `reactionCount`, `myReactions` |
| Moderation        | `isDeleted`, flags             | `isDeleted`, flags             | `isDeleted()`, flags                     | `isDeleted`, flags             |

## Creation APIs

| Platform   | Repository entry point                                     | Text comment                       | Image comment                              |
| ---------- | ---------------------------------------------------------- | ---------------------------------- | ------------------------------------------ |
| TypeScript | `CommentRepository.createComment(...)`                     | `data: { text }`                   | `attachments: [{ type: "image", fileId }]` |
| iOS        | `AmityCommentRepository().createComment(with:)`            | `AmityCommentCreateOptions(text:)` | `attachments: [.image(fileId:)]`           |
| Android    | `commentRepository.createComment()`                        | `.with().text(...).build().send()` | `.with().attachments(...).build().send()`  |
| Flutter    | `AmitySocialClient.newCommentRepository().createComment()` | `.create().text(...).send()`       | `.create().attachments(...).send()`        |

<Note>
  Upload image files first, then pass the uploaded image file IDs to the comment creation API. Comment creation does not upload local files by itself.
</Note>

## Related Topics

<CardGroup cols={2}>
  <Card title="Text Comment" href="./creation/text-comment" icon="message-square">
    Create top-level comments and replies with text
  </Card>

  <Card title="Image Comment" href="./creation/image-comment" icon="image">
    Create comments with uploaded image attachments
  </Card>

  <Card title="Query Comments" href="./retrieval/query-comments" icon="filter">
    Query top-level comments and reply threads
  </Card>

  <Card title="Comment Actions" href="./actions/edit-comment" icon="pen-to-square">
    Edit, delete, flag, and manage comments
  </Card>
</CardGroup>
