https://retellai.com/?utm_source=discord&utm_medium=seo logo
extract variable to getting set from inbound call
# ❓・ai-evy-support
n
@AI Evy extract variable to getting set from inbound call
a
Thanks for tagging me @Nick Bele. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
### Answer To extract variables from an inbound call in Retell AI, you need to set up an inbound call webhook [(1) ]() . When an inbound call is received, Retell sends a POST request to your webhook endpoint with information like
from_number
and
to_number
. You can then respond with dynamic variables in your webhook response under the
call_inbound
object . Here's the structure:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "customer_name": "John Doe"
    }
  }
}
The webhook payload you receive will contain : - `agent_id`: if the number has an inbound agent id set - `from_number`: the caller's number - `to_number`: the receiver's number You can use these values to look up customer information in your system and return dynamic variables that will be available to the agent during the call [(1) ]() [(2) ]() . The dynamic variables you set in the webhook response can then be referenced in your agent's prompts using the
{{variable_name}}
syntax [(2) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.