Send chat message
Send one message as the customer and get the agent's reply, plus the tools it called on this turn with their arguments and results.
The agent can close the chat itself, as on a call: with its end call
tool (end_call) when the conversation is done, or its transfer tool
(transfer_call) when the customer must go to a person, in which case
it tells them the number. The response then has status: ended,
ended_by, transferred_to and the whole transcript. The chat is
already saved: show the reply and stop. Both tools follow the agent's
own end call and transfer settings.
In a test chat, tool_results here applies to this turn only, on top
of the ones set when the session was created; use it to make a tool
fail on one turn. A live chat refuses tool_results.
Path parameters
session_idintegerrequiredThe session_id from Create chat session.
Body
messagestringrequiredWhat the caller says.
tool_resultsobjectTest chats only. What each of the agent's tools returns, keyed by
tool name. The agent sees the value as the tool's result. Script a
failure as {"status": "error", "error": "<short_code>"}. A tool you
leave out returns {"status": "ok", "data": {}}.
Was this page helpful?
Create chat session
Open a text chat with an agent and get its greeting. Then send messages with Send chat message, and call End chat session when you are done. A session with no message for 30 minutes ends on its own.
End chat session
Save the chat and start post-call analysis (and, in a live chat, the agent's post-call actions). Ending a chat twice is harmless. A session with no message for 30 minutes is ended for you. Then call Get chat session until analysis_status is done to read the full record.
