https://retellai.com/?utm_source=discord&utm_medium=seo logo
hey, are we creating different agent for inbound a...
# ❓・ai-evy-support
u
@AI Evy hey, are we creating different agent for inbound and outbound calls?
a
Thanks for tagging me @.manthu. I'll look through relevant sources and get back to you shortly.
### Answer No, you don't need to create different agents for inbound and outbound calls [(1) ]() . You can use the same agent for both call directions . When you configure a phone number, you can set both an
inbound_agent_id
and an
outbound_agent_id
. These can point to the same agent or different agents depending on your needs . For example, when creating or updating a phone number, you can configure it like this:
Copy code
javascript
const phoneNumberResponse = await client.phoneNumber.create({
  inbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
  outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
  // other parameters...
}) ;
In this example, both inbound and outbound calls use the same agent ID . However, you have the flexibility to assign different agents if your use case requires different behavior for incoming versus outgoing calls . Additionally, for outbound calls, you can override the agent on a per-call basis using the
override_agent_id
parameter when creating a phone call [(2) ]() . For inbound calls, you can override the agent by returning
override_agent_id
in your inbound webhook response [(3) ]() .
​ To learn more, see the sources I considered: [[1] Create Phone Number](https://docs.retellai.com/api-references/create-phone-number) [[2] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) [[3] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.