himansa_e
08/27/2025, 6:25 AMAI Evy
08/27/2025, 6:25 AMAI Evy
08/27/2025, 6:25 AMAI Evy
08/27/2025, 6:25 AMAI Evy
08/27/2025, 6:25 AMhimansa_e
08/27/2025, 6:27 AMhimansa_e
08/27/2025, 6:28 AMAI Evy
08/27/2025, 6:28 AMAI Evy
08/27/2025, 6:28 AMAI Evy
08/27/2025, 6:28 AMAI Evy
08/27/2025, 6:28 AMhimansa_e
08/27/2025, 6:30 AMhimansa_e
08/27/2025, 6:30 AMAI Evy
08/27/2025, 6:30 AMAI Evy
08/27/2025, 6:30 AMAI Evy
08/27/2025, 6:30 AMAI Evy
08/27/2025, 6:30 AMhimansa_e
08/27/2025, 6:31 AMhimansa_e
08/27/2025, 6:31 AMAI Evy
08/27/2025, 6:31 AMAI Evy
08/27/2025, 6:31 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponses = await client.agent.list() ;
console.log(agentResponses) ;
The API requires authentication using an API key that you can manage in your dashboard [(2) ]() . You can create new API keys, delete existing ones, and set webhook keys for authentication .
Could you clarify what specific aspect of the Retell AI API you'd like to know about? For example:
- How to authenticate with the API?
- Specific API endpoints?
- SDK usage examples?
- API integration patterns?
This will help me provide a more targeted response based on the available documentation.AI Evy
08/27/2025, 6:31 AMAI Evy
08/27/2025, 6:31 AMhimansa_e
08/27/2025, 6:34 AMAI Evy
08/27/2025, 6:34 AMAI Evy
08/27/2025, 6:34 AMcall_ended event by configuring webhooks at either the account or agent level .
The webhook system sends two main events :
- call_started - when a call begins
- call_ended - when a call ends
To set this up, you need to configure a webhook URL in your agent configuration [(2) ]() [(3) ]() . The webhook URL can be set when creating or updating an agent [(4) ]() [(3) ]() .
For the Web SDK, you can also listen to call events directly in your frontend code [(5) ]() :
javascript
await retellWebClient.startCall({
accessToken: createCallResponse.access_token,
}) ;
The webhook will send you detailed information about the call when it ends, including call analysis data if you have post-call analysis configured [(6) ]() .AI Evy
08/27/2025, 6:34 AMAI Evy
08/27/2025, 6:34 AMhimansa_e
08/27/2025, 6:34 AMhimansa_e
08/27/2025, 6:34 AMhimansa_e
08/27/2025, 6:35 AMAI Evy
08/27/2025, 6:35 AMAI Evy
08/27/2025, 6:35 AMcall_ended events on your server. This involves setting up a webhook URL in your agent configuration that Retell will call when events occur [(1) ]() .
2. WebSocket Event Handling
If you're using a custom LLM WebSocket server, you can handle call termination events directly in your WebSocket implementation. The WebSocket communication protocol defines how your server communicates with Retell's server [(2) ]() [(1) ]() .
For WebSocket servers, you need to set up a basic WebSocket endpoint to receive messages. The guide provides step-by-step instructions for setting up WebSocket servers using Node.js with Express.js or Python with FastAPI [(2) ]() .
The WebSocket protocol requires your server to handle different event types through the interaction_type field, and you can track when calls end through the WebSocket connection lifecycle [(1) ]() .
You'll need to implement concurrency checks on your side when handling multiple calls [(3) ]() , as Retell doesn't queue calls automatically on their end.AI Evy
08/27/2025, 6:35 AMAI Evy
08/27/2025, 6:35 AM