https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> Failed to create a request ...
# ❓・ai-evy-support
q
@AI Evy Failed to create a request in Webhooks by Zapier request/body/metadata must be object (HTTP Status Code: 400)
a
Thanks for tagging me @Qcumbers | CC. I'll look through relevant sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Register the webhook]() * [LLM WebSocket]() * [Integrate any system with custom function]() * [Secure the webhook]() -----------------------------
### Answer Looking at the example webhook request body in the documentation, the metadata field should be an object [(1)]() . Here's an example of the correct format from the documentation:
Copy code
json
{
  "event": "call_ended",
  "call": {
    "call_type": "phone_call",
    "from_number": "+12137771234",
    "to_number": "+12137771235",
    "direction": "inbound",
    "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
    "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
    "call_status": "registered",
    "metadata": {},
    "retell_llm_dynamic_variables": {
      "customer_name": "John Doe"
    },
    "start_timestamp": 1714608475945,
    "end_timestamp": 1714608491736,
    "disconnection_reason": "user_hangup",
    "transcript": "...",
    "opt_out_sensitive_data_storage": false
  }
}'
Make sure in your Zapier webhook configuration that the metadata field is formatted as a proper JSON object, even if empty ({}), rather than a string or other data type.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
q
so I just need to add {} @AI Evy
a
Thanks for the follow-up, @Qcumbers | CC. I'll get back to you soon.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Register the webhook]() * [Secure the webhook]() * [Overview]() * [LLM WebSocket]() -----------------------------
### Answer Yes, according to the example webhook payload in the documentation, the metadata field should be an empty object
{}
if you don't have any metadata to include [(1)]() . This is shown in the example webhook payload where
"metadata": {}
is used.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
q
@AI Evy so all right the phone calls are now triggering but the first name variable for certain reason the agent is still not swapping the variable with the value that was mapped on zapier: retell_llm_dynamic_variables[First_Name]
a
Thanks for the follow-up, @Qcumbers | CC. I'll get back to you soon.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Dynamic Variables]() * [LLM Playground]() * [Debug call disconnection]() * [Retell AI | AI Phone Agents for Pre-Qualifying Real Estate Sales]() -----------------------------
### Answer The dynamic variables in your prompt should use double curly braces and match the exact variable name used in the retell_llm_dynamic_variables object. For example:
Copy code
json
"Hello {{first_name}}, I understand you're interested in {{product_name}}. How can I help you today?"
[(1)]() Make sure: 1. Your variable name in the prompt matches exactly (case-sensitive) with what you're passing in retell_llm_dynamic_variables 2. You're using double curly braces {{variable_name}} in your prompt If a dynamic variable is not assigned a value, it will remain unchanged in the output - meaning you'll see the raw
{{variable_name}}
in the response. For your specific case, try changing
First_Name
to
first_name
(lowercase) to maintain consistency, or ensure your prompt variable exactly matches the case you're using in Zapier.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
q
it's {{First_Name}} in the prompt. But the way added it to zapier is: so all right the phone calls are now triggering but the first name variable for certain reason the agent is still not swapping the variable with the value that was mapped on zapier: retell_llm_dynamic_variables[First_Name] @AI Evy
a
Thanks for the follow-up, @Qcumbers | CC. I'll get back to you soon.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Dynamic Variables]() * [LLM Playground]() * [Call Transfer Node]() * [LLM WebSocket]() -----------------------------
### Answer Based on the documentation, when setting dynamic variables, you need to pass them in the retell_llm_dynamic_variables field as a JSON object [(1)]() . Here's the correct format:
Copy code
json
{
  "First_Name": "John Smith"
}
The variable name in your prompt
{{First_Name}}
should exactly match the key in the retell_llm_dynamic_variables object. If the variable is not properly set, it will remain unchanged in the output and you'll continue to see the raw
{{First_Name}}
in the response. When using dynamic variables with Zapier, make sure the JSON structure matches exactly what's expected by Retell AI's API.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.