https://retellai.com/?utm_source=discord&utm_medium=seo logo
what is the format of inbound webhooks (if you al...
# ❓・ai-evy-support
n
@AI Evy what is the format of inbound webhooks (if you already know the customer's language) for multilingual agent setting
a
Thanks for tagging me @Nameless. I'll look through relevant sources and get back to you shortly.
Copy code
json
{
 "call_inbound": {
 "override_agent_id": "agent_12345",
 "override_agent_version": 1,
 "agent_override": {
 "agent": {
 "voice_id": "11labs-Adrian",
 "voice_temperature": 0.6,
 "interruption_sensitivity": 0.8,
 "max_call_duration_ms": 1800000
 },
 "retell_llm": {
 "model": "gpt-4o-mini",
 "model_temperature": 0.2,
 "knowledge_base_ids": ["kb_abc123"],
 "start_speaker": "agent",
 "begin_message": "Hi {{customer_name}}, thanks for calling."
 }
 },
 "dynamic_variables": {
 "customer_name": "John Doe"
 },
 "metadata": {
 "random_id": "12345"
 }
 }
}
The chosen language must be supported by the selected voice and a speech recognition provider, so check the language picker in the dashboard for valid combinations. [(1) ]() Two things to keep in mind: - The response must be valid JSON in this structure. A community thread notes that returning a non-JSON "first incoming item" response from n8n was the cause of a failed inbound webhook. [(3) ]() - If the webhook fails or returns an invalid format, Retell retries up to 3 total attempts, then falls back to the number's inbound agent if one is set, otherwise the call is disconnected. [(2) ]()
### Answer If you already know the caller's language, you can override it per call through the inbound call webhook instead of relying on multilingual auto-detect. This gives single-language accuracy on each call. [(1) ]() The webhook `POST`s a payload to your endpoint. For an inbound call it looks like this: [(2) ]()
Copy code
json
{
 "event": "call_inbound",
 "event_timestamp": 1780012672105,
 "call_inbound": {
 "call_id": "call_12345",
 "agent_id": "agent_12345",
 "agent_version": 1,
 "from_number": "+12137771234",
 "to_number": "+12137771235",
 "custom_sip_headers": {
 "x-my-header": "my-value",
 "user-to-user": "616263;encoding=hex"
 }
 }
}
Your endpoint responds with JSON (2xx status) with fields grouped under
call_inbound
. All fields are optional. To set the language for that call, return an
agent_override
object. The
agent
group supports a
language
field, among others. Overrides apply only to that call and must satisfy the same validation rules as agent creation (for example, voice/language compatibility) . The documentation doesn't include a sample response showing a
language
value specifically. The sample response below shows the general structure with
agent_override
, and you would add
language
inside the
agent
object:
​ To learn more, see the sources I considered: [[1] Set language for your agent](https://docs.retellai.com/agent/language) [[2] Inbound call & SMS webhook](https://docs.retellai.com/features/inbound-call-webhook) [[3] Discord message from @sanava.ai on 2025-08-04](https://discord.com/channels/1186424376300679209/1186462578310910112/1402049622851059792) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
i don't understand, so what shall the argument be for langauge switch is there a way to design the prompt (standalone) for each respective langauge? @AI Evy
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer The argument for the language switch is the
language
field inside
agent_override.agent
in your inbound webhook response. The documentation lists
language
as a supported field in the
agent
group, but it doesn't show a sample value or the exact language code format, so check the language picker in the dashboard for valid values. [(1) ]()
Copy code
json
{
 "call_inbound": {
 "override_agent_id": "agent_12345",
 "override_agent_version": 1,
 "agent_override": {
 "agent": {
 "voice_id": "11labs-Adrian",
 "voice_temperature": 0.6,
 "interruption_sensitivity": 0.8,
 "max_call_duration_ms": 1800000
 },
 "retell_llm": {
 "model": "gpt-4o-mini",
 "model_temperature": 0.2,
 "knowledge_base_ids": ["kb_abc123"],
 "start_speaker": "agent",
 "begin_message": "Hi {{customer_name}}, thanks for calling."
 }
 },
 "dynamic_variables": {
 "customer_name": "John Doe"
 },
 "metadata": {
 "random_id": "12345"
 }
 }
}
That sample has no
language
value, so you would add
language
inside the
agent
object yourself. The chosen language must be supported by both the selected voice and a speech recognition provider. [(2) ]() For a standalone prompt per language, the documented approach is to build one agent per language and pick it per call: - Return
override_agent_id
(and optionally
override_agent_version
) in the webhook response to route the call to a different agent. [(1) ]() - Each language-specific agent can then have its own prompt and its own single
language
setting. A single-language agent transcribes in one language, uses that language's pronunciation, and responds in that language. [(2) ]() - If you use an agent override, the target agent is resolved by id/version first, then
agent_override
is applied on top for that call only. [(1) ]() Through
agent_override.retell_llm
, you can also override
begin_message
per call, but the documentation doesn't list a field for overriding the full prompt in the inbound webhook. I don't have documented guidance on swapping the full prompt text via the webhook beyond routing to a different agent and using dynamic variables (for example,
{{customer_name}}
in the
begin_message
) . [(3) ]()
​ To learn more, see the sources I considered: [[1] Inbound call & SMS webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Set language for your agent](https://docs.retellai.com/agent/language) [[3] Dynamic variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
can you output a sample json template for a multilingual conversation flow with sample content @AI Evy
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer I don't have a documented JSON template for a multilingual conversation flow, so I can't provide one without inventing fields. None of the available sources show the conversation flow JSON schema or a multilingual flow example. Here is what the sources do document about building the pieces of such a flow: - A conversation flow is a graph of nodes connected by edges. Each edge carries a transition condition, and node types include Conversation, Extract DV, Logic Split, Transfer Agent, and others. [(1) ]() - A Logic Split node evaluates conditions on entry and branches immediately without speaking. It always has an else destination as a fallback. You could use it to branch on a dynamic variable, such as one holding the caller's language. - A Transfer Agent node hands the conversation to a different Retell agent mid-call. The destination agent inherits the full conversation history, and the node is preferred for routing between AI agents, for example language-based routing. - Flow conditions support equation conditions over dynamic variables, and the check
{{user_name}} exists
is the documented form for testing whether a variable is set. [(2) ]() - An Extract DV node can capture a value from the conversation as a dynamic variable. Variable types are Text, Number, Boolean, and Enum. [(1) ]()
Copy code
Equation: {{user_name}} exists
[(2) ]() If you want a per-language design, the documented building blocks are a Logic Split node that branches on a language variable, plus Transfer Agent nodes that route to one agent per language. [(1) ]() For the exact JSON schema of a conversation flow, check the Retell AI documentation or the export from the dashboard editor, since I can't confirm field names from the sources here. Check out these potentially useful sources: [Nodes and edges]() , [Dynamic variables]() , [Retell AI's Advanced Conversation Flow]() I could try to answer more generally based on my knowledge if you'd like.
​ To learn more, see the sources I considered: [[1] Nodes and edges](https://docs.retellai.com/build/conversation-flow/node) [[2] Dynamic variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @Nameless. I'll get back to you soon.
n
@AI Evy what is the template/ prompt i shall use if i want an AI agent to extract json of a call flow and update it whenever i need to do so
a
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[2] Nodes and edges](https://docs.retellai.com/build/conversation-flow/node) [[3] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) [[4] Custom function in conversation flow](https://docs.retellai.com/build/conversation-flow/custom-function) ​
### Answer I don't have a documented template or prompt for having an AI agent extract and update the JSON of a call flow. The available sources don't show the conversation flow JSON schema or any prompt for exporting or editing a flow's JSON, so I can't give you one without inventing fields. What the sources do cover: - The Conversation Flow API lets you create and manage conversation flows programmatically. [(1) ]() The changelog only announces this, and the field-level details are in the API reference's Create Conversation Flow page: [Create Conversation Flow]() . - Flows are built from nodes connected by edges, and each edge carries a transition condition. [(2) ]() - If you want an agent to capture values during a call (not the flow structure itself) , the Extract Dynamic Variable tool saves values from the conversation as typed dynamic variables. [(3) ]() Those values can then be passed to a custom function that calls your own API. [(4) ]() Because the sources don't describe a way to retrieve or modify a flow's JSON from within a live agent, I can't confirm that workflow is supported. To work with the flow JSON, use the Conversation Flow API from your own code or automation instead. Check out these potentially useful sources: [Create Conversation Flow]() , [Nodes and edges]() , [Custom function in conversation flow]() I could try to answer more generally based on my knowledge if you'd like.
n
@AI Evy ok just give me a draft python code to extract and update conversation flow from retell
a
Thanks for the follow-up, @Nameless. I'll get back to you soon.
### Answer Retrieving a conversation flow is documented in Python. The documentation also shows a create call, but I don't have a documented Python example for updating a flow, so I can't give you exact update code. Extract (retrieve) a conversation flow
Copy code
python
import os
from retell import Retell
client = Retell(
    api_key=os.environ.get("RETELL_API_KEY") ,  # This is the default and can be omitted
)
conversation_flow_response = client.conversation_flow.retrieve(
    conversation_flow_id="conversation_flow_id",
)
print(conversation_flow_response.conversation_flow_id)
[(1) ]() The retrieve endpoint also accepts an optional
version
query parameter, which defaults to the latest version. Update a conversation flow A community thread confirms there is an update conversation flow API, and that it is the one that creates tools, while the create endpoint accepted a
tools
parameter without applying it. [(2) ]() The thread links the [Update Conversation Flow API reference]() , but the sources here don't include its Python signature or parameters. I won't invent that call. What you can do with the documented pieces - Use
client.conversation_flow.retrieve(...)
to fetch the flow, which returns fields such as
nodes
,
tools
,
global_prompt
, and
start_node_id
. [(1) ]() - Edit that data in your own code, then send it back through the update endpoint, following the parameters on the Update Conversation Flow reference page. Create is documented with required fields
model_choice
,
nodes
, and
start_speaker
, which is useful if you want to create a new flow from a modified copy instead. [(3) ]() If you'd like, I can try a general draft based on my own knowledge, though it won't be backed by the documented update call.
​ To learn more, see the sources I considered: [[1] Get Conversation Flow](https://docs.retellai.com/api-references/get-conversation-flow) [[2] Tool creation not working via conversation_flow method (python sdk)](https://discord.com/channels/1186424376300679209/1408324136060715099) [[3] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.