faizan_53123
10/07/2025, 8:05 AMAI Evy
10/07/2025, 8:05 AMAI Evy
10/07/2025, 8:05 AMcall_analysis event :
json
{
"event_type": "call_analysis",
"call_analysis": {
// Analysis results object
}
}
You can also access call completion information through the Get Call API [(1) ]() , which provides details like transcript, recording, and latency tracking . The webhook approach gives you real-time updates when a call is initiated, ends, and analyzed .
For webhook configuration and setup details, you can refer to the Webhook Configuration section [(2) ]() .AI Evy
10/07/2025, 8:05 AMAI Evy
10/07/2025, 8:05 AMfaizan_53123
10/07/2025, 8:07 AMAI Evy
10/07/2025, 8:07 AMAI Evy
10/07/2025, 8:07 AMwebhook_url parameter :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
The webhook will receive events when calls end, and you can check the call_analysis object to determine if the call was successful [(2) ]() . The call analysis includes fields like call_successful and user_sentiment .
## Custom LLM WebSocket Integration
If you're using a custom LLM via WebSocket, you can send a response_event with end_call set to true to programmatically end the call [(3) ]() :
json
{
"response_type": "response",
"response_id": "response_001",
"content": "Thank you for calling. Have a great day!",
"content_complete": true,
"end_call": true
}
## Tool Call Integration
During the call, you can use tool call invocation events to trigger external APIs . Send tool_call_invocation events through the WebSocket to call your functions .
The webhook approach is typically the most straightforward for triggering actions after call completion, as it provides comprehensive call analysis data including success indicators [(2) ]() .AI Evy
10/07/2025, 8:07 AMAI Evy
10/07/2025, 8:07 AM