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

# Comments and engagement

> Read and moderate comments, and act as the account on published posts.

Once a post is live, these endpoints work against the **platform's** ids — a
Facebook Page post id, an Instagram media id, a comment id — not Sapt UUIDs. Get
them from the `permalink`/platform payloads or from
[post analytics](/api-reference/socials/get-instagram-media-analytics).

## Comments

| Action        | Instagram                                                        | Facebook                                                        |
| ------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- |
| List          | `GET /socials/comments/instagram/{projectId}/{mediaId}`          | `GET /socials/comments/facebook/{projectId}/{postId}`           |
| Reply         | `POST /socials/comments/instagram/{projectId}/{commentId}/reply` | `POST /socials/comments/facebook/{projectId}/{commentId}/reply` |
| Hide / unhide | `POST /socials/comments/instagram/{projectId}/{commentId}/hide`  | `POST /socials/comments/facebook/{projectId}/{commentId}/hide`  |
| Delete        | `DELETE /socials/comments/instagram/{projectId}/{commentId}`     | `DELETE /socials/comments/facebook/{projectId}/{commentId}`     |

Read a post's comments:

```bash theme={null}
curl "https://api.sapt.ai/socials/comments/instagram/$PROJECT_ID/$MEDIA_ID" \
  -H "Authorization: ApiKey $SAPT_API_KEY"
```

Reply as the account:

```bash theme={null}
curl -X POST \
  "https://api.sapt.ai/socials/comments/instagram/$PROJECT_ID/$COMMENT_ID/reply" \
  -H "Authorization: ApiKey $SAPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Thanks for the kind words!"}'
```

<Note>
  Hiding is reversible and invisible to the commenter. Deleting is permanent and
  cannot be undone through the platform APIs. Prefer hide for moderation.
</Note>

## Engagement

Acting as the Page or account on a published post:

| Action                           | Endpoint                                                             |
| -------------------------------- | -------------------------------------------------------------------- |
| Comment on a Facebook post       | `POST /socials/engagement/facebook/{projectId}/{postId}/comments`    |
| Comment on an Instagram post     | `POST /socials/engagement/instagram/{projectId}/{mediaId}/comments`  |
| Like a Facebook post as the Page | `POST /socials/engagement/facebook/{projectId}/{postId}/like`        |
| Unlike                           | `DELETE /socials/engagement/facebook/{projectId}/{postId}/like`      |
| Delete a published Facebook post | `DELETE /socials/engagement/facebook/{projectId}/{postId}/published` |

<Warning>
  `DELETE …/published` removes the post from Facebook itself. It is not the same
  as deleting a scheduled post from the Sapt calendar, and it cannot be undone.
</Warning>

## Analytics

| Scope               | Endpoint                                                         |
| ------------------- | ---------------------------------------------------------------- |
| Instagram account   | `GET /socials/analytics/instagram/{projectId}/{accountId}`       |
| Instagram media     | `GET /socials/analytics/instagram/{projectId}/{accountId}/media` |
| Facebook Page       | `GET /socials/analytics/facebook/{projectId}/{accountId}`        |
| Facebook Page posts | `GET /socials/analytics/facebook/{projectId}/{accountId}/posts`  |

`accountId` here is the Sapt account `id` from
[List connected social accounts](/api-reference/socials/list-connected-social-accounts).
