---
docId: doc_dfb8922a73af458498089787f511977c
title: Threads
description: "Read and update a post's comment threads."
api:
  group: publicaciones
  auth: bearer
  operations:
    - operationId: listPostThreads
      method: GET
      path: '/v1/posts/{postId}/threads'
      postmanName: List Threads
    - operationId: getPostThread
      method: GET
      path: '/v1/posts/{postId}/threads/{threadId}'
      postmanName: Get a Thread
    - operationId: updatePostThread
      method: PATCH
      path: '/v1/posts/{postId}/threads/{threadId}'
      postmanName: Update a Thread
---

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

# Threads

Read a post's threads or update their status and handling. Each thread contains a root comment and its replies; its `id` is the root comment's id at Meta.

## Example

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

```bash
curl "https://api.platic.ai/v1/posts/$POST_ID/threads?needsReply=true" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

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

```ts
const { data: threads } = await platic.posts.threads.list("post_123", { needsReply: true });
```

</Ways.Way>
</Ways>

## List threads

### Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `workspace` | string | Only if the credential covers several workspaces: the workspace you read. It is required there | — |
| `limit` | integer | Threads per page, from 1 to 100. Default: `25` | — |
| `pageToken` | string | `nextPageToken` from the previous response | — |
| `sortBy` | string | `rootCreatedAt` (default, date of the root comment) or `lastCommentAt` | — |
| `sortDirection` | string | `desc` (default) or `asc`. `asc` only with `rootCreatedAt` and without `status` | — |
| `status` | string | `open` or `resolved` | — |
| `needsReply` | boolean | `true`: the last comment is from the person and nobody has answered | — |
| `operation` | string | `automatic`, `supervised` or `assistance`. Only threads with their own value; those that inherit from the post do not match | — |
| `owner` | string | Owner's email | — |

<Note type="tip">

Use a single filter at a time among `status`, `needsReply`, `operation` and `owner`. To combine them, filter one in the query and the rest in your code.

</Note>

### Response

```json
{
  "status": "success",
  "data": [
    {
      "id": "17890000000000001",
      "postId": "conv_post_001",
      "status": "open",
      "needsReply": true,
      "commentCount": 2,
      "topic": "Sizes",
      "tags": ["Purchase interest"],
      "operation": null,
      "effectiveOperation": "automatic",
      "owners": [],
      "cases": {
        "open": false,
        "openCount": 0,
        "openIds": [],
        "topPriority": null,
        "oldestOpenAt": null,
        "releasedAt": null,
        "untakenCount": 0,
        "attention": false
      },
      "clientId": "cli_123",
      "authorName": "Ana",
      "authorPhotoUrl": null,
      "authorType": null,
      "authorRole": "user",
      "root": { "text": "Do you have size M?", "isSpam": false, "moderationAction": "none" },
      "replyState": null,
      "resolvedAt": null,
      "resolvedReason": null,
      "privateReplies": {},
      "rootCreatedAt": "2026-10-21T18:20:00.000Z",
      "lastCommentAt": "2026-10-21T18:22:00.000Z"
    }
  ],
  "nextPageToken": null
}
```

<Collapsible summary="Field descriptions">

| Field | Description |
|-------|-------------|
| `status` | `open` or `resolved`. A new comment from the person reopens the thread |
| `needsReply` | The last comment is from the person and nobody has answered |
| `operation` | The thread's own value. `null` = inherits from the post |
| `effectiveOperation` | What applies: `automatic`, `supervised` or `assistance` |
| `owners` | Emails of the owners |
| `cases` | Summary of the thread's cases. On comments, each case lives in a thread: `conversationId` is the post and `threadId` the thread id. See [the `cases` summary](/api-reference/cases#the-cases-summary) |
| `root` | Text and moderation of the root comment |
| `replyState` | `processing` while the agent answers; `failed` if it could not |
| `resolvedReason` | Why it was resolved without a reply (for example `spam`), or `null` |
| `privateReplies` | By `commentId`, the private reply that was sent: `status`, `sentAt`, the DM's `conversationId` |

</Collapsible>

### Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | A parameter is not valid (`details.issues` says which), you combine two filters, you ask for `asc` with `lastCommentAt` or with `status`, the `pageToken` is not from this query, or the credential covers several workspaces and `workspace` is missing |
| `401` | `UNAUTHENTICATED` | The credential is missing or not valid |
| `403` | `FORBIDDEN` | The credential does not have the Conversations module in that workspace |
| `404` | `NOT_FOUND` | The `postId` is not a post of the workspace |

## Get a thread

Get the thread with up to 500 comments in order. Each comment has the fields of `comment` in the [`comment.created`](/api-reference/webhooks/payloads) payload.

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

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

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

```ts
const thread = await platic.posts.threads.get("post_123", "thread_123");
```

</Ways.Way>
</Ways>

```json
{
  "status": "success",
  "data": {
    "id": "17890000000000001",
    "status": "open",
    "needsReply": true,
    "comments": [
      {
        "id": "17890000000000001",
        "postId": "17912345678901234",
        "parentCommentId": null,
        "rootCommentId": "17890000000000001",
        "platform": "instagram",
        "channelId": "igc-17841400000000000",
        "content": "Do you have size M?",
        "contentType": "text",
        "attachments": [],
        "direction": "incoming",
        "role": "user",
        "clientId": "cli_123",
        "authorName": "Ana",
        "isSpam": false,
        "moderation": { "action": "none", "synced": false, "moderatedAt": null },
        "creationDate": "2026-10-21T18:20:00.000Z"
      }
    ],
    "commentsTruncated": false
  }
}
```

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | The credential covers several workspaces and `workspace` is missing |
| `404` | `NOT_FOUND` | The post or the thread does not exist in the workspace |

## Update a thread

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

```bash
curl -X PATCH https://api.platic.ai/v1/posts/$POST_ID/threads/$THREAD_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "resolved" }'
```

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

```ts
await platic.posts.threads.update("post_123", "thread_123", { status: "resolved" });
```

</Ways.Way>
</Ways>

### Request body

Send at least one field.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `status` | string | — | `resolved` marks it resolved; `open` reopens it |
| `operation` | string \| null | — | `supervised` pauses the agent only on this thread; `automatic` resumes it; `null` goes back to inheriting from the post. On a thread in `assistance`, `supervised` accepts the assistance |
| `owners` | array | — | Emails of the owners (maximum 25). Replaces the list |

```json
{
  "status": "resolved"
}
```

Answers the updated thread in `data`, with its comments and `message: "Thread updated"`.

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | The body is empty, has a field that is not accepted, an email in `owners` is not a member of the workspace, or the credential covers several workspaces and `workspace` is missing |
| `404` | `NOT_FOUND` | The post or the thread does not exist in the workspace |

See [errors](/api-reference/posts#errors) for the rest of the codes in this section.
