maliawan.
09/10/2025, 2:32 PMAI Evy
09/10/2025, 2:32 PMAI Evy
09/10/2025, 2:33 PMcall_started - Triggered when a new call begins
- call_ended - Triggered when a call completes, transfers, or encounters an error
- call_analyzed - Triggered when call analysis is complete
For post-call data, you'll primarily use the call_analyzed webhook, which includes the full call data including the call_analysis object .
Here's how to set up your webhook endpoint [(2) ]() :
javascript
// install the sdk: <https://docs.retellai.com/get-started/sdk>
import { Retell } from "retell-sdk";
import express, { Request, Response } from "express";
const app = express() ;
app.use(express.json() ) ;
app.post("/webhook", (req: Request, res: Response) => {
const {event, call} = req.body;
switch (event) {
case "call_started":
console.log("Call started event received", call.call_id) ;
break;
case "call_ended":
console.log("Call ended event received", call.call_id) ;
break;
case "call_analyzed":
console.log("Call analyzed event received", call.call_id) ;
break;
default:
console.log("Received an unknown event:", event) ;
}
// Acknowledge the receipt of the event
res.status(204) .send() ;
}) ;
The webhook payload for call_analyzed events includes [(3) ]() :
json
{
"event_type": "call_analysis",
"call_analysis": {
// Analysis results object
}
}
To complete the setup, you'll need to register your webhook URL with Retell AI and ensure your endpoint can handle POST requests with a 10-second timeout [(1) ]() .AI Evy
09/10/2025, 2:33 PMAI Evy
09/10/2025, 2:33 PM