Vapi makes it easy to personalize an assistant’s messages and prompts using variables, allowing each call to be customized.
{{variableName}}
.
This is useful when you want to customize the assistant for a specific call.
For example, you could set the assistant’s first message to “Hello, {{name}}
!” and then set name
to John
when starting the call
by passing assistantOverrides
with variableValues
to the API or SDK:
assistantId
: Replace "your-assistant-id"
with the actual ID of your assistant.assistantOverride
: This object is used to customize your assistant’s behavior.
variableValues
: An object containing the dynamic variables you want to use, in the format { "variableName": "variableValue" }
. For example, { "name": "John" }
.customer
: An object representing the call recipient.
number
: Replace "+1xxxxxxxxxx"
with the phone number you wish to call (in E.164 format).phoneNumberId
: Replace "your-phone-id"
with the ID of your registered phone number. You can get it from the Phone number in the dashboard./call/phone
endpoint using your preferred method (e.g., HTTP POST request).
variableValues
:
Variable | Description | Example |
---|---|---|
{{now}} | Current date and time (UTC) | Jan 1, 2024 12:00 PM |
{{date}} | Current date (UTC) | Jan 1, 2024 |
{{time}} | Current time (UTC) | 12:00 PM |
{{month}} | Current month (UTC) | January |
{{day}} | Current day of month (UTC) | 1 |
{{year}} | Current year (UTC) | 2024 |
{{variableName}}
in this format in all your prompts, whether it is the first message or anywhere else you want to use it.
date
filter to format the date and time in the timezone you want.