Skip to main content
POST
TypeScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Create conversation request. The session, tenant, subject, secrets, labels, and pinned parameters all come from the presenting token's session. The browser asserts only the opening message and the client tools it executes.

message
string
required

The visitor's opening message.

clientTools
object

Tools the page defines and executes for this conversation. Only these are loaded alongside the agent's own tools; a client tool replaces an agent tool with the same function name. Each call arrives as a toolCalled event carrying its arguments, and the page reports the result with SetToolCallContent.

Response

OK

WidgetConversation is one conversation between a visitor and a widget's agent. The presenting session must have a tenant and subject. Sessions for that same identity share history on the same widget and agent, subject to the current session's permissions. Other conversation IDs return not found.

id
string
required
read-only
Example:

"obj_01HXKD2E5NQM3T9AYWCFQAZGFV"

state
enum<string>
required
read-only
Available options:
STATE_UNSPECIFIED,
STATE_RESPONDING,
STATE_OPEN,
STATE_CLOSED
createdAt
string<date-time>
required
read-only
title
string
read-only

Server-derived display title (e.g. from the opening message).

lastActiveAt
string<date-time>
read-only

When the conversation last saw a message or event.