Skip to main content
Personalize voice AI conversations by injecting dynamic information into your agent’s prompts. Create tailored experiences using customer data, conversation metadata, and custom variables.

Default Variables

The following variables are automatically available in every conversation:
VariableDescription
agent_idThe id of the agent
execution_idUnique id of the Bolna conversation or call
call_sidUnique id of the phone call (Twilio, Plivo, Vonage, etc.)
from_numberPhone number that initiated the call
to_numberPhone number that received the call
Inbound calls: from_number = caller, to_number = your agent
Outbound calls: from_number = your agent, to_number = recipient

Example: Using Default Variables

This is your agent Sam. Please have a friendly conversation with the customer.

Please note:
The agent has a unique id which is "{agent_id}".
The call's unique id is "{call_sid}".
The customer's phone number is "{to_number}".

Date, Time & Timezone

By default, conversations include current date and time appended to the system prompt. You can also reference these as variables directly in your prompt for more control over placement and formatting.
VariableDescriptionExample Value
current_dateCurrent date in the user’s timezoneWednesday, March 18, 2026
current_timeCurrent time in the user’s timezone02:30:15 PM
timezoneTimezone name per tz databaseAsia/Kolkata
For accurate time, pass the timezone via the API when placing calls:
curl --request POST \
  --url https://api.bolna.ai/call \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "agent_id": "123e4567-e89b-12d3-a456-426655440000",
  "recipient_phone_number": "+10123456789",
  "user_data": {
    "timezone": "America/New_York"
  }
}'

Example: Using Time Variables in Prompts

You are a scheduling assistant for {company_name}.
Today is {current_date} and the current time is {current_time} ({timezone}).

Only allow bookings during business hours (9 AM - 5 PM).

Custom Variables

Define your own variables by wrapping text in {} in your prompt. Pass values via the API when placing calls.
Any content written between {} in the prompt becomes a variable.

Example: Using Custom Variables

1

Add Variables to Prompt

This is your agent Sam speaking.

May I confirm if your name is {customer_name} and you called us on 
{last_contacted_on} to enquire about your order item {product_name}.

Use the call's id which is {call_sid} to automatically transfer the call to a human when the user asks.
2

Pass Values via API

curl --request POST \
  --url https://api.bolna.ai/call \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "agent_id": "123e4567-e89b-12d3-a456-426655440000",
  "recipient_phone_number": "+10123456789",
  "from_phone_number": "+1987654007",
  "user_data": {
    "customer_name": "Caroline",
    "last_contacted_on": "4th August",
    "product_name": "Pearl shampoo bar"
  }
}'
3

Result

The prompt becomes:
This is your agent Sam speaking.

May I confirm if your name is Caroline and you called us on
4th August to enquire about your order item Pearl shampoo bar.

Use the call's id which is PDFHNEWFHVUWEHC to automatically transfer the call to a human when the user asks.
call_sid is automatically injected as a default variable.

Custom Functions

Use context variables in function calls for dynamic actions

Hangup Messages

Add personalized hangup messages with context variables

Call Details

Extract context data from call details

Multi-Agent

Build multi-agent workflows with shared context