---
docId: doc_90431c32f2d74d299f241b2910fc4095
title: Posts
description: "Read posts and manage their comments and threads."
---

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

# Posts

Read and reply to Instagram or Facebook comments. Each **post** has **threads**, made up of a root comment and its replies.

Use these endpoints for comments and [Messages](/api-reference/messages) for direct messages. Comments do not appear in [List conversations](/api-reference/conversations/list); [Search conversations](/api-reference/conversations/search) finds them with `kind: "post"`.

## Example

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

```bash
# 1. List the threads of a post
curl "https://api.platic.ai/v1/posts/$POST_ID/threads?needsReply=true" \
  -H "Authorization: Bearer $PLATIC_API_KEY"

# 2. Reply publicly in a thread
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 the details in a direct message."}'
```

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

```ts
// 1. List posts and their threads waiting for a reply
const { data: posts } = await platic.posts.list({ platform: "instagram" });
const { data: threads } = await platic.posts.threads.list(posts[0].id, { needsReply: true });

// 2. Reply publicly or by private message
await platic.posts.threads.reply(posts[0].id, threads[0].id, {
  message: "We sent you the details in a direct message.",
});
```

</Ways.Way>
</Ways>

## What you need to know

- **IDs:** `postId` is the `id` of the post in Platica (`externalId` is Meta's); `threadId` is the ID of the root comment at Meta and `commentId` the ID of each comment. They match the [`comment.*`](/api-reference/webhooks/payloads) webhooks.
- **Safe retries:** replies reach Meta right away. If you get a timeout (`504 COMMENT_PUBLISH_RESULT_UNKNOWN`), check the [thread](/api-reference/posts/threads) before retrying so you do not duplicate comments.
- **Meta limits:** at most 2,200 characters on Instagram and 8,000 on Facebook; a single private reply per comment within 7 days, and only if the account has a connected DM channel.
- **Permissions and billing:** uses the **Conversations** module. Commenting and moderating are not charged; sending a thread to the agent to answer does consume replies.

## Endpoints

| Method | Endpoint | What it does |
|--------|----------|--------------|
| `GET` | [`/v1/posts`](/api-reference/posts/list) | List posts |
| `GET` / `PATCH` | [`/v1/posts/{postId}`](/api-reference/posts/list) | Get a post, pause/resume the agent or assign an agent |
| `GET` | [`/v1/posts/{postId}/threads`](/api-reference/posts/threads) | List the threads of a post |
| `GET` / `PATCH` | [`/v1/posts/{postId}/threads/{threadId}`](/api-reference/posts/threads) | Get a thread, resolve/reopen, pause the agent or assign owners |
| `POST` | [`/v1/posts/{postId}/comments`](/api-reference/posts/reply) | Publish a comment from the brand |
| `POST` | [`/v1/posts/{postId}/threads/{threadId}/replies`](/api-reference/posts/reply) | Reply publicly |
| `POST` | [`/v1/posts/{postId}/threads/{threadId}/private-replies`](/api-reference/posts/reply) | Reply by private message |
| `POST` | [`/v1/posts/{postId}/threads/{threadId}/send-to-agent`](/api-reference/posts/reply) | Send the thread to the agent |
| `POST` | [`/v1/posts/{postId}/comments/{commentId}/moderation`](/api-reference/posts/moderate) | Hide, unhide, delete or mark as spam |

## Responses

All of them answer `{ "status": "success", "data": … }`. Lists carry an array in `data` and, in `nextPageToken`, the token of the next page (`null` on the last one); send that value as `pageToken`. A read carries the object in `data`. Writes add a short `message`.

Each request works in one workspace. With a multi-workspace credential, send `?workspace=<id>`; without it the response is `400`.

## Errors

<Collapsible summary="Show error codes and fixes">

Errors follow the format in [Errors](/api-reference/errors): `{ code, error, details: { code, message, ... } }`.

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | The body or parameters fail validation (`details.issues`), `Idempotency-Key` is not a UUID, or the credential covers several workspaces and `workspace` is missing |
| `400` | `COMMENT_TEXT_TOO_LONG` | The text exceeds 2,200 characters on Instagram or 8,000 on Facebook (`details.maxCharacters`) |
| `401` | `UNAUTHENTICATED` | The credential is missing or not valid |
| `402` | `COMMENT_PAYMENT_PENDING` | The workspace has a pending payment |
| `403` | `FORBIDDEN` | The credential does not have the Conversations module in that workspace |
| `403` | `COMMENT_FORBIDDEN` | The person behind the credential has no access to this post |
| `403` | `COMMENT_PRIVATE_REPLY_DISABLED` | Private replies are not turned on in the workspace |
| `404` | `NOT_FOUND` or `COMMENT_POST_NOT_FOUND` | The post, thread or comment does not exist in the workspace |
| `409` | `COMMENT_PUBLISH_IN_PROGRESS` | That reply is already being published with the same `Idempotency-Key` |
| `409` | `COMMENT_PUBLISH_RESULT_UNKNOWN` | An earlier attempt with the same `Idempotency-Key` was left unconfirmed. Check the [thread](/api-reference/posts/threads) before retrying |
| `409` | `PRIVATE_REPLY_ALREADY_SENT` | That comment already has its private reply |
| `409` | `PRIVATE_REPLY_NO_DM_CHANNEL` | The account has no connected messaging channel |
| `409` | `COMMENT_POST_PAUSED` | You sent the thread to the agent while the post is paused |
| `413` | `PAYLOAD_TOO_LARGE` | The attachment exceeds 10 MB |
| `415` | `COMMENT_ATTACHMENT_NOT_SUPPORTED` | Instagram only accepts text in public comments |
| `422` | `COMMENT_META_REJECTED` | Meta rejected the comment. `details.provider` has what it answered |
| `422`, `429`, `502` or `504` | `COMMENT_META_MODERATION_FAILED` | Meta did not apply the moderation; Platica already saved it in the inbox |
| `429` | `COMMENT_RATE_LIMITED_BY_META` | Meta rate limited the account's requests. Wait a few minutes |
| `504` | `COMMENT_PUBLISH_RESULT_UNKNOWN` | Meta did not answer and it is not known whether it published. Check the [thread](/api-reference/posts/threads) before retrying |
| `422` | `PRIVATE_REPLY_WINDOW_CLOSED` | More than 7 days have passed since the comment |

AI tools are in [Posts MCP](/mcp/tools#posts).

</Collapsible>
