https://retellai.com/?utm_source=discord&utm_medium=seo logo
Using Patch (Call Update), not passing metadata ba...
# ❓・bug-report
m
I have an inbound call, and I want to send variables to it. I'm calling patch/v2/update-call/{call_d} while the call is in progress, and defining a metadata variable. however, that metadata variable (in this case, "customer_id"), is not being passed back into the ongoing call. why isn't this working, and is there a way to pass variables into a call while it's in progress? the use case is that i want to lookup the inbound call in my CRM and have the agent address the caller by their name. https://cdn.discordapp.com/attachments/1405378389443088444/1405378395512115200/image.png?ex=689e9c20&is=689d4aa0&hm=29c7603601dc122592bbda46e083aec6d43274a8611d80efd42be8e6e4009072&
c
the metadata during a call has a few different states, at the start of the call the new state is being used and is not replicated. is there a reason you need to do this?
m
Yes, if I have an inbound call I want the inbound agent to have information about the caller. Therefore, I need to pass variables to the call. How else would I do that? @Colin - Integrations @ Retell AI
@Colin - Integrations @ Retell AI @Omar Ashraf | Community Lead ?
c
retell_dynamic_variables
m
i don't see this in the API docs. is it supposed to work with PATCH? because i'm getting an error from the API that it's not a valid property.
there's no option to include retell_dynamic_variables in the PATCH endpoint and like i said, i need to be able to pass these variables after the call has started. @Colin - Integrations @ Retell AI https://cdn.discordapp.com/attachments/1405378389443088444/1405692580586459186/image.png?ex=689fc0bb&is=689e6f3b&hm=5c01a36ac56774cbade66746b0b8829c0e25bf71b63a36aacfba82e5e8abf3d0&
c
to update a retell dynamic variable, its supplied through the inbound webhook url
you'll set something like customer_name here
and then update it through the inbound webhook
m
which API endpoint do i use to send the data to the call?
c
it's not an endpoint, its an inbound webhook url
that you need to put on your agent
m
i'm not initiating the call through the webhook though
it's an inbound call initating from a customer
after the call starts, i need to look up the customer in my CRM
then i need to push the customer's information back to the existing call
c
when an inbound call comes in, it fires to your webhook automatically
you don't need to initiate anything
m
yes, that part i have set up
but the question is how do i pass variables back to the agent?
c
you would send the payload of something like this
Copy code
json
{
  "call_inbound": {
    "override_agent_id": "agent_12345",
    "override_agent_version": 1,
    "dynamic_variables": {
        "customer_name": "John Doe"
    },
    "metadata": {
        "random_id": "12345"
    }
  }
}
m
sorry, this isn't making sense to me. i'm using retell extensively and have all sorts of webhooks and APIs set up that are working fine. but i'm unable to understand how to push a variable to the agent AFTER the call has started. Step 1: customer calls in Step 2: agent fires webhook initiating sequences in make.com Step 3: make.com identifies customer details Step 4: ---->>> need to push customer detail variables back to agent <<----- when i asked "evy" what to do it said to use the PATCH endpoint, but that only takes METADATA, which you said wouldn't work. i don't understand where you're suggesting i send the "call_inbound" payload. can you explain?
@Colin - Integrations @ Retell AI
o
Go to your phone numbers tab and add your webhook there , then you will receive an inbound webhook , with the customer phone number (from_number) , you can take this number and do your search on the crm then you need to return the webhook using the respond to webhook in the same format colin mention above , and put the values under dynamic_variables like the name email etc.. that is it , and in your prompt you can use these variables normally
m
yes, I think i figured out how to send the webhook response (this was my mistake before). however, the agent is only using the "fallback" response and isn't picking this up. is my syntax correct? https://cdn.discordapp.com/attachments/1405378389443088444/1405701713419304970/image.png?ex=689fc93d&is=689e77bd&hm=2c51466ec444fe4be581f27ff941a271c5adc195cb35d2e0f1bf38b5b3182a3e&
(not sure which of these is correct, but i tried variations and none of them seemed to correctly pass the value during the "call_started" event
o
don't use the retell_dynamic_variables
just the dynamic_variables
just "dynamic_variables" doesn't work either though
o
this in different approach , when you need to add variables while the call is ongoing which you mentioned but your use case can be done much easier using the inbound webhook which he also mentioned later
you don't send it to the call_started you send to the inbound
m
it's not sending to call_started... it's just responding to the inbound webhook. the "call_started" is just a filter i have that detects which of the 3 events to look at.
i would happily follow the documentation on this, but it doesn't really exist
o
it does
i will give you step by step guide here
m
the two red ones are the webhooks. the first one is the initating webhook (the same URL i ahve in my agent). the second red one is the "response", where i've shown the payload: { "call_inbound": { "dynamic_variables": { "customer_id": "Test1" } } https://cdn.discordapp.com/attachments/1405378389443088444/1405703116724240444/image.png?ex=689fca8b&is=689e790b&hm=517bde427b3bbef64cfa9306becf4f1fff4938d561188b40ae2715df0e4e74bc&
this webhook response does correctly fire during the "call_started" event
o
did you add your webhooko at the phone number level not the agent ???
m
ah, no it's added for the agent. i should add it at the phone number i guess. not quite sure what the difference is. does one override the other?
added it, but still doesn't provide the variable; just the fallback.
o
follow these steps
(same webhook)
o
1- create a new scenario or add another route on your old that filter for the inbound webhook
you will receve something like
take the from_number then do your crm search
then return the result like this
Copy code
{
  "call_inbound": {
    "dynamic_variables": {
      "name": "John Doe",
      "email": "email@gmail.com"
    }
  }
}
that's it.
m
i thought there were only 3 event types: call started call analyzed call ended ? where does the "call_inbound" event come from?
o
there are 4
m
oh
o
3 comes from the agent level
1 comes from the phone number level
m
do i need to remove that webhook URL from the agent, once it's already added to the phone number?
o
no
this one send 3 and this one send the other one , you need the 4
m
ok, so i put the webhook in both places, right?
o
I would preferer to make a new one , you can still use the same one but you have to filter for the event types
m
that's fine - i will filter for event = call_inbound and then search for my customer in CRM and then send the webhook response
shiould i use 2 different webhooks, one for the 3 events and one for the 1 event? i'm now getting an error in my first webhook module.
yes, the scenario fails if i call a phone number that has the webhook URL for the phone number. it succeeds if i remove the webhook URL for the phone number
o
create a new one
m
a new webhoook?
o
use new webhook so it can be easier in debugging
o
it's not failing you supposed to respond to that so it can works , how the inbound webhook works it send you the some data and its waiting for you the return something at this time the phone will keep ringing the agent will not anwer till you respond to the webhook.
m
ok, thanks - that makes sense. i figured out why the scenario wasn't working. i've now successfully been able to return a response, which means the scenario in make.com completes successfully. however, the dynamic_variable is still not making it back to the agent. https://cdn.discordapp.com/attachments/1405378389443088444/1405710273804894328/image.png?ex=689fd136&is=689e7fb6&hm=a6125e9da7d2a1a1da785a000f1bccad13d635d93b43644ade5b39c2da2842f1&
it keeps defaulting to the fallback
o
show me the detail logs for this call
m
2025-08-15 00:33:08.772 call_60cece8c7f344de8bae1a8e9262 info: triggering inbound call webhook 2025-08-15 00:33:09.237 call_60cece8c7f344de8bae1a8e9262 error: Error met in inbound call webhook: Error: Invalid webhook response format at triggerIncomingCallWebhook (file:///usr/src/app/dist/api/call_api.js:451:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async file:///usr/src/app/dist/api/call_api.js:712:41 2025-08-15 00:33:09.502 call_60cece8c7f344de8bae1a8e9262 info: Starting call: call_60cece8c7f344de8bae1a8e9262 2025-08-15 00:33:10.432 call_60cece8c7f344de8bae1a8e9262 info: Webhook triggered for call_started 2025-08-15 00:33:10.704 call_60cece8c7f344de8bae1a8e9262 info: Webhook response received for call_started 2025-08-15 00:33:33.587 call_60cece8c7f344de8bae1a8e9262 info: Ending call: call_60cece8c7f344de8bae1a8e9262 2025-08-15 00:33:34.071 call_60cece8c7f344de8bae1a8e9262 info: Webhook triggered for call_ended 2025-08-15 00:33:34.339 call_60cece8c7f344de8bae1a8e9262 info: Webhook response received for call_ended 2025-08-15 00:33:36.424 call_60cece8c7f344de8bae1a8e9262 info: Webhook triggered for call_analyzed 2025-08-15 00:33:41.009 call_60cece8c7f344de8bae1a8e9262 info: Webhook response received for call_analyzed
i actually have to go to a meeting right now, but i'll be back later. you've been very helpful so far - thank you. hopefully it's a simple fix from here 🙏
Any ideas on this @Omar Ashraf | Community Lead ?
now when i have the webhook tied to the phone number on an inbound call i'm getting "the person you are calling is not taking calls". as soon as i remove the phone number webhook, my inbound agent works fine again.
something is seriously buggy here. first of all, the dynamic fallback variables are persisting in memory, even when they're removed from the UI. so i've had to recreate new webhooks each and every time to clear them. secondly, despite returning a valid response, the webhook is not passing the dynamic_variables back to the call. in my call log i continue to get the error below, but i'm following the documentation exactly. "error: Error met in inbound call webhook: Error: Invalid webhook response format at triggerIncomingCallWebhook (file:///usr/src/app/dist/api/call_api.js:451:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async file:///usr/src/app/dist/api/call_api.js:712:41
@Omar Ashraf | Community Lead @Colin - Integrations @ Retell AI - this is a real bug and inhibiting my ability to use the platform. Can you please assist in addressing this
o
Everything seems fine
show me what are you sending in make respond webhook
copy it and send it to me because i believe it's a format thing
m
Copy code
{
  "call_inbound": {
    "override_agent_id": "agent_12345",
    "override_agent_version": 1,
    "dynamic_variables": {
      "customer_id": "John Doe"
    },
    "metadata": {
      "random_id": "12345"
    }
  }
}
o
Copy code
{
  "call_inbound": {
    "dynamic_variables": {
      "customer_name": "omar"
    }
  }
}
try this
and show me the detail logs of the call
m
that worked, finally 😅 so the payload example in the docs does NOT work
o
It does but it is just an example, you have to change it based on your need
m
o
Missing } count them
m
i think i might have been missing a curly bracket in that example, actually
yea
let me re-try
it works
thank you
(still there's that bug about the fallback variable staying in memory after being deleted, but that's minor)
o
What do you mean ? Show me a screenshot
m
no screenshot to share; just that when my response wasn't working, i put a fallback variable placeholder name in the agent. so it was falling back to it. then, i deleted the variable from the agent. and when i called again, it still gave the same fallback value, even though it was deleted.
o
Is this agent published?
m
yes, i republished it each time i made a change