https://retellai.com/?utm_source=discord&utm_medium=seo logo
if I use multi agent, how can I control agent_ids ...
# ❓・ai-evy-support
u
@AI Evy if I use multi agent, how can I control agent_ids so that I can use the agent what I want for making outboundcall
a
Thanks for tagging me @! Andrii - AI Engineer. I'll look through relevant sources and get back to you shortly.
### Answer When making outbound calls with multiple agents, you can control which agent is used by specifying the
agent_id
parameter in your call request [(1) ]() . Here's how to create an outbound call with a specific agent:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
 response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
 voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
However, there's an important consideration: if your phone number is already assigned to an agent in the dashboard, it will override your agent_id parameter [(2) ]() . This means the phone number's default agent configuration takes precedence over the agent_id you specify in the API call . To ensure you're using the correct agent for outbound calls: 1. Make sure your phone number isn't bound to a specific agent in the dashboard, or 2. Use a phone number that allows agent_id override for outbound calls [(3) ]() [(4) ]() When retrieving phone number details, you can check the
outbound_agent_id
field to see which agent is currently assigned to that number [(3) ]() .
​ To learn more, see the sources I considered: [[1] Create Agent](https://docs.retellai.com/api-references/create-agent) [[2] Agent_ID problem (by using api)](https://discord.com/channels/1186424376300679209/1422374498459717633) [[3] Get Phone Number](https://docs.retellai.com/api-references/get-phone-number) [[4] Import Phone Number](https://docs.retellai.com/api-references/import-phone-number) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@User I mean, I have only one phone number, but I have several voice agents. So when I make call, I should select suitable agent