How to set the Assistant system prompt via API?
# support
v
Hi there! 👋 I understand you're looking for a way to set the Assistant system prompt via API since there's no direct "systemMessage" field in the Create Assistant API endpoint. I can definitely help with that! You can set the Assistant system prompt via API by using the
messages
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:
Copy code
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:
Copy code
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)
i
@User got it thank you
v
Message marked as helpful by @ian! 🎉
i
@Vapi Support Bot how do I submit bugs with the typescript library?
v
Hi there! 👋 I can help you with submitting bugs for the Vapi typescript library. Here's how you can do it: You can submit bugs for the Vapi typescript library through several channels: 1. **GitHub Repository**: The Vapi TypeScript SDK is open source and available on [GitHub](https://github.com/VapiAI/server-sdk-typescript). You can create an issue directly on the repository to report bugs. This appears to be the preferred method for SDK-specific issues, as mentioned in the [server-sdks documentation](https://docs.vapi.ai/server-sdks). 2. **Bug Report Link**: You can submit a bug report via the official [bug report link](https://roadmap.vapi.ai/bug-reports). This was recommended to a user who experienced a type error with the Vapi typescript library. 3. **Contact Vapi Support**: You can reach out to Vapi support at support@vapi.ai to report issues with the typescript library. When submitting a bug report, be sure to include: - Detailed description of the issue - Steps to reproduce the problem - Error messages or screenshots - Call ID and timestamp (if applicable) - Request payload and response details (for API-related issues) Is there anything specific about the bug submission process you'd like me to clarify? Sources: - [GitHub](https://github.com/VapiAI/server-sdk-typescript) - [server-sdks documentation](https://docs.vapi.ai/server-sdks) - [bug report link](https://roadmap.vapi.ai/bug-reports)
Hi there! 👋 I can help you with submitting bugs for the Vapi typescript library. Here are the different ways you can report issues: 1. **GitHub Repository**: The Vapi TypeScript SDK is open source and available on [GitHub](https://github.com/VapiAI/server-sdk-typescript). Creating an issue directly on the repository is the preferred method for SDK-specific bugs, as mentioned in the [server-sdks documentation](https://docs.vapi.ai/server-sdks). 2. **Bug Report Link**: You can submit a bug report through the official [bug report link](https://roadmap.vapi.ai/bug-reports). This method was recommended to users who experienced type errors with the Vapi typescript library. 3. **Contact Vapi Support**: You can email support@vapi.ai to report issues with the typescript library. When submitting your bug report, be sure to include: - A detailed description of the issue - Steps to reproduce the problem - Error messages or screenshots - Call ID and timestamp (if applicable) - Request payload and response details (for API-related issues) Is there anything specific about the bug submission process you'd like me to explain further? Sources: - [GitHub](https://github.com/VapiAI/server-sdk-typescript) - [server-sdks documentation](https://docs.vapi.ai/server-sdks) - [bug report link](https://roadmap.vapi.ai/bug-reports)
Hi there! 👋 I notice you're asking about submitting bugs with the Vapi typescript library, which I can definitely help with based on the information I have. You have several options for submitting bugs with the Vapi typescript library: 1. **GitHub Repository**: The Vapi TypeScript SDK is open source and available on [GitHub](https://github.com/VapiAI/server-sdk-typescript). Creating an issue directly on the repository is the preferred method for SDK-specific bugs, as mentioned in the [server-sdks documentation](https://docs.vapi.ai/server-sdks). 2. **Bug Report Link**: You can submit a bug report through the official [bug report link](https://roadmap.vapi.ai/bug-reports). This method was recommended to users who experienced type errors with the Vapi typescript library. 3. **Contact Vapi Support**: You can email support@vapi.ai to report issues with the typescript library. When submitting your bug report, be sure to include: - A detailed description of the issue - Steps to reproduce the problem - Error messages or screenshots - Call ID and timestamp (if applicable) - Request payload and response details (for API-related issues) Is there anything specific about the bug submission process you'd like me to explain further? Sources: - [GitHub](https://github.com/VapiAI/server-sdk-typescript) - [server-sdks documentation](https://docs.vapi.ai/server-sdks) - [bug report link](https://roadmap.vapi.ai/bug-reports)
Hi there! 👋 I can help you with submitting bugs for the Vapi typescript library. Here are the ways you can do this: 1. **GitHub Repository**: The Vapi TypeScript SDK is open source and available on [GitHub](https://github.com/VapiAI/server-sdk-typescript). Creating an issue directly on the repository is the preferred method for SDK-specific bugs, as mentioned in the [server-sdks documentation](https://docs.vapi.ai/server-sdks). 2. **Bug Report Link**: You can submit a bug report through the official [bug report link](https://roadmap.vapi.ai/bug-reports). This method was recommended to users who experienced type errors with the Vapi typescript library. 3. **Contact Vapi Support**: You can email support@vapi.ai to report issues with the typescript library. When submitting your bug report, be sure to include: - A detailed description of the issue - Steps to reproduce the problem - Error messages or screenshots - Call ID and timestamp (if applicable) - Request payload and response details (for API-related issues) Is there anything specific about the bug submission process you'd like me to explain further? Sources: - [GitHub](https://github.com/VapiAI/server-sdk-typescript) - [server-sdks documentation](https://docs.vapi.ai/server-sdks) - [bug report link](https://roadmap.vapi.ai/bug-reports)
Hi there! 👋 I notice this question about submitting bugs with the Vapi typescript library has already been answered in our conversation. As previously mentioned, you have three main options for submitting bugs: 1. **GitHub Repository**: Create an issue directly on the [Vapi TypeScript SDK GitHub repository](https://github.com/VapiAI/server-sdk-typescript), which is the preferred method for SDK-specific issues. 2. **Bug Report Link**: Submit through the official [bug report link](https://roadmap.vapi.ai/bug-reports). 3. **Email Support**: Contact support@vapi.ai with details about the issue. Remember to include a detailed description, reproduction steps, error messages, and any relevant IDs or payloads when reporting the bug. Is there something specific about the bug submission process that wasn't clear from the previous responses? Sources: - [GitHub](https://github.com/VapiAI/server-sdk-typescript) - [bug report link](https://roadmap.vapi.ai/bug-reports)
I'm sorry, I'm having trouble with your request. A member of the team will be notified and will get back to you as soon as possible.
k
Hey Ian, to set the system prompt or assistant prompt, you have to look for the property name "model" and inside that, you will find another property named "messages". Messages is an array of objects, and the first index item of this property has to be your system prompt. It should be for the key type "content" and role has to be "system". This way you can pass the system prompt for your assistant through API.
Copy code
POST 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"
}
2 Views