Marlon
08/11/2025, 1:45 AMAI Evy
08/11/2025, 1:45 AMAI Evy
08/11/2025, 1:45 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const webCallResponse = await client.call.createWebCall({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(webCallResponse.agent_id) ;
## Required Variables
The only required variable is agent_id . However, you can include several optional parameters:
- `agent_version`: The version of the agent to use for the call
- `metadata`: An arbitrary object for storage purpose only
- `retell_llm_dynamic_variables`: Key-value pairs of strings that inject into your Response Engine prompt and tool description
## Dynamic Variables Example
For personalized conversations, you can pass dynamic variables [(2) ]() . When creating outbound calls, set your variables in the retell_llm_dynamic_variables field :
json
{
"user_name": "John Smith",
"product_name": "Premium Plan",
"account_status": "active"
}
All values in retell_llm_dynamic_variables must be strings . These variables can be used in your agent's prompt, begin message, tool call descriptions, and other agent configurations .
For phone calls, there's also mention of a Create Phone Call endpoint in the Discord discussions, but the specific documentation for that endpoint isn't available in the sources provided [(3) ]() .AI Evy
08/11/2025, 1:45 AMAI Evy
08/11/2025, 1:45 AMMarlon
08/11/2025, 1:47 AMAI Evy
08/11/2025, 1:48 AMAI Evy
08/11/2025, 1:48 AMjavascript
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) ;
## Required Variables for Phone Calls
The required variables are :
- `from_number`: The number you own in E.164 format (must be purchased from Retell or imported to Retell)
- `to_number`: The number to call
## Optional Variables for Personalization
For user names and other personalized data, you use the retell_llm_dynamic_variables field [(2) ]() [(1) ]() :
json
{
"customer_name": "John Doe"
}
[(1) ]()
Dynamic variables can be used in your agent's prompt, begin message, tool call descriptions, and other configurations [(2) ]() . All values must be strings .
The phone number is a required field for the API call itself, while user names and other personal information are passed as dynamic variables that get injected into your agent's responses .AI Evy
08/11/2025, 1:48 AMAI Evy
08/11/2025, 1:48 AM