https://retellai.com/?utm_source=discord&utm_medium=seo logo
📋 Questions for You Before I Implement:For call i...
# ❓・ai-evy-support
c
@AI Evy 📋 Questions for You Before I Implement: For call initiation (initiate-call, initiate-demo-call, submit-demo-*): Does Retell have an equivalent API to initiate outbound calls? Retell's outbound call API endpoint: Is it https://api.retellai.com/v2/create-phone-call? For get-agent: Should this now fetch from https://api.retellai.com/v2/get-agent/{retell_agent_id} instead? For demo agents (create-demo-agent, delete-demo-agent): Should these use the same Retell sync flow, or are demo agents a separate concept? For phone number management (manage-phone-numbers): Since you already have retell-manage-phone-numbers, should we deprecate the old one or keep both for Twilio-only numbers? Database columns: Should we add migration to populate retell_agent_id from synced agents and eventually drop vapi_assistant_id? Same for vapi_phone_number_id → retell_phone_number_id?
a
Thanks for tagging me @clientnexus_71205. I'll look through relevant sources and get back to you shortly.
### Answer --- ## 1. Outbound Call Initiation Yes, Retell has an equivalent API to initiate outbound calls [(1) ]() . The endpoint is:
Copy code
POST <https://api.retellai.com/v2/create-phone-call>
[(1) ]() [(2) ]() You can use the SDK like this:
Copy code
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) ;
[(2) ]() --- ## 2. Get Agent Endpoint The sources don't explicitly document a `GET endpoint. However, the Create Agent API [(3) ]() suggests agents are created and managed via the API. I don't have direct information confirming the exact GET endpoint structure you mentioned. If you'd like, I can try to provide a general answer based on typical REST API patterns. --- ## 3. Demo Agents I don't have information in the sources about "demo agents" as a separate concept in Retell AI. The sources cover standard agent creation but don't distinguish between demo and production agents. --- ## 4. Phone Number Management Retell supports phone number management through these endpoints: - **List Phone Numbers**:
GET /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:
Copy code
javascript
const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
 inbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
 nickname: 'Frontdesk Number',
 outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
}) ;
[(5) ]() [(6) ]() Whether to deprecate your old Twilio-only management depends on your architecture—Retell's API handles phone numbers purchased through Retell or imported from providers like Twilio [(1) ]() . --- ## 5. Database Migration The sources don't provide guidance on database schema migration from VAPI to Retell. This is an implementation decision based on your system architecture. --- For additional support: - Visit [Contact Sales]() - Visit [) Would you like me to provide a general answer on the topics where direct documentation wasn't available? ---
​ To learn more, see the sources I considered: [[1] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) [[2] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[3] Create Agent](https://docs.retellai.com/api-references/create-agent) [[4] List Phone Numbers](https://docs.retellai.com/api-references/list-phone-numbers) [[5] Update Phone Number](https://docs.retellai.com/api-references/update-phone-number) [[6] 404 Error on Create a Phone Call](https://retell.discourse.group/t/404-error-on-create-a-phone-call/22) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @clientnexus_71205. I'll get back to you soon.
c
@AI Evy I need these answers from Retell: 1. Phone Call Initiation API Currently using: // Vapi (current) fetch('https://api.vapi.ai/call/phone', { method: 'POST', headers: { 'Authorization':
Bearer ${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 endpoint
a
### Answer --- ## 1. Phone Call Initiation API Yes, your expected API structure is correct [(1) ]() . The endpoint is:
Copy code
POST <https://api.retellai.com/v2/create-phone-call>
Here's the exact SDK usage:
Copy code
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:
Copy code
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:
Copy code
GET <https://api.retellai.com/get-agent/%7Bagent_id%7D>
SDK usage:
Copy code
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) ]() :
Copy code
javascript
const phoneNumberResponse = await client.phoneNumber.create() ;
console.log(phoneNumberResponse.inbound_agent_id) ;
Or update an existing number [(5) ]() :
Copy code
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
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] Get Agent](https://docs.retellai.com/api-references/get-agent) [[3] Create Phone Number](https://docs.retellai.com/api-references/create-phone-number) [[4] 404 Error on Create a Phone Call](https://retell.discourse.group/t/404-error-on-create-a-phone-call/22) [[5] Here is how that can be fixed](https://retell.discourse.group/t/here-is-how-that-can-be-fixed/23) ​
c
@AI Evy can you advise me in set up like a call end up by silence or detect IVRS SO I WILL not be spending lots in credits with ai calls/agents not doing an actual call? or during the call
a
Thanks for the follow-up, @clientnexus_71205. I'll get back to you soon.
### Answer --- ## Ending Calls After Silence Retell provides the
end_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:
Copy code
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:
Copy code
## 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.
Key Challenge: The user noted that when the IVR is talking continuously, the
end_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?
​ To learn more, see the sources I considered: [[1] Step 2: Configure the basic settings](https://docs.retellai.com/build/single-multi-prompt/configure-basic-settings) [[2] Step 1: Configure global settings](https://docs.retellai.com/build/conversation-flow/global-setting) [[3] Get Agent](https://docs.retellai.com/api-references/get-agent) [[4] Issue with end_call_after_silence_ms in create agent](https://discord.com/channels/1186424376300679209/1379512520619982869) [[5] Facing issues with IVR detection and automatically disconnecting the call](https://discord.com/channels/1186424376300679209/1293108308156092416) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.