https://retellai.com/?utm_source=discord&utm_medium=seo logo
override_agent_id does not seem to be working via ...
# ❓・ai-evy-support
c
@AI Evy override_agent_id does not seem to be working via API. I have my number set to one outbound agent. When I make an API call to create call, I attempt to use user another agent using override_agent_id with no success.
a
Thanks for tagging me @conner8079. I'll look through relevant sources and get back to you shortly.
### Answer Based on the documentation, when creating a phone call you should use
override_agent_id
(not
agent_id
) to override the agent for a specific call [(1) ]() . The parameter
override_agent_id
is specifically designed for this purpose - it overrides the agent used for this particular call without binding the agent to the number permanently . Here's the correct usage from the documentation:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneCallResponse = await client.call.createPhoneCall({
 from_number: '+12137771234',
 to_number: '+12137771235',
 override_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
}) ;
A common issue mentioned in the community is that if the from_number is assigned to an agent in the dashboard, it will override your parameters [(2) ]() . This means the phone number's bound agent takes precedence over the override parameter. To resolve this: 1. Ensure you're using
override_agent_id
instead of
agent_id
[(1) ]() 2. Check if your from_number has an outbound agent bound to it in the dashboard [(3) ]() 3. If needed, you can temporarily unbind the agent from the phone number using the update phone number API by setting
outbound_agent_id
to null [(3) ]()
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[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) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy I did unbind the agent from the phone number then attempted to do this. "from_number": "+16205826635", "to_number": "+14194197777", "override_agent_id": "133e650de7fe560b264d8f122b", I just got a 404 error
a
Thanks for the follow-up, @conner8079. I'll get back to you soon.
### Answer A 404 error when creating a phone call typically indicates that one of the resources you're referencing doesn't exist or can't be found [(1) ]() . Based on your parameters, here are the most likely causes: 1. **Invalid `override_agent_id`**: The agent ID
133e650de7fe560b264d8f122b
may not exist or may be incorrect . Agent IDs in the documentation examples follow the format
oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD
. 2. **Phone number ownership**: The
from_number
+16205826635
must be a number purchased from Retell or imported to Retell . If this number isn't owned by your account, you'll get a 404 error. 3. **Destination number restrictions**: If using a number purchased from Retell, only US numbers are supported as destination . Your
to_number
+14194197777
appears to be a US number, so this shouldn't be the issue. To troubleshoot: 1. Verify your agent ID exists by checking your dashboard or using the agent API 2. Confirm the
from_number
is owned by your Retell account [(2) ]() [(3) ]() 3. Ensure you're using the correct API endpoint format with proper authentication headers [(1) ]() Here's the correct API call structure from the documentation:
Copy code
javascript
const response = await retellClient.call.createPhoneCall({
  from_number: '+14157774444',
  to_number: '+12137774445',
  override_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD'
}) ;
[(4) ]()
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] Create Phone Number](https://docs.retellai.com/api-references/create-phone-number) [[3] Get Phone Number](https://docs.retellai.com/api-references/get-phone-number) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy is there anyway to configure the callback optiosn? For example if i want the agent to call the person back 10 minutes later if they do not answer? It seems like right now it calls back very quickly
a
Thanks for the follow-up, @conner8079. I'll get back to you soon.
### Answer I don't have information about configuring callback timing options in the available sources. The agent API documentation shows various configuration options like
reminder_trigger_ms
[(1) ]() [(2) ]() [(3) ]() [(4) ]() and
ring_duration_ms
, but these relate to reminders during active calls and ring duration, not callback retry timing. Check out these potentially useful sources: [List Agents]() , [Create Agent]() , [Update Agent]() Would you like me to try to answer generally based on my knowledge instead?
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.