https://retellai.com/?utm_source=discord&utm_medium=seo logo
Importing existing phone number to multiple agents...
# ❓・bug-report
n
We have a registered phone number in our Retell account that we purchased/imported from provider. We're trying to programmatically assign this existing phone number to different agents through our application. Current Issue: We have the phone number already registered in Retell We're trying to import/assign this number to agents during agent creation via API Our backend endpoint includes phone number import logic, but it's not being triggered from frontend We need to use this single phone number across multiple agents Questions: What's the correct API endpoint and method to assign an existing Retell phone number to a new agent programmatically? Can a single phone number be shared across multiple agents? If yes, how do we handle call routing? Should we use the phone number ID or the actual number when making the API call? Is there a specific format or additional parameters required when importing an existing phone number to agents? Could you provide code examples or API documentation for this specific use case? Thank you for your assistance
@User
Is there a way to implement multi-agent routing with a single phone number? Our use case requires dynamically switching between different agent configurations without making PATCH requests each time. Options we're considering: Using webhooks to dynamically change agent behavior Implementing a routing layer before Retell Using custom LLM prompts that change based on caller/context What's the recommended approach for this scenario?
o
Hello @nissssssssssssssssy , Yes you can do that using the inbound webhook
Put your webhook URL on the phone number level , and before every call you will get a webhook in this webhook you can use something called override_agent_id to change the agent , you can put your condition on what agent id you want to use , this way it one number and multiple agents
You will respond to the web hook in this format
Copy code
{
  "call_inbound": {
    "override_agent_id": "agent_12345",
    "override_agent_version": 1,
    "dynamic_variables": {
      "customer_name": "John Doe"
    },
    "metadata": {
      "random_id": "12345"
    }
  }
}
You can remove all the other stuff you don't want just keetp the overrider agent_id to be like this
Copy code
{
  "call_inbound": {
    "override_agent_id": "agent_12345"
  }
}
n
Thank you so much for your help @Omar Ashraf | Community Lead I also want to ask this; @User What I See in Logs: ✅ Agent successfully created: agent_c9xxxxxxxx ✅ API returns 200 OK ✅ Agent ID is valid and working for calls ✅ Prompt is being sent in the request payload: "text prompt xxxxxx..." Problem: ❌ When I check Retell Dashboard, the agent's prompt field is empty ❌ Post-call analysis filters are not showing Are Turkish language prompts handled differently in the dashboard? Is there a specific format required for post_call_analysis_data to appear? Could this be a dashboard display issue while the backend is working correctly? Should I use a different endpoint or method to set these fields? Is there an API endpoint to GET/verify the agent's current prompt and analysis settings?
The system I want to create has a somewhat multi-tenant structure
I want the phone number you mentioned to be continuously imported and updated whenever a new agent is created for a new issue in my system; also completed the inbound webhook process.
And I see the agent being created in my system on the dashboard, but the prompt and post-call analysis filters are still missing..
o
I don't know what endpoint you are trying to use, and Turkish language prompt is not handled differently , for post call analysis will show if you configure them on the agent not sure what format you are talking about.