https://retellai.com/?utm_source=discord&utm_medium=seo logo
Changing voice and first message from Next.js app ...
# ❓・bug-report
k
Hi 👋 I already have an assistant in Retell AI, and I’d like to programmatically change its voice and its first message (begin_message) from my Next.js app. Should I use PATCH /agents/{agent_id} for the voice and PATCH /update-retell-llm/{llm_id} for the begin_message, or is there a way to override both per session via WebSocket config? Any guidance or example would be greatly appreciated 🙏
@User any help guys ?
t
almost. /update-agent/{agent_id} voice_id / voice_model for the voice
for the (begin_message) just pass a variable and send it as a dynamic variable for the agent to use in the start node
@tonnic.ca I mean it back 200
but nothing changeds
changes*
in the rettel interface the thing is we handling calls using phones so we dont have like a start button or something in our nextjs
should i publish or something from api ?
t
what do you mean nothing changed? voice didn't change? I don't even see a dynamic variable in your prompt
your patch isn't even going to an agent_id.
k
no no I put the agent_id in the var as u see
I cant share stuff in public It is not mine
thats why
but the server back 200 to me
but nothing changes in the Retell dashboard
even when i publish manulay or using api
same thing
@User
t
If you would like to book some time with a certified partner, I am sure one of us can help, but like myself, I believe that most will be a paid service as we are not employees of retell.
o
Hello @khalidrouissi , what you want to achieve here? you want to change the voice mid call? or what ?
k
no I have a doctor dashboard and the doctor wants to change the voice and the first message for anyone call his number
and he wants to change whenever he wants
and from our custome dashbaord
o
for the voice you will need to update the agent it self , for the begin message you will need to update the llm not the agent.
for the voice you can use this try { const response = await axios.patch( "https://api.retellai.com/update-agent/agent_id", { voice_id: "openai-Andrew", // you can change the voice as you want }, { headers: { Authorization:
Bearer key
, "Content-Type": "application/json", }, } ); console.log("Agent updated:", response.data); } catch (error: any) { console.error("Error updating agent:", error.response?.data || error.message); } }
the llm will be the same idea
k
Shall i publish after it ?
o
keep the agent on draft if you have a lot of changes ( that you don't really need to track).
k
sry for late I was sick
My client wants to change the AI Voice and first message from his custome dashboard
it is a custome front end
is there something like an endpoint to do this directly or is it permissible to use something like Web automation playwright for example to do this
I mean I'll do anything to sattisfy my clients and I think this is a very important feature
o
k
I did this
but it dosent change the voice
after the patch
thats why I asked you shall i publish
to let Retell consider my patch
o
So if you kept the agent on draft any changes you will make through the API will take effect without publishing.
k
I'll try it now and tell u what i got