https://retellai.com/?utm_source=discord&utm_medium=seo logo
Agent_ID problem (by using api)
# ❓・bug-report
u
@Colin - Integrations @ Retell AI
@Colin - Integrations @ Retell AI
c
can you elaborate on what your issue is?
u
I made new a voice agent by using api
And I have several agents in my retell account. So when I make a new phone call,
Copy code
const callParams = {
      to_number: opts.to_number || opts.customer_number,
      from_number: opts.from_number || env.RETELL_FROM_NUMBER,
      agent_id: opts.agent_id,
      retell_llm_dynamic_variables: opts.retell_llm_dynamic_variables || {}
    };

    // Add metadata if provided
    if (opts.metadata) {
      callParams.metadata = opts.metadata;
    }

    const r = await client.call.createPhoneCall(callParams);
I made like this
But the call is still made by using another agent_id
After when I create a new agent by using api, should I have to publish it ?
Because of this, I have still this error ?
@Colin - Integrations @ Retell AI
c
if you aren't versioning you shouldn't have to publish it
your agent_id must be cached somewhere else
do some deep logging to figure out why its posting the wrong agent
but also.. heres the correct format
Copy code
lua
from retell import Retell

client = Retell(
    api_key="YOUR_RETELL_API_KEY",
)
phone_call_response = client.call.create_phone_call(
    from_number="+14157774444",
    to_number="+12137774445",
)
print(phone_call_response.agent_id)
if the from number is assigned to an agent in the dashboard, it will override your params