Skip to main content

Overview

When creating custom metrics, you can use variables from call data using the {{variable_name}} syntax. These variables come from different sources depending on the context.

Available Variables

System Variables

These variables are available in both Simulation and Observability calls:

{{transcript}}

Availability: ✅ Simulation & Observability Full conversation transcript as plain text. Example value:
[00:02] Testing Agent: Hello.
[00:02] Main Agent: Customer support. Can I help you today?
[00:07] Testing Agent: Who's this?
[00:09] Main Agent: Hi. I'm Alex, your virtual assistant from Tech Solutions...

{{call_end_reason}}

Availability: ✅ Simulation & Observability Reason why the call ended. Example values:
  • "customer-ended-call"
  • "agent-ended-call"

{{date}}

Availability: ✅ Simulation & Observability Current date in YYYY-MM-DD format. Example values:
  • "2024-12-13"
  • "2025-01-15"

Namespace Variables

{{metadata.*}}

Availability: ✅ Simulation | ❌ Observability Access metadata fields using the metadata. prefix. Available fields:
FieldDescriptionExample Value
{{metadata.ringing_duration}}Time before call answered (seconds)1.2, 3.5
{{metadata.call_end_reason}}Same as {{call_end_reason}}"customer-ended-call", "agent-ended-call"

{{test_profile.*}}

Availability: ✅ Simulation | ❌ Observability Structured test scenario data configured for simulation runs. Supports nested objects and array access for complex test scenarios. Common fields:
FieldDescriptionExample Value
{{test_profile.patient_name}}Patient name"John Smith"
{{test_profile.patient_id}}Patient ID"PT-001"
{{test_profile.account_id}}Account identifier"ACC-456"
{{test_profile.customer_name}}Customer name"Alice Johnson"

{{provider_call_data.*}}

Availability: ✅ Simulation | ❌ Observability This is based on the provider you have integrated on the platform. This variable gives you complete access to call details from your provider platform. Example providers: VAPI, Retell, Elevenlabs, etc.

{{dynamic_variables.*}}

Availability: ❌ Simulation | ✅ Observability (via API) Custom variables you pass via API to personalize the agent’s behavior during the call. These are user-defined fields you send when creating a call. Common examples:
FieldDescriptionExample Value
{{dynamic_variables.user_name}}Customer name"John Doe"
{{dynamic_variables.customer_name}}Customer full name"Jane Smith"
{{dynamic_variables.order_number}}Order or ticket ID"ORD-12345"
{{dynamic_variables.appointment_date}}Scheduled date/time"2024-01-15", "Jan 15, 2pm"
{{dynamic_variables.total_amount}}Transaction amount"99.99", 150.00
{{dynamic_variables.account_id}}Account identifier"ACC-789"
{{dynamic_variables.product_name}}Product name"Premium Plan"
Custom fieldsAny custom field you defineAny value

Quick Reference

VariableSimulationObservability
{{transcript}}
{{call_end_reason}}
{{date}}
{{metadata.*}}
{{dynamic_variables.*}}
{{test_profile.*}}
{{provider_call_data.*}}

Using Variables in Metrics

When creating metrics, you can reference these variables directly in your metric configuration. Here’s how it looks in the interface:

Key Points

  • Variables are case-sensitive: {{user_name}}{{User_Name}}
  • Not all variables exist in every call - handle missing values
  • Variables must be accessed with their namespace prefix:
    • Use {{metadata.ringing_duration}} to access metadata fields
    • Use {{dynamic_variables.user_name}} to access dynamic variables
    • Dot notation: {{metadata.customer_id}}
    • Bracket notation: {{metadata["customer_id"]}} (both work the same)