---
docId: doc_229ae1a7484d4479af129f23fdfd8db3
title: 'Chat'
description: "Talk to an agent from your application now or in a scheduled turn."
---

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

# Chat

Use the Chat API to talk directly with a Platica agent from your application. Receive the answer in the same HTTP request or schedule the turn for later.

<Note type="important">

Without `delay` or `scheduleAt`, Chat is **synchronous and does not support streaming**. Scheduled
turns return HTTP `202`; fetch the chat after execution. See [Errors and Support](/api-reference/errors) for
response formats and retry guidance.

</Note>

Every answer is `{ "status": "success", "data": … }`. The turn's state (`completed` or `scheduled`) is
`data.status`, and the list carries `nextPageToken` to request the next page with `pageToken`. Each
request works in one workspace: with a multi-workspace credential send `?workspace=<id>`, otherwise
the answer is `400`.

## Available endpoints

| Method | Endpoint | Description |
|--------|----------|-------------|
| `POST` | [`/v1/chat`](/api-reference/chat/send) | Start a conversation or send its next turn |
| `GET` | [`/v1/chat`](/api-reference/chat/list) | List the workspace's chats |
| `GET` | [`/v1/chat/{id}`](/api-reference/chat/get) | Get a chat with its message history |

## Chat versus Conversations

| Resource | Role | Use |
|----------|------|-----|
| [`/v1/chat`](/api-reference/chat/send) | **Talk as the customer** | Send text or attachments to an agent immediately or on a schedule. |
| [`/v2/conversations`](/api-reference/conversations) | **Manage as the business** | Inspect the inbox, pause or resume the agent, assign, tag, finish, archive, reopen and audit threads. |

Chats created through this API also appear in the [Conversations](/api-reference/conversations/list) listings. To close a chat, [finish](/api-reference/conversations/finish) or [archive](/api-reference/conversations/archive) it with its `id`.

## Chat versus Messages

| Resource | Use |
|----------|-----|
| [`/v1/chat`](/api-reference/chat/send) | Your application talks **to an agent** immediately or schedules the turn. |
| [`/v1/messages`](/api-reference/messages/send) | Your business intervenes in an existing conversation or sends an instruction to the agent. |

Use Chat for in-product experiences, agent testing, or backend-to-backend integrations. Use Messages when you need to contact a customer through a connected channel or intervene in a chat as the business.

## Conversation lifecycle

1. Start the thread with `agentId` and a `message`, up to 10 `attachments`, or both.
2. To schedule it, include `delay` or `scheduleAt`. The HTTP `202` response has no agent messages.
3. Save both `id` and `conversationId`: `id` is the canonical document and `conversationId` is the `chat_*` thread. After the scheduled time, poll [`GET /v1/chat/{id}`](/api-reference/chat/get) or `get_chat`; it may return `404` until the task creates the document.
4. Continue with the same `conversationId`. Sending another `agentId` switches the responding agent without losing history.
5. Manage the thread through [Conversations](/api-reference/conversations). Closing one exact conversation requires its unique `id`, not the chat's `conversationId`.

A closed or expired chat keeps its history and reactivates automatically when it receives another message with the same `conversationId`. To start another thread, call `POST /v1/chat` without a `conversationId`.
Each new request creates another `chat_<uuid>` `conversationId`, even when it uses the same `clientId`.
