ian
04/10/2025, 2:19 AMVapi Support Bot
04/10/2025, 2:21 AMmessages
array within the model
object. Here's how:
When creating an assistant, include a messages
array in your model
object with a message that has role: "system"
and your prompt in the content
field:
json
{
"model": {
"provider": "openai",
"model": "gpt-4",
"messages": [
{
"role": "system",
"content": "You're a pizza ordering assistant. The user will ask for toppings, you'll add them. When they're done, you'll redirect them to checkout."
}
]
}
}
According to [Vapi's documentation](https://docs.vapi.ai/examples/pizza-website), this is the recommended approach since the systemPrompt
property has been deprecated.
If you've already created an assistant and want to update its system prompt, you can use a PATCH request to the /assistant/<ASSISTANT_ID>
endpoint:
curl --location --request PATCH 'https://api.vapi.ai/assistant/<ASSISTANT_ID>' \
--header 'Content-Type: text/plain' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data '{
"model": {
"provider": "openai",
"model": "gpt-4o",
"messages": [
{
"content": "You are a smart assistant who responds to user queries using the information you know, or information supplied by outside context.",
"role": "system"
}
]
}
}'
When updating the model property, make sure to include all the properties you want to keep, as mentioned in the [Vapi documentation](https://docs.vapi.ai/knowledgebase).
Is there anything else you'd like to know about configuring your assistant via API?
Sources:
- [Vapi's documentation](https://docs.vapi.ai/examples/pizza-website)
- [Vapi documentation](https://docs.vapi.ai/knowledgebase)ian
04/10/2025, 2:21 AMVapi Support Bot
04/10/2025, 2:21 AMian
04/10/2025, 2:24 AMVapi Support Bot
04/10/2025, 2:26 AMVapi Support Bot
04/10/2025, 2:27 AMVapi Support Bot
04/10/2025, 2:28 AMVapi Support Bot
04/10/2025, 2:28 AMVapi Support Bot
04/10/2025, 2:29 AMVapi Support Bot
04/10/2025, 2:30 AMKyle Brunker
04/11/2025, 3:22 PMPOST https://api.vapi.ai/assistant
{
"name": "Your Assistant Name",
"model": {
"provider": "openai",
"model": "gpt-4o",
"temperature": 0.7,
"messages": [
{
"role": "system",
"content": "Your system prompt goes here. This will define how the assistant behaves."
}
]
},
"voice": {
"provider": "playht",
"voiceId": "jennifer"
},
"firstMessage": "Hello! How can I help you today?",
"firstMessageMode": "assistant-speaks-first"
}