.manthu
08/24/2025, 11:32 AMAI Evy
08/24/2025, 11:32 AMAI Evy
08/24/2025, 11:32 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponses = await client.phoneNumber.list() ;
console.log(phoneNumberResponses) ;
The Create Web Call API returns an access_token that needs to be passed to your frontend to join the call . There's also a new frontend client SDK specifically for web call users [(1) ]() .AI Evy
08/24/2025, 11:32 AMAI Evy
08/24/2025, 11:32 AMAI Evy
08/25/2025, 12:10 AM.manthu
08/25/2025, 12:10 AMAI Evy
08/25/2025, 12:10 AMagent_id parameter to specify which agent handles the call .
The agent configuration includes all the settings you mentioned:
Shared Configuration:
- **Prompt types**: Both single and multi-prompt agents work with web calls [(3) ]()
- **Function calling**: Custom functions and dynamic variable extraction are supported [(4) ]() [(5) ]()
- **Knowledge base integration**: Available for both call types [(6) ]()
- **Dynamic variables**: Both APIs support retell_llm_dynamic_variables for injecting variables into prompts [(1) ]() [(2) ]()
API Differences:
The main differences are in the required parameters:
Web Call API requires:
javascript
{
agent_id: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
agent_version: 1, // optional
metadata: {}, // optional
retell_llm_dynamic_variables: {} // optional
}
[(2) ]()
Phone Call API requires:
javascript
{
from_number: "+14157774444",
to_number: "+12137774445",
override_agent_id: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD", // optional override
custom_sip_headers: {}, // optional
// plus same metadata and dynamic variables
}AI Evy
08/25/2025, 12:10 AMAI Evy
08/25/2025, 12:10 AM