---
docId: doc_562e05c5a2ea4131a731947f31c86d2d
title: Conversations
description: Read, search, count and act on the conversations between your agents and your contacts.
---

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

# Conversations

A conversation is one thread of one contact on one channel: WhatsApp, Instagram, Facebook, email, web chat or a chat created through the [Chat API](/api-reference/chat). Its messages are read apart, page by page, and never include system events.

This reference documents **Conversations V2** (`/v2/conversations`). Every V2 action answers the conversation as it is afterwards, says whether anything changed, and is safe to repeat.

Comment threads on Instagram and Facebook posts are not conversations: they have their own resource, [Posts](/api-reference/posts).

## Example

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

```bash
# Active conversations a person is handling, with the agent's name
curl "https://api.platic.ai/v2/conversations?status=active&operation=supervised&include=agents" \
  -H "Authorization: Bearer $PLATIC_API_KEY"

# The latest messages of one of them
curl "https://api.platic.ai/v2/conversations/$CONVERSATION_ID/messages?limit=20" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

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

```ts
const page = await platic.conversations.list({
  status: ["active"],
  operation: ["supervised"],
  include: ["agents"],
});

const first = page.data[0];
if (first) {
  const messages = await platic.conversations.messages.list(first.id, { limit: 20 });
  for (const message of messages.data) console.log(message.sender?.type, message.content);
}
```

</Ways.Way>
</Ways>

## What you need to know

- **One workspace per call.** A credential acts on its workspace; an API key that covers several sends `?workspace=`.
- **One ID.** `id` is always the conversation's ID. V2 never accepts a phone number or the old V1 `conversationId` key.
- **You choose the fields.** `fields` replaces the default fields and `include` resolves agents, channels, assignees or message authors once per response in `included`. Unknown names answer `400`; nothing is ignored silently.
- **The history is separate.** [Get a conversation](/api-reference/conversations/get) does not return messages. [List messages](/api-reference/conversations/messages) pages through them.
- **Lists use tokens.** Send `nextPageToken` as `pageToken` until it is `null`. A page can be short, or empty, and still have a token. See [Pagination](/api-reference/pagination).
- **You only see what you may read.** A conversation out of reach answers `404`, like one that does not exist. See [Who sees what](#who-sees-what).

## Endpoints

### Read

| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | [`/v2/conversations`](/api-reference/conversations/list) | List conversations with filters, sorting and field selection |
| `POST` | [`/v2/conversations/search`](/api-reference/conversations/search) | Search by words, meaning or both, with filters |
| `GET` | [`/v2/conversations/counts`](/api-reference/conversations/counts) | Exact counts by operation, status, agent or channel |
| `GET` | [`/v2/conversations/{conversationId}`](/api-reference/conversations/get) | Get one conversation, without its messages |
| `GET` | [`/v2/conversations/{conversationId}/messages`](/api-reference/conversations/messages) | List the visible messages of a conversation |
| `GET` | [`/v2/conversations/{conversationId}/messages/{messageId}`](/api-reference/conversations/message) | Get one message |

### Act

| Method | Endpoint | Description |
|--------|----------|-------------|
| `PATCH` | [`/v2/conversations/{conversationId}`](/api-reference/conversations/update) | Change the topic, or the title of a team chat |
| `PUT` | [`/v2/conversations/{conversationId}/tags`](/api-reference/conversations/tags) | Replace the tags of a conversation |
| `PATCH` | [`/v2/conversations/{conversationId}/tags`](/api-reference/conversations/tags) | Add or remove tags |
| `PUT` | [`/v2/conversations/{conversationId}/assignees`](/api-reference/conversations/assignees) | Replace the team members assigned |
| `PATCH` | [`/v2/conversations/{conversationId}/assignees`](/api-reference/conversations/assignees) | Add or remove assignees |
| `POST` | [`/v2/conversations/{conversationId}/pause`](/api-reference/conversations/pause) | Pause the agent so a person handles the conversation |
| `POST` | [`/v2/conversations/{conversationId}/resume`](/api-reference/conversations/resume) | Give the conversation back to the agent |
| `POST` | [`/v2/conversations/{conversationId}/wait`](/api-reference/conversations/wait) | Hand it back to the agent on the contact's next message |
| `POST` | [`/v2/conversations/{conversationId}/finish`](/api-reference/conversations/finish) | Finish a conversation |
| `POST` | [`/v2/conversations/{conversationId}/archive`](/api-reference/conversations/archive) | Archive a conversation |
| `POST` | [`/v2/conversations/{conversationId}/reopen`](/api-reference/conversations/reopen) | Reopen a conversation |
| `PUT` | [`/v2/conversations/{conversationId}/agent`](/api-reference/conversations/agent) | Change the main agent |
| `PUT` | [`/v2/conversations/{conversationId}/spam`](/api-reference/conversations/spam) | Mark or unmark a conversation as spam |
| `POST` | [`/v2/conversations/bulk`](/api-reference/conversations/bulk) | Run one action on up to 100 conversations |

## How IDs work

| Field | What it identifies |
|-------|--------------------|
| `id` | The conversation. Use it in every `/v2/conversations/{conversationId}` call |
| `contactId` | The [contact](/api-reference/contacts) (`clients` in the API). One contact can have several conversations, on different channels or with different agents |
| `channelId` | The channel the conversation runs on |
| `agentId` | The main agent. A subagent taking a turn does not change it; that one is `activeAgentId` |
| `legacyConversationKey` | The old V1 `conversationId` key, a phone number or thread key on some channels. Ask for it in `fields` for diagnosis only: V2 never accepts it as an ID |

A message's `id` is Platica's own ID, never the provider's. The provider's ID is `providerMessageId`.

## Status and operation

A conversation has two separate dimensions:

- **`status`** is its visible state: `initiated`, `active`, `finished`, `archived` or `spam`. `spam` wins over everything; otherwise a closed conversation is `archived`; otherwise it is `initiated`, `active` or `finished`. A stored state the API does not recognize comes back as `null`, with an `UNKNOWN_STATUS` warning in `meta.warnings`.
- **`operation`** says who answers: `automatic` (the agent), `supervised` (a person) or `assistance` (the agent asked a person for help).

A supervised conversation is still `active`. [Pausing](/api-reference/conversations/pause) and [resuming](/api-reference/conversations/resume) change `operation`; [finishing](/api-reference/conversations/finish), [archiving](/api-reference/conversations/archive) and [reopening](/api-reference/conversations/reopen) change `status`.

## Who sees what

- An **API key** reads every conversation in its workspace.
- An **OAuth connection** acts as the person who authorized it, with their current permissions. If their role only reaches assigned conversations, they only see conversations assigned to them or to `team`, in lists, search, counts and `included`. Any other conversation answers `404 CONVERSATION_NOT_FOUND`, exactly like one that does not exist.
- A permission revoked or an assignment changed applies on the next call, even with a page token in hand.
- A credential without access to conversations in the workspace gets `403`. Reads, including search, work with read-only credentials; actions need write access.

<Note type="note">

**V1 is deprecated.** The previous endpoints still work: [List conversations V1](/api-reference/conversations/v1/list), [Get a conversation V1](/api-reference/conversations/v1/get), [Search conversations V1](/api-reference/conversations/v1/search), [Update a conversation V1](/api-reference/conversations/v1/update) and [Pause the agent V1](/api-reference/conversations/v1/pause). Use the version selector on each page to switch between them.

</Note>
