https://retellai.com/?utm_source=discord&utm_medium=seo logo
Is the call id available as a variable
# ❓・ai-evy-support
m
@AI Evy Is the call id available as a variable ?
a
Thanks for tagging me @micheldenizob. I'll look through relevant sources and get back to you shortly.
### Answer Yes, the call ID is available in all call responses. When you create or retrieve a call, the
call_id
is included in the response object [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() . For example, when creating a web call, the response includes:
Copy code
javascript
{
 "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
 "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 // ... other fields
}
[(5) ]() The
call_id
is described as the "Unique id of the call. Used to identify in LLM websocket and used to authenticate in audio websocket" [(1) ]() [(2) ]() [(5) ]() . You can access this
call_id
from any of the call API responses to use it for tracking, authentication, or further API calls.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy can I reference it as a variable in my prompt ?
a
Thanks for the follow-up, @micheldenizob. I'll get back to you soon.
### Answer Based on the documentation, I don't see the call ID specifically mentioned as a variable that can be referenced in prompts [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() . The documentation shows that
call_id
is returned in API responses as a unique identifier used for LLM websocket identification and audio websocket authentication [(1) ]() [(2) ]() [(3) ]() [(4) ]() . The documentation does show examples of dynamic variables that can be used in prompts, such as
retell_llm_dynamic_variables
which allows you to inject key-value pairs into your Response Engine prompt and tool descriptions [(1) ]() [(2) ]() [(4) ]() [(5) ]() :
Copy code
javascript
"retell_llm_dynamic_variables": {
  "customer_name": "John Doe"
}
However, the call ID itself is not explicitly documented as being available as a dynamic variable within prompts. The call ID appears to be primarily used for API operations and websocket connections rather than as a prompt variable. I don't have specific information about referencing the call ID as a variable in prompts based on the available sources. You might want to check the Retell AI documentation or contact support for clarification on this specific use case.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy What are the available system variables ?
a
Thanks for the follow-up, @micheldenizob. I'll get back to you soon.
### Answer Based on the available documentation, Retell AI provides several default system variables that are automatically available: ## General System Variables - `{{current_time}}`: Current time in America/Los_Angeles timezone (Monday, March 24, 2025 at 02:53:01 PM PDT) [(1) ]() [(2) ]() [(3) ]() [(4) ]() - `{{current_time_[timezone]}}`: Current time in specified timezone, for example:
{{current_time_Australia/Sydney}}
,
{{current_time_America/New_York}}
- `{{current_calendar}}`: 14-day calendar in
America/Los_Angeles
[(1) ]() - `{{current_calendar_[timezone]}}`: 14-day calendar in specified timezone, for example:
{{current_calendar_Australia/Sydney}}
- `{{call_type}}`: Call type,
web_call
or
phone_call
[(1) ]() [(2) ]() [(3) ]() [(4) ]() ## Phone Call Only Variables These variables are only available for phone calls: - `{{direction}}`: Call direction,
inbound
or
outbound
- `{{user_number}}`: User's phone number (from_number for inbound, to_number for outbound) - `{{agent_number}}`: Agent's phone number (to_number for inbound, from_number for outbound) These system variables are automatically populated by Retell AI and can be used in prompts, begin messages, tool call URLs, tool call descriptions, and other places where dynamic variables are supported [(1) ]() .
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] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Simulation Testing Now Live for All Agents](https://www.retellai.com/changelog/simulation-testing-now-live-for-all-agents-c27zh) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[4] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
m
@AI Evy Can I send a dynamic variable to an ongoing call ?
a
Thanks for the follow-up, @micheldenizob. I'll get back to you soon.
### Answer Based on the available documentation, dynamic variables are typically set at the beginning of a call when creating it [(1) ]() . The documentation shows how to set dynamic variables for outbound calls using the Create Phone Call API in the
retell_llm_dynamic_variables
field :
Copy code
{
  "user_name": "John Smith",
  "product_name": "Premium Plan",
  "account_status": "active"
}
However, the documentation doesn't explicitly mention the ability to send or update dynamic variables to an ongoing call . The dynamic variables appear to be designed for initialization at call creation rather than real-time updates during the call . The Discord discussion does mention some implementation details about setting dynamic variables, but it focuses on initial call setup rather than updates to ongoing calls [(2) ]() . I don't have specific information about updating dynamic variables for ongoing calls based on the available sources. For this specific use case, you might want to contact Retell AI support for clarification on whether dynamic variables can be modified during an active call.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Dynamic Variables](https://discord.com/channels/1186424376300679209/1356680357084135558) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.