---
docId: doc_2f672c97eb6c46d88ee97cddfd8a62ac
title: Reply to comments
description: "Publish comments, reply to threads, or send a private reply."
api:
  group: publicaciones
  auth: bearer
  operations:
    - operationId: publishPostComment
      method: POST
      path: '/v1/posts/{postId}/comments'
      postmanName: Publish a Comment
    - operationId: replyPostThread
      method: POST
      path: '/v1/posts/{postId}/threads/{threadId}/replies'
      postmanName: Reply Publicly
    - operationId: privateReplyPostThread
      method: POST
      path: '/v1/posts/{postId}/threads/{threadId}/private-replies'
      postmanName: Reply Privately
    - operationId: sendPostThreadToAgent
      method: POST
      path: '/v1/posts/{postId}/threads/{threadId}/send-to-agent'
      postmanName: Send Thread to Agent
---

<script>
  import { Ways, Note } from '$lib/components';
</script>

# Reply to comments

Publish a comment, reply publicly, or send a private reply. Public replies are sent to Meta immediately. Before retrying a call that did not respond, read [Safe retries](/api-reference/posts#what-you-need-to-know).

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST https://api.platic.ai/v1/posts/$POST_ID/threads/$THREAD_ID/replies \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "message": "We sent you a message." }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.posts.threads.reply("post_123", "thread_123", { message: "We sent you a message." });
```

</Ways.Way>
</Ways>

## Publish a comment

Publish a new comment from your business on the post.

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST https://api.platic.ai/v1/posts/$POST_ID/comments \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "message": "Thanks for the love!" }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.posts.comments.publish("post_123", { message: "Thanks for the love!" });
```

</Ways.Way>
</Ways>

### Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `message` | string | ✓ if there is no image | Text. Up to 2,200 characters on Instagram and 8,000 on Facebook |
| `attachmentUrl` | string | — | Facebook only: JPG, PNG or GIF image over `https`, up to 10 MB |

```json
{
  "message": "Thanks for all your comments! We'll reply here 👇"
}
```

### Response

`201 Created`

```json
{
  "status": "success",
  "message": "Comment published",
  "data": {
    "commentId": "17890000000000099",
    "clientToken": "6f1c7a9e-3b4d-4f8a-9c2e-1a5b7d9e0f12",
    "mode": "root",
    "parentCommentId": null,
    "commentPersistencePending": false
  }
}
```

The comment appears in the thread and in the `comment.created` webhooks when Meta confirms it, within seconds.

## Reply publicly

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST https://api.platic.ai/v1/posts/$POST_ID/threads/$THREAD_ID/replies \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "message": "Hi Ana! Yes, we have size M in every color." }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.posts.threads.reply("post_123", "thread_123", { message: "We sent you a message." });
```

</Ways.Way>
</Ways>

### Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `message` | string | ✓ | Text of the reply |
| `parentCommentId` | string | — | Comment of the thread you are replying to. By default, the root comment |

```json
{
  "message": "Hi Ana! Yes, we have size M in every color."
}
```

`201 Created` with `message: "Reply published"` and, in `data`, `commentId`, `mode: "reply"` and the state of the thread, which ends up resolved.

<Note type="tip">

If the thread needs assistance, accept it before replying: send `PATCH /v1/posts/{postId}/threads/{threadId}` with `"operation": "supervised"`.

</Note>

## Reply privately

Send a direct message to the person who commented. Meta allows **one** private reply per comment, within **7 days** of the comment. Its conversation is created in the account's messaging channel and appears in [`/v2/conversations`](/api-reference/conversations/list).

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST https://api.platic.ai/v1/posts/$POST_ID/threads/$THREAD_ID/private-replies \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "message": "Here is your discount code." }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.posts.threads.privateReply("post_123", "thread_123", { message: "Here is your discount code." });
```

</Ways.Way>
</Ways>

### Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `message` | string | ✓ | Text of the private message, up to 1,000 characters |
| `commentId` | string | — | Comment you are replying to. By default, the thread's root comment |
| `publicNotice` | string | — | Public comment that announces you sent a private message |

```json
{
  "message": "Hi Ana! I'm sending you the prices here.",
  "publicNotice": "We wrote to you by private message! 📩"
}
```

### Response

`201 Created`

```json
{
  "status": "success",
  "message": "Private reply sent",
  "data": {
    "clientToken": "0d6e…",
    "commentId": "17890000000000001",
    "rootCommentId": "17890000000000001",
    "providerMessageId": "aWdfZAG…",
    "conversationDocId": "conv_dm_045",
    "clientId": "cli_123",
    "persistedConversation": true,
    "publicNoticeCommentId": "17890000000000100"
  }
}
```

The message is charged as a comment reply (free during the beta) and emits `conversation.created` (if the conversation is new) and `message.created` with `source: "api.comment.private_reply"`.

## Send a thread to the agent

Send unanswered comments from a supervised thread to the agent. The thread becomes `automatic`. The post must be unpaused and the channel must have automatic replies enabled.

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST https://api.platic.ai/v1/posts/$POST_ID/threads/$THREAD_ID/send-to-agent \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.posts.threads.sendToAgent("post_123", "thread_123");
```

</Ways.Way>
</Ways>

### Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `dryRun` | boolean | — | `true` only computes what would be sent, without sending anything |

```json
{
  "dryRun": false
}
```

In `data`, the response says which threads were sent (`threads`), which were skipped and why (`skipped`) and how many were enqueued (`enqueued`). `message` is `Thread sent to agent`, or `Send to agent preview` with `dryRun`.

## Errors

All these calls can answer `400 INVALID_REQUEST` if the body is not valid or the credential covers several workspaces and `workspace` is missing, and `404 NOT_FOUND` if the post, thread or comment does not exist in the workspace. Meta's rejections and the comment limits have their own codes. See [errors](/api-reference/posts#errors) for the codes in this section.
