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}".

Timezone

By default, conversations include current date and time in the user’s timezone.
For improved accuracy, explicitly pass the timezone:
VariableDescription
timezoneTimezone name per tz database

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.