Bug in PATCH /assistant/{id} — System Prompt (messages) Reset Unexpectedly

Description:
When using the PATCH /assistant/{id} endpoint to update only the model type (e.g. changing model.model from gemini-1.5-pro to gemini-1.5-flash), the messages field (specifically the system prompt) is getting reset to its default value, even though it is not included in the request payload.

Expected Behavior:
If messages is not provided in the PATCH request, the existing system prompt should remain unchanged.

Actual Behavior:
Vapi automatically resets messages to a default value to empty

Steps to Reproduce:
  1. Create an assistant with a custom messages system prompt.
  2. Send a PATCH request to update only the model name:
    {
    "model": {
    "provider": "google",
    "model": "gemini-1.5-pro"
    }
    }
  3. Observe that messages has reverted to the default prompt.
Impact:
This breaks existing assistant logic where the prompt holds domain-specific behavior or branding, leading to unexpected assistant behavior after seemingly safe updates.

Screenshot (for reference):
Attached.

Request:
Please ensure that the messages field is not reset unless explicitly provided in the PATCH payload.
Screenshot_2025-06-12_at_9.06.20_AM.png
Was this page helpful?