https://retellai.com/?utm_source=discord&utm_medium=seo logo
I see that the Retell API gives me a Twilio Call S...
# ❓・ai-evy-support
g
@AI Evy I see that the Retell API gives me a Twilio Call SID in the call response, but since Twilio is managed under Retell’s account, I don’t have the Twilio Account SID or Auth Token to fetch call details directly from Twilio. Is there a way for me to get the total call duration (AI agent talk time + duration after the call was transferred to an external agent) through Retell’s API or webhooks? Or do I need to bring my own Twilio account to access that information?
a
Thanks for tagging me @george_92412. I'll look through relevant sources and get back to you shortly.
### Answer Retell AI provides call duration information through their API response. The Create Phone Call API returns a
duration_ms
field that shows the total call duration in milliseconds [(1) ]() . You can also access
start_timestamp
and
end_timestamp
fields to calculate the duration yourself . The API response includes:
Copy code
json
{
  "start_timestamp": 1703302407333,
  "end_timestamp": 1703302428855,
  "duration_ms": 10000
}
However, based on the available documentation, I don't see specific information about how the duration is calculated when calls are transferred to external agents or whether this duration includes post-transfer time. For accessing Twilio Call SID information, there's a known issue where the
twilio_call_sid
field may not always be populated depending on your setup [(2) ]() . The field is available when using purchased or imported numbers, but may not work with dial-to-SIP configurations . If you need more detailed call analytics beyond what's provided in Retell's API response, you may need to bring your own Twilio account to access the full Twilio call details directly.
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] When using custom telephony (twilio) connected via elastic SIP, I don't receive a twilio_call_sid](https://discord.com/channels/1186424376300679209/1341517149608611840) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
it doesn't contains the time of after call transfer
@AI Evy "start_timestamp": 1756367989238, "end_timestamp": 1756368013786,
a
Thanks for the follow-up, @george_92412. I'll get back to you soon.
### Answer Based on the Retell AI API documentation, the
start_timestamp
and
end_timestamp
fields represent the beginning and end of the call within Retell's system [(1) ]() [(2) ]() [(3) ]() . The
duration_ms
field shows the duration of the call in milliseconds and is available after the call ends . However, you're correct that this duration appears to only cover the time the call was active within Retell's system. The documentation doesn't specify whether the duration includes time after a call transfer to an external agent outside of Retell's control. For post-transfer call duration, you would likely need to: 1. Use your own Twilio account to access the complete call records via Twilio's API 2. Implement call tracking on your external agent system to measure the total duration 3. Combine the Retell call duration with your external system's duration tracking The Retell API provides these timing fields :
Copy code
json
{
  "start_timestamp": 1703302407333,
  "end_timestamp": 1703302428855,
  "duration_ms": 10000
}
But these timestamps reflect when the call started and ended within Retell's system, not necessarily the complete call duration including external transfers.
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) [[2] Get Call](https://docs.retellai.com/api-references/get-call) [[3] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy i want the time which include the external time also
a
Thanks for the follow-up, @george_92412. I'll get back to you soon.
### Answer Based on the available Retell AI API documentation, the
duration_ms
,
start_timestamp
, and
end_timestamp
fields only track the call duration within Retell's system [(1) ]() [(2) ]() . These fields are available after the call ends but do not include time spent with external agents after a call transfer . The API response provides these timing fields [(1) ]() :
Copy code
json
{
  "start_timestamp": 1703302407333,
  "end_timestamp": 1703302428855,
  "duration_ms": 10000
}
Unfortunately, Retell's API does not currently provide a way to capture the total call duration including external transfer time. To get the complete call duration including external agent time, you would need to bring your own Twilio account and use Twilio's API directly to access the full call records. The
twilio_call_sid
field is provided in the response , but since Retell manages the Twilio account, you don't have access to the Account SID or Auth Token needed to query Twilio's API for the complete call details.
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] Get Call](https://docs.retellai.com/api-references/get-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
does there is any way to get this @AI Evy
a
Thanks for the follow-up, @george_92412. I'll get back to you soon.
### Answer Based on the available Retell AI documentation, there is no direct way to get the total call duration including external transfer time through Retell's API [(1) ]() [(2) ]() . The Call Transfer Node documentation indicates that call transfers work for phone calls using Retell numbers and imported numbers, but it doesn't specify duration tracking for post-transfer time [(2) ]() . For call transfers, Retell supports both cold transfer (where the call is simply transferred to a destination number) and warm transfer (where the AI agent first detects if the other side is human before connecting) . However, once the call is transferred to an external agent, the duration tracking appears to remain within Retell's system boundaries. The available options based on the documentation are: 1. **Use your own telephony provider**: The documentation mentions integration with telephony providers like Twilio and Vonage [(3) ]() . By bringing your own Twilio account, you would have access to the complete call records including post-transfer duration. 2. **Custom function integration**: You could potentially create custom functions to track transfer events and duration through Retell's API integration capabilities , though this would require additional development work on your end. 3. **Webhook integration**: While not explicitly detailed for duration tracking in the provided sources, you could explore webhook integrations to capture transfer events and implement your own duration tracking system. Unfortunately, the current Retell AI API doesn't provide a built-in method to capture the
complete call duration including time spent with external agents after transfer.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Call Transfer Node](https://docs.retellai.com/build/conversation-flow/call-transfer-node) [[3] Voice API: Integrate Phone AI Agents with Your System | Retell AI](https://www.retellai.com/blog/how-to-integrate-phone-ai-agents-with-your-existing-api-systems) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.