Skip to main content
POST
End a conversation

Authorizations

Authorization
string
header
required

A project API key, created in the dashboard.

Headers

Idempotency-Key
string

A unique key that makes the request safe to retry, such as a V4 UUID. 1 to 255 printable ASCII characters.

Required string length: 1 - 255

Path Parameters

conversation
string
required

ID of the conversation.

Response

The ended conversation.

object
any
required
id
string
required
Example:

"5f0c1c2e-6c1d-4a8f-9a59-0d4c4f1b2a10"

agent
object
required

The agent this belongs to.

channel
enum<string>
required

Share links count as web. playground is a test from an AI agent's playground or a chatbot's builder preview.

Available options:
web,
api,
whatsapp,
instagram,
messenger,
telegram,
playground
user_id
string | null
required

Identifies the person chatting. It's the same in all their conversations with the agent, including for anonymous widget users who aren't contacts. On the web, it's the widget's ID for the user's browser. Through the API, it's derived from external_user_id, or new for each conversation without one. On WhatsApp, it's the user's phone number. On Instagram and Messenger, it's the user's ID for the account or page, and on Telegram, the chat ID. null for some older conversations.

Example:

"0b6f3c1e-8d2a-4f5b-9c7e-1a2b3c4d5e6f"

external_user_id
string | null
required

The external_user_id the conversation was started with through the API, if any.

status
enum<string>
required
Available options:
open,
resolved,
closed
mode
enum<string>
required

The agent only replies in ai mode. In live mode, the team replies. pending_handoff means the conversation is waiting for a team member to take over.

Available options:
ai,
live,
pending_handoff
ended_at
string<date-time> | null
required

Time at which the user's session ended. Ended conversations can't receive user messages.

read
boolean
required

Whether the team has read the latest user message. Read status is shared by the team.

important
boolean
required
priority
enum<string> | null
required
Available options:
low,
medium,
high,
urgent,
null
labels
object[]
required
topics
object[]
required

Always [] for chatbot conversations.

sentiment
enum<string> | null
required

null until the conversation is analysed, and always for chatbot conversations.

Available options:
positive,
neutral,
negative,
unknown,
null
assignee
object | null
required

The assigned team member.

team
object | null
required

The assigned team.

contact
object | null
required

The contact fields shown in the dashboard. zip is the postal code.

variables
object[]
required

The AI agent's custom variables. System variables aren't included. Always [] for chatbot conversations.

locale
string | null
required
country
string | null
required

The user's country as an ISO 3166-1 alpha-2 code, if known.

reply_window
object | null
required

null on channels without a reply window: web, API, and Telegram. On WhatsApp, Instagram, and Messenger, both times are null until the user writes.

created_at
string<date-time> | null
required
last_message_at
string<date-time> | null
required