Simon Digilov
03/30/2025, 8:59 PMVapi Support Bot
03/30/2025, 9:01 PMsystemPrompt
and firstMessage
as variables within the variableValues
object. However, this isn't the correct way to structure the request for overriding prompts.
### How to Fix It
1. **Use the correct structure for `assistantOverrides`**:
Instead of putting systemPrompt
and firstMessage
inside variableValues
, try structuring your request like this:
json
{
"assistantId": "your-assistant-id",
"assistantOverrides": {
"firstMessage": "Your dynamic first message here",
"messages": [
{
"role": "system",
"content": "Your dynamic system prompt here"
}
],
"variableValues": {
"otherVariable1": "value1",
"otherVariable2": "value2"
}
},
"customer": {
"name": "Customer Name",
"number": "Customer Number"
},
"phoneNumberId": "your-phone-id"
}
2. **Note about `systemPrompt`**:
According to [documentation I found](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1337126843790397591), the systemPrompt
property is deprecated. Instead, use the messages
array with the role set to "system" to pass your system prompt.
3. **PATCH request behavior**:
When updating an assistant using PATCH requests, nested properties are overwritten by default. To ensure all properties are preserved, you must pass both the updated and previous properties as follows: model: {...modelPrevProperties, ...updated}
.
4. **Check variable templating**:Vapi Support Bot
03/30/2025, 9:01 PM{{businessName}}
), make sure they're correctly defined in your prompts and that the corresponding values are passed in the variableValues
object.
### Known Issue
This appears to be a known issue with Vapi. Another user reported that "when creating or updating the prompt using the API, it defaults back to 'I am a helpful assistant' and ignores the firstmessage and the rest of the prompt." The Vapi team might be investigating this issue.
As a workaround, some users have had success using webhooks instead of the Vapi module directly.
Would you like me to provide more specific guidance on any of these potential solutions?
Sources:
- [Discord Thread about Overriding UI Prompt](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1337126843790397591)
- [Discord Thread about Known Issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1344078332848767016)
- [Discord Thread about PATCH Requests](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336023224898814012)Aniah
03/31/2025, 9:30 AM