Amanski
03/12/2025, 1:27 PMVapi Support Bot
03/12/2025, 1:29 PM/calls/update
endpoint only allows updating limited call properties like name. However, for setting dynamic variables in an inbound agent, you'll need to use a different approach.
According to the documentation, you should use the assistantOverrides
configuration with variableValues
when initiating a call. Here's how you can do it:
1. Structure your API request with a JSON payload like this:
json
{
"assistantId": "your-assistant-id",
"assistantOverrides": {
"variableValues": {
"name": "John",
"otherVariable": "value"
}
},
"customer": {
"number": "+1xxxxxxxxxx"
},
"phoneNumberId": "your-phone-id"
}
2. Send this payload to the /call/phone
endpoint using a POST request.
This will replace any occurrences of {{name}}
or {{otherVariable}}
in your assistant script with the values you've provided.
For inbound agents specifically, you'll need to ensure these variables are configured when the call is being handled. The variables you set will be used to customize the conversation based on the placeholders in your assistant's script.
If you're having trouble with the implementation, make sure that:
- The variable names in your variableValues
match exactly with the placeholders in your script
- Your assistant is configured to accept these variables
- The API request is correctly formatted
Does this help with what you're trying to accomplish?
Sources:
- [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables)
- [Discord Discussion](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335054553250533439)Amanski
03/12/2025, 1:31 PM