Daniel D
01/26/2026, 3:31 AMAI Evy
01/26/2026, 3:31 AMAI Evy
01/26/2026, 3:32 AMduration_ms (call duration in milliseconds) for each call. [(1) ]()
```
```AI Evy
01/26/2026, 3:32 AMAI Evy
01/26/2026, 3:32 AMAI Evy
01/26/2026, 3:57 AMDaniel D
01/26/2026, 3:57 AMAI Evy
01/26/2026, 3:58 AMduration_ms — the call duration in milliseconds [(1) ]()
- start_timestamp — begin timestamp (milliseconds since epoch)
- end_timestamp — end timestamp (milliseconds since epoch)
- agent_id — the corresponding agent for the call
Recommended approach:
1. Set up a webhook to listen for call.ended events. The agent's webhook_url field can be configured to receive call events. [(2) ]()
2. Store call data — When a call ends, capture the call_id, agent_id, duration_ms, and start_timestamp in your own database.
3. Query your database — Filter by agent_id and start_timestamp to aggregate total minutes within your designated time window.
4. Convert duration — Since duration_ms is in milliseconds, divide by 60,000 to get minutes.
Example of retrieving a call's details:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponse = await client.call.retrieve('119c3f8e47135a29e65947eeb34cf12d') ;
console.log(callResponse) ;
[(1) ]()
The response will include duration_ms, start_timestamp, and agent_id which you can use for your tracking logic.AI Evy
01/26/2026, 3:58 AMAI Evy
01/26/2026, 3:58 AM