cameroncubra
08/05/2025, 11:49 PMAI Evy
08/05/2025, 11:49 PMAI Evy
08/05/2025, 11:49 PMoverride_agent_id parameter to specify an agent that's not bound to the phone number [(1) ]() .
Here's the code example from the documentation:
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) ;
The key parameters are :
- `from_number`: Your Retell number in E.164 format
- `to_number`: The number to call in E.164 format
- `override_agent_id`: Your agent ID (optional override)
You can also include optional dynamic variables [(2) ]() :
javascript
const registerCallResponse = await retell.call.createPhoneCall({
from_number: '+14157774444', // replace with the number you purchased
to_number: '+12137774445', // replace with the number you want to call
retell_llm_dynamic_variables: { // replace with the dynamic variables you want to send (optional)
name: 'John Doe',
blood_group: 'B+'
},
custom_sip_headers: { // replace with custom sip headers you want to send (optional)
X-Custom-Header: 'Custom Value'
}
}) ;
console.log(registerCallResponse) ;
The API endpoint is `POST [(1) ]() .AI Evy
08/05/2025, 11:49 PMAI Evy
08/05/2025, 11:49 PM