> ## Documentation Index
> Fetch the complete documentation index at: https://social-b97141fb-feat-user-history-moderation-detail.mintlify.site/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.

  Each comment also carries `rootId`, the ID of the top-level comment that starts the thread. `parentId` is the comment being replied to directly, while `rootId` stays the same for every comment in the thread — use it to group or navigate a whole thread without walking the parent chain.
</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` |
| Root comment | `comment.rootId` | `comment.rootId` | `comment.getRootId()` | `comment.rootId` |
| 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 |
| Approval status | `comment.approvalStatus` | `comment.approvalStatus` | `comment.getApprovalStatus()` | Not exposed |

## 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>

<Note>
  A community can require a moderator to approve comments before anyone else sees them. In such a community, a created or edited comment comes back `pending` and stays out of public comment lists and counts until it is approved. See [Approval Lifecycle](./moderation/comment-review#approval-lifecycle).
</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>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.