Reply to comments

SDK platic.posts.comments.publish()
SDK platic.posts.threads.reply()
SDK platic.posts.threads.privateReply()
SDK platic.posts.threads.sendToAgent()

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.

Example

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

Publish a comment

Publish a new comment from your business on the post.

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

Request body

FieldTypeRequiredDescription
messagestring✓ if there is no imageText. Up to 2,200 characters on Instagram and 8,000 on Facebook
attachmentUrlstring—Facebook only: JPG, PNG or GIF image over https, up to 10 MB
{
  "message": "Thanks for all your comments! We'll reply here 👇"
}

Response

201 Created

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

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

Request body

FieldTypeRequiredDescription
messagestring✓Text of the reply
parentCommentIdstring—Comment of the thread you are replying to. By default, the root comment
{
  "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.

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.

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

Request body

FieldTypeRequiredDescription
messagestring✓Text of the private message, up to 1,000 characters
commentIdstring—Comment you are replying to. By default, the thread's root comment
publicNoticestring—Public comment that announces you sent a private message
{
  "message": "Hi Ana! I'm sending you the prices here.",
  "publicNotice": "We wrote to you by private message! 📩"
}

Response

201 Created

{
  "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.

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

Request body

FieldTypeRequiredDescription
dryRunboolean—true only computes what would be sent, without sending anything
{
  "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 for the codes in this section.