clientnexus_71205
11/25/2025, 6:01 PMAI Evy
11/25/2025, 6:02 PMAI Evy
11/25/2025, 6:02 PMPOST <https://api.retellai.com/v2/create-phone-call>
[(1) ]() [(2) ]()
You can use the SDK like this:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
}) ;
console.log(phoneCallResponse.agent_id) ;AI Evy
11/25/2025, 6:02 PMGET /list-phone-numbers [(4) ]()
- **Update Phone Number**: PATCH /update-phone-number/{phone_number} [(5) ]()
You can update a phone number to bind agents for inbound/outbound calls:
javascript
const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
inbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
nickname: 'Frontdesk Number',
outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
}) ;AI Evy
11/25/2025, 6:02 PMAI Evy
11/25/2025, 6:02 PMAI Evy
11/25/2025, 6:02 PMAI Evy
11/25/2025, 6:19 PMclientnexus_71205
11/25/2025, 6:19 PMBearer ${VAPI_TOKEN} },
body: JSON.stringify({
assistantId: agent.vapi_assistant_id,
phoneNumberId: defaultPhone.vapi_phone_number_id,
customer: { number: '+1234567890' },
assistantOverrides: { variableValues: {...} }
})
})
Question for Retell: What's the equivalent API? Is it:
// Retell (expected?)
fetch('https://api.retellai.com/v2/create-phone-call', {
method: 'POST',
headers: { 'Authorization': Bearer ${RETELL_API_KEY} },
body: JSON.stringify({
from_number: '+1987654321', // Retell phone number
to_number: '+1234567890', // Customer
agent_id: agent.retell_agent_id,
// Any equivalent to assistantOverrides/variableValues?
})
})
2. Runtime Variables for Calls
In Vapi, we pass context via assistantOverrides.variableValues:
variableValues: {
contact_name: 'John Doe',
business_name: 'Acme Corp',
company_information: '...',
// ... 40+ variables
}
Question for Retell: How do we pass runtime variables when initiating a call? Is there an equivalent parameter?
3. Get Agent Details API
Currently fetching agent details from Vapi for the UI:
fetch(https://api.vapi.ai/assistant/${agent.vapi_assistant_id})
Question for Retell: Is the equivalent:
fetch(https://api.retellai.com/v2/get-agent/${agent.retell_agent_id})
4. Demo Agent Workflow
Currently we clone an agent in Vapi for demo purposes.
Question for Retell: Should we:
A) Create a separate Retell agent for demos (via sync-agent-to-retell)
B) Use the same Retell agent but with different runtime variables
C) Something else?
Webhook URL: Configure ${SUPABASE_URL}/functions/v1/retell-call-webhook as your webhook endpointAI Evy
11/25/2025, 6:20 PMPOST <https://api.retellai.com/v2/create-phone-call>
Here's the exact SDK usage:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
}) ;
console.log(phoneCallResponse.agent_id) ;
Key parameters :
- `from_number`: Your Retell number in E.164 format (must be purchased from or imported to Retell)
- `to_number`: The destination number in E.164 format
- `override_agent_id`: Use this to specify which agent handles the call
---
## 2. Runtime Variables for Calls
Yes, Retell has an equivalent to assistantOverrides.variableValues . Use the retell_llm_dynamic_variables parameter:
javascript
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
override_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
retell_llm_dynamic_variables: {
customer_name: 'John Doe',
business_name: 'Acme Corp',
company_information: '...'
// ... your 40+ variables
}
}) ;
The retell_llm_dynamic_variables object injects dynamic variables in key-value pairs into your Response Engine prompt and tool descriptions . This is only applicable for Response Engine .
You can also use metadata to store arbitrary data for your own reference (like internal customer IDs) , though this isn't used for processing .
---
## 3. Get Agent Details API
Yes, your expected endpoint structure is correct [(2) ]() . The endpoint is:AI Evy
11/25/2025, 6:20 PMGET <https://api.retellai.com/get-agent/%7Bagent_id%7D>
SDK usage:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(agentResponse.agent_id) ;
You can optionally specify a version with the version query parameter . If not provided, it defaults to the latest version .
---
## 4. Demo Agent Workflow
Based on the available documentation, I recommend **Option B**: Use the same Retell agent but with different runtime variables passed via retell_llm_dynamic_variables [(1) ]() .
Since you can pass dynamic variables at call time , you don't need to create separate agents for demos. You can differentiate demo calls by:
- Passing demo-specific variables in retell_llm_dynamic_variables
- Using the metadata field to tag calls as "demo"
However, if your demo workflow requires fundamentally different agent configurations (different prompts, tools, voices, etc.) , then Option A (creating a separate agent) would be appropriate.
---
## Additional Notes
**Phone Number Setup**: Ensure your from_number is properly configured in Retell [(3) ]() [(4) ]() [(5) ]() . The phone number must be purchased from Retell or imported from supported providers (Twilio, Telnyx, etc.) [(3) ]() [(4) ]() .
To configure a phone number for outbound calls [(3) ]() :AI Evy
11/25/2025, 6:20 PMjavascript
const phoneNumberResponse = await client.phoneNumber.create() ;
console.log(phoneNumberResponse.inbound_agent_id) ;
Or update an existing number [(5) ]() :
javascript
const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
inbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
nickname: 'Frontdesk Number',
outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
}) ;
---
For additional support:
- Visit [Contact Sales]()
- Visit AI Evy
11/25/2025, 6:20 PMAI Evy
11/25/2025, 6:20 PMclientnexus_71205
11/26/2025, 12:58 PMAI Evy
11/26/2025, 12:58 PMAI Evy
11/26/2025, 12:58 PMend_call_after_silence_ms parameter to automatically end calls when users remain silent [(1) ]() [(2) ]() [(3) ]() . Configuration Options: 1. In Agent Settings (Dashboard) : Configure End call on silence in the Call Settings section [(1) ]() [(2) ]() . Set the duration (minimum 10,000 ms / 10 seconds, default 600,000 ms / 10 minutes) [(3) ]() . 2. Via API: javascript const agentResponse = await client.agent.create({ // ... other agent config end_call_after_silence_ms: 30000 // 30 seconds }) ; Important Note: The dashboard setting acts as a maximum timeout. If you set end_call_after_silence_ms to 30 seconds via API but the dashboard is configured for 1 minute, the call may still end after 1 minute [(4) ]() . Ensure both settings align. Valid Range: Minimum: 10,000 ms (10 seconds) [(3) ]() Maximum: Not specified, but default is 600,000 ms (10 minutes) --- ## IVR Detection For IVR detection, community members have shared approaches in Discord [(5) ]() . One user successfully implemented IVR detection with this prompt structure : IVR Detection Prompt Example:AI Evy
11/26/2025, 12:59 PM## IVR Instructions Objective: Identify if the callee is an IVR (Interactive Voice Response) system rather than a human responder. Detection Criteria: - Listen for responses typical of an IVR system, such as prompts like "Please press 1 to be transferred," "Select an option from the menu," or any similar instructions that suggest automated voice navigation. - Avoid hanging up for general greeting phrases or questions such as "How may I help you?" or "Thanks for calling." - Analyze if the sentence structure is command-driven, indicating an IVR. Action: If an IVR response is detected, immediately terminate the call while the IVR is speaking by invoking the end_call function and ensure that the execution message is set to an empty string ("") , indicating that no further action or response should be issued.AI Evy
11/26/2025, 12:59 PMend_call function may not execute immediately . They resolved this by modifying their IVR detection prompt (specific modifications not shared) . --- ## Additional Cost-Saving Settings Maximum Call Duration: Set max_call_duration_ms to prevent calls from running indefinitely [(1) ]() [(2) ]() [(3) ]() : - Minimum: 60,000 ms (1 minute) [(3) ]() - Maximum: 7,200,000 ms (2 hours) - Default: 3,600,000 ms (1 hour) Voicemail Detection: Configure voicemail detection to either hang up or leave a message when voicemail is detected [(1) ]() [(2) ]() [(3) ]() . This prevents your agent from having long conversations with voicemail systems. --- For additional support: - Visit [Contact Sales]() - Visit [) Would you like me to provide more details on voicemail detection configuration or help with a specific IVR detection prompt?AI Evy
11/26/2025, 12:59 PMAI Evy
11/26/2025, 12:59 PM