Comments
Send Private Reply
Sends a direct message to the author of a comment. Supported on Instagram and Facebook, once per comment and within 7 days of it.
BearerAuthorizationBearer <op_>Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.
id*stringA comment id from List Comments or a comment event. It only works in the workspace that received it.
1 <= length <= 512Idempotency-Key?stringA unique key, such as a UUID, that makes retrying this request safe. A repeat with the same key and body within 24 hours returns the first response instead of acting again. A 429 or 5xx response is not kept, so a retry with the same key runs again.
1 <= length <= 255application/json- body
text*stringThe message text, up to 1,000 characters on Instagram and 2,000 on Facebook. A longer text returns TEXT_TOO_LONG.
1 <= length <= 2000Sent message
application/json- response
id*stringThe platform's id for the message.
commentId*stringThe comment the message answers.
text*stringThe message text as sent.
createdAt*stringWhen the message was sent.
date-timeimport { Configuration, CommentsApi } from "@onepostly/sdk";const commentsApi = new CommentsApi( new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await commentsApi.sendPrivateReply({ id: "cmt_YOUR_COMMENT_ID", privateReplyBody: { "text": "Thanks! Check your DMs." },});console.log(response);{ "id": "aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDAxMjM0NTY3ODk6MzQwMjgyMzY2ODQxNzEwMzAwOTQ5MTI4MTM3NjE5NzM2Mzg3MTI4", "commentId": "cmt_YOUR_COMMENT_ID", "text": "Thanks! Check your DMs.", "createdAt": "2027-03-15T10:00:00.000Z"}