https://retellai.com/?utm_source=discord&utm_medium=seo logo
i need to send the call id as a field to zapier
# ❓・ai-evy-support
m
@AI Evy i need to send the call id as a field to zapier
a
Thanks for tagging me @Mo. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[2] Zapier x Retell Tutorial | How to Automate Follow-Up Calls from Customer Inquiries](

https://www.youtube.com/watch?v=I3TyMad74F4▾

) [[3] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
### Answer To send the call ID to Zapier, you have a couple of options: Option 1: Use the "Get a Call" action in Zapier After triggering a phone call with the "Make a Phone Call" action, the response includes a
call_id
field. [(1) ]() You can then use the "Get a Call" action in Zapier to retrieve all call details using that call ID. [(2) ](

▾

) Option 2: Use Retell webhooks Configure a webhook URL in your agent settings. Retell will POST call data (including
call_id
) to your webhook endpoint when events occur (like
call.ended
) . You can set up a Zapier webhook trigger to receive this data. [(3) ]() Workflow example from the tutorial: 1. Use "Make a Phone Call" action → returns
call_id
[(1) ]() 2. Add "Get a Call" action → pass the
call_id
from step 1 [(2) ](

▾

) 3. This retrieves all call details including transcripts, summaries, etc. The
call_id
is returned in the response when you create a phone call:
Copy code
json
{
  "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6"
}
[(1) ]() You can then map this
call_id
field to subsequent Zapier steps or send it to your database/webhook. [(2) ](

▾

) , [(6) ]()
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Thanks for the follow-up, @Mo. I'll get back to you soon.
### Answer Based on your message, it looks like you want to include the
call_id
as an additional field when sending data to Zapier. However, I can't see what specific interface or configuration you're referring to (the image/context isn't visible to me) . Here's what I can confirm about the `call_id`: The
call_id
is returned in the response
when you create or register a phone call: [(1) ]() , [(2) ]()
Copy code
json
{
  "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6"
}
[(1) ]() If you're using the metadata field, you can store custom data including a reference to the call. The
metadata
field accepts an arbitrary object for storage purposes: [(3) ]()
Copy code
javascript
const callResponse = await client.call.update('call_a4441234567890777c4a4a123e6', {
  metadata: { customer_id: 'cust_123', notes: 'Follow-up required' },
}) ;
Could you clarify: 1. Are you trying to send the
call_id
via a webhook to Zapier? 2. Or are you trying to include it in the
metadata
or
retell_llm_dynamic_variables
fields when creating a call? This will help me point you to the right approach.
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] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[2] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[3] Update Call](https://docs.retellai.com/api-references/update-call) ​
Thanks for the follow-up, @Mo. I'll get back to you soon.
m
@AI Evy i am trying to send the call_id via webhook, and im trying to include it in retell_llm_dynamic_variables fields
a
### Answer You don't need to manually include
call_id
in `retell_llm_dynamic_variables`—Retell provides it automatically as a system default variable. Use the built-in
{{call_id}}
variable
The
call_id
is available as a system default dynamic variable that you can reference directly in your prompts, tool configurations, or webhook URLs: [(1) ]() | Variable | Description | Example | |----------|-------------|---------| |
{{call_id}}
| Current call session id |
call_12345678906eaa0222bd3dd2a6c
| Webhook payload already includes
call_id
When Retell sends webhook events (
call_started
,
call_ended
,
call_analyzed
) , the payload automatically includes the `call_id`: [(2) ]()
Copy code
json
{
  "event": "call_ended",
  "call": {
    "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
    "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
    "call_status": "registered",
    ...
  }
}
So if you're receiving webhooks in Zapier, the
call_id
should already be present in the payload. You can map it directly from the
call
object in your Zap. If you need to use
call_id
within your agent's custom function/tool URL, you can include
{{call_id}}
in the URL or tool description, and it will be resolved at runtime. [(1) ]()
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Webhook Overview](https://docs.retellai.com/features/webhook-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy but call id, and appointment fields are in seperate webhooks, therefore zapier interprets them ass different events. i need the call id sent in the same event as name, appointment dat/time, etc
a
Thanks for the follow-up, @Mo. I'll get back to you soon.
### Answer ### Answer I understand the issue—your custom function (for booking appointments) sends data to one Zapier webhook, while Retell's call event webhooks (
call_ended
,
call_analyzed
) send to another, so Zapier sees them as separate events. Solution: Include
call_id
in your custom function payload
Since
{{call_id}}
is a system default dynamic variable, you can include it directly in your custom function/tool that sends the appointment data to Zapier. When you configure your booking tool, add
call_id
as a parameter alongside name, appointment date/time, etc. [(1) ]() Your custom function payload to Zapier would look something like:
Copy code
json
{
  "call_id": "{{call_id}}",
  "name": "{{customer_name}}",
  "appointment_date": "2025-01-15",
  "appointment_time": "10:00 AM"
}
This way, when the agent triggers the booking function, all fields—including `call_id`—arrive in a single webhook event to Zapier. Alternative: Use
metadata
field
You can also store appointment details in the
metadata
field during the call. The
metadata
object is included in the
call_ended
and
call_analyzed
webhook payloads:
Copy code
json
{
  "event": "call_ended",
  "call": {
    "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
    "metadata": {},
    "retell_llm_dynamic_variables": {
      "customer_name": "John Doe"
    },
    ...
  }
}
If you update the call's
metadata
with appointment info during the conversation, it will all arrive together in the
call_ended
or
call_analyzed
webhook.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
should i edit the json?? in my custom function @AI Evy
a
Thanks for the follow-up, @Mo. I'll get back to you soon.
### Answer Yes, you can add
call_id
to your custom function's JSON parameter schema. [(1) ]() You have two options: Option 1: Add it as a
const
value using the dynamic variable
In your JSON schema, add a
call_id
property with a
const
value that references the system variable:
Copy code
json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "object",
      "description": "",
      "properties": {
        "first_name": {
          "type": "string",
          "description": "User first name"
        },
        "last_name": {
          "type": "string",
          "const": "{{last_name}}"
        }
      }
    },
    "order_id": {
      "type": "number",
      "const": 1234
    }
  }
}
Following this pattern, you'd add something like:
Copy code
json
"call_id": {
  "type": "string",
  "const": "{{call_id}}"
}
Using
const
means the value will be applied directly to the function without LLM resolution. Option 2: Add it as a query parameter Alternatively, you can add
call_id
as a query parameter in your custom function configuration (under "Set query parameters") with a const value of
{{call_id}}
. Either approach will include the
call_id
in the same request that sends your appointment data to Zapier.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
i dont have a json schema, i have it set as forms. how should i build the form for my custom action. and what should i add to my prompt to get it to fire correctly @AI Evy
a
Thanks for the follow-up, @Mo. I'll get back to you soon.
### Answer Building the form for your custom function: When using JSON form mode (instead of JSON schema) , you can add fields visually. To include
call_id
, add a new field with: - Field name:
call_id
- Type:
string
- Use the const value toggle and set it to
{{call_id}}
Using
const
means the value will be applied directly to the function without LLM resolution. [(1) ]() For your other fields (name, appointment date/time, etc.) , add them similarly—use
description
for values the LLM should resolve from the conversation, or
const
for values you want applied directly (including dynamic variables) . What to add to your prompt: Include explicit instructions for when to invoke the custom function. For example:
Copy code
When user provided the city name, please get the weather for that city by calling the `get_weather` function.
Adapted for your booking scenario, you might add something like: > "When the user has provided their name, preferred appointment date, and time, call the
book_appointment
function with all collected information." This follows the best practice of explicitly stating when the function should be invoked. , [(3) ]()
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
by const value you mean in the detail column of the field right @AI Evy
a
Thanks for the follow-up, @Mo. I'll get back to you soon.
### Answer --- Yes, in the form view there's a switch to toggle between "description" and "const value." [(1) ]() - **Description**: The value will be resolved by the LLM based on the conversation. - **Const value**: The value will be applied directly to the function without LLM resolution. For
call_id
, you'd toggle to const value and enter
{{call_id}}
. This ensures the system variable is passed directly rather than having the LLM try to determine it.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
what does "const" mean @AI Evy also it just says value in that column - same thing?
a
Thanks for the follow-up, @Mo. I'll get back to you soon.
### Answer What "const" means: "Const" is short for "constant." In the context of custom function parameters, it means the value is fixed and will be applied directly to the function—the LLM won't try to resolve or determine it from the conversation. [(1) ]() [(2) ]() The toggle in the form: There's a switch to change between parameter description or **const value**: - **Description**: Will be resolved by LLM (the agent figures out the value from the conversation) - **Const value**: Will be applied directly to the function (a fixed value you specify) So yes, if your form shows "value" in that column when toggled, that's the const value field. You'd enter
{{call_id}}
there, and it will be passed directly without the LLM trying to interpret it. [(1) ]() Example from the documentation showing const usage:
Copy code
json
"last_name": {
  "type": "string",
  "const": "{{last_name}}"
}
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
give me explicit instructions for when to invoke the custom function. it should happen anytime a webhook is sent (when somebody requests check availability) @AI Evy
a
Thanks for the follow-up, @Mo. I'll get back to you soon.
### Answer --- To explicitly instruct your agent when to invoke the custom function, add clear instructions in your prompt. [(1) ]() Example prompt instruction:
Copy code
When user provided the city name, please get the weather for that city by calling the `get_weather` function.
For your check availability scenario, adapt it like this: > "When the user asks to check availability or requests available appointment times, call the
check_availability
function." Or more detailed: > "Whenever the user mentions wanting to check availability, see open times, or asks when appointments are available, immediately invoke the
check_availability
function with the required parameters." The key is to include in the prompt explicitly when is the best time to invoke the custom function.
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
that'll include the call id? but it doesnt tell me in the prompt
that'll include the call id? but it doesnt tell me in the prompt. or will call id be automatic?
that'll include the call id? but it doesnt tell me in the prompt. or will call id be automatic? @AI Evy
a
Thanks for the follow-up, @Mo. I'll get back to you soon.
### Answer --- Yes, the
call_id
will be included automatically if you configured it as a
const
value with
{{call_id}}
in your custom function parameters—you don't need to mention it in the prompt. [(1) ]() The prompt instructions are for telling the LLM when to call the function (e.g., "when user asks to check availability") . The parameters you defined in the form (including
call_id
as a const value) determine what data gets sent when the function fires. So: - **Prompt**: Controls when the function is invoked - **Parameters (const values) **: Controls what data is sent—these are applied directly without LLM involvement Since you set
call_id
with const value
{{call_id}}
, it will be automatically resolved and included in every request to your webhook endpoint, regardless of what the prompt says.
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] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​