hackett
04/11/2025, 6:09 AMcurl -X POST https://api.vapi.ai/call \
-H "Authorization: Bearer f215f296-3be5-4021-9306-55137af2eb06" \
-H "Content-Type: application/json" \
-d '{
"customers": [
{
"number": "13123123123",
"name": "jon",
"custom_lastname": "carpenter",
"numberE164CheckEnabled": true
},
{
"number": "13123423123123",
"name": "jon1",
"custom_lastname": "carpenter1",
"numberE164CheckEnabled": true
}
],
}'
or what can i do in this case, please helpVapi Support Bot
04/11/2025, 6:10 AMcustomer
object has a limited set of predefined properties. When someone tried to add a custom property to the customer object, they received an error: "customer.property company_name should not exist"
.
The CustomerUserEditable
class defines only these available fields:
- number
- numberE164CheckEnabled
- sipUri
- name
- extension
So your custom_lastname
property would likely cause an error.
## AssistantOverrides Inside Customer Object
The assistantOverrides
and customer
are separate entities in the API call structure and cannot be nested. They exist at the same level in the request body, not with one inside the other.
## How to Use Custom Variables
The proper way to use custom variables is through the assistantOverrides.variableValues
object at the top level of your request:
json
{
"assistantId": "your-assistant-id",
"assistantOverrides": {
"variableValues": {
"lastname": "carpenter"
}
},
"customer": {
"number": "+1xxxxxxxxxx",
"name": "jon"
},
"phoneNumberId": "your-phone-id"
}
Then in your assistant's prompts, you can use {{lastname}}
to access this variable.
## Alternative Approaches
For your batched calls scenario, you might consider:Vapi Support Bot
04/11/2025, 6:10 AMassistantOverrides.metadata
as a workaround to store additional customer information, though this won't be visible in the customer field in logs.
2. If you need different variables for each call, you might need to make separate API calls for each customer rather than using a batch approach.
Is there anything specific about your use case that I can help clarify further?
Sources:
- [Discord discussion about customer object limitations](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1344652901791961211)
- [Discord discussion about assistantOverrides.metadata](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341746304744685599)
- [Vapi documentation on dynamic variables](https://docs.vapi.ai/assistants/dynamic-variables)
- [Discord thread about customer object structure](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341746304744685599)Pigeon
04/11/2025, 6:19 AMcustomer.assistantOverrides.variableValues
https://cdn.discordapp.com/attachments/1360134581113589921/1360137220505211030/image.png?ex=67fa05ff&is=67f8b47f&hm=2f755c5f7a276d01e40d78a493475cc1b2fb3187c828db308ceb316dc3352a13&Pigeon
04/11/2025, 6:20 AMPigeon
04/11/2025, 6:21 AMcustomer.name
property, like "John--carpenter"
and split by --
Pigeon
04/11/2025, 6:31 AMhackett
04/11/2025, 6:33 AMVapi
04/11/2025, 8:06 PM