chat_analyzed is the last chat event. It repeats the ended chat and adds chat_analysis.
When it fires#
After chat_ended has been delivered (or has used up its retries), Tried runs post-chat analysis with the chat agent's post_chat_analysis_model (default gpt-5.6-terra), stores it and sends chat_analyzed.
It fires again when you re-run analysis on an ended chat with POST /rerun-chat-analysis/:chat_id.
Which settings enable it#
chat_analyzedin the chat agent'swebhook_events(on by default).- URL: the chat agent's
webhook_url, else the workspace URL. - Timeout: the workspace timeout, else 10 s.
- Custom fields come from the chat agent's
post_chat_analysis_data.analysis_summary_promptandanalysis_successful_promptcustomise the summary and success judgement.
Payload#
{
"event": "chat_analyzed",
"chat": {
"chat_id": "chat_2d7f1a4c8e0b3f6a9c5e1d42",
"chat_agent_id": "chat_agent_0c4f8e2a6b1d3f5a7c9e2b40",
"agent_name": "Receptionist (chat)",
"chat_type": "api_chat",
"channel": "widget",
"chat_status": "ended",
"retell_llm_dynamic_variables": {
"business_name": "Bondi Dental"
},
"metadata": {
"origin": "https://www.bondidental.com.au",
"public_key_id": "pk_4b8e1d5a9c2f6e0a3d7b1c58"
},
"start_timestamp": 1760679000210,
"end_timestamp": 1760679391020,
"transcript": "Agent: Hi, I'm Ava from Bondi Dental. How can I help?\nUser: Are you open on Saturday?\nAgent: Yes, we're open Saturday from 9am to 1pm.\nUser: Great, thanks.\nAgent: You're welcome. Anything else I can help with?",
"message_with_tool_calls": [
{ "role": "agent", "content": "Hi, I'm Ava from Bondi Dental. How can I help?", "created_timestamp": 1760679000845 },
{ "role": "user", "content": "Are you open on Saturday?", "created_timestamp": 1760679012100 },
{ "role": "agent", "content": "Yes, we're open Saturday from 9am to 1pm.", "created_timestamp": 1760679013320 },
{ "role": "user", "content": "Great, thanks.", "created_timestamp": 1760679030880 },
{ "role": "agent", "content": "You're welcome. Anything else I can help with?", "created_timestamp": 1760679031750 }
],
"chat_analysis": {
"chat_summary": "The visitor asked about Saturday opening hours and was told the clinic is open 9am to 1pm.",
"chat_successful": true,
"user_sentiment": "Positive",
"custom_analysis_data": {
"topic": "opening hours"
}
},
"chat_cost": { "combined_cost": 0.01 }
}
}Fields#
The chat fields are described on chat_started. This event adds:
| Field | Type | Description |
|---|---|---|
chat_analysis.chat_summary |
string | Short summary of the chat |
chat_analysis.chat_successful |
boolean | Whether the chat met its goal |
chat_analysis.user_sentiment |
string | Positive, Negative, Neutral or Unknown |
chat_analysis.custom_analysis_data |
object | One key per post-chat field. Fields the model could not fill are left out |
Chats have no voicemail, so there is no in_voicemail field.
If the analysis model fails twice, chat_summary says the analysis could not be generated, chat_successful is false and user_sentiment is Unknown. In keyless local mode the values come from a mock model. Needs keys
How to respond#
Reply 2xx. The body is ignored. Retries: up to 3 (1 s, 2 s, 4 s).