Moderate comments

SDK platic.posts.comments.moderate()

Apply moderation at Meta and in Platica at the same time. You can protect a post even when the workspace has a pending payment.

Example

await platic.posts.comments.moderate("post_123", "comment_123", "hide");

Request body

FieldTypeRequiredDescription
actionstring✓hide, unhide, delete, spam or unspam
ActionWhat it does
hide / unhideHides the comment from the public, or shows it again
deleteDeletes it from Meta. It cannot be undone
spamHides it, blocks the contact and, if it is the root comment, resolves the thread
unspamReverts spam and reopens the thread if it had been resolved for spam
{
  "action": "hide"
}

Response

data contains the comment's moderation state, with message: "Comment moderated". You also receive comment.updated or comment.deleted through webhooks.

Errors

Statusdetails.codeWhen
400INVALID_REQUESTaction is not valid, or the credential covers several workspaces and workspace is missing
404NOT_FOUNDThe post or the comment does not exist in the workspace
422, 429, 502 or 504COMMENT_META_MODERATION_FAILEDMeta rejected the moderation, rate limited requests, failed or did not answer. Platica already saved it in the inbox (details.localStatePersisted: true). See the warning above

See errors for the codes in this section.