Server event documentation is not updated and is s...
# support
j
Here in https://docs.vapi.ai/server-url/events, it says our server should respond with the
assistant
object directly:
Copy code
json
{
  "assistant": {
    "firstMessage": "Hey Ryan, how are you?",
    "model": {
      "provider": "openai",
      "model": "gpt-3.5-turbo",
      "messages": [
        {
          "role": "system",
          "content": "You're Ryan's assistant..."
        }
      ]
    }
  }
}
However, the server requires the
assistant
json to be embedded in
messageResponse
key. This causes confusion to Vapi users. Please update the docs to reflect changes in the API. Thanks. https://cdn.discordapp.com/attachments/1367421004812517377/1367421005504708668/Screenshot_2025-05-01_at_4.34.59_PM.png?ex=6814858d&is=6813340d&hm=71f0e0d1ea6ccf836bba81025b04a3d02c26984d923a3d3ab6f1e544be7e7e02&
v
You're correct about the documentation discrepancy. Based on the information I've found, the server should respond with the
assistant
object embedded within a
messageResponse
key for events like
assistant-request
, not directly as shown in the docs. Here's the correct format:
Copy code
json
{
  "messageResponse": {
    "assistant": {
      "firstMessage": "Hey Ryan, how are you?",
      "model": {
        "provider": "openai",
        "model": "gpt-3.5-turbo",
        "messages": [
          {
            "role": "system",
            "content": "You're Ryan's assistant..."
          }
        ]
      }
    }
  }
}
c
The correct format should be:
Copy code
{
  "messageResponse": {
    "assistant": {
      "firstMessage": "Hey Ryan, how are you?",
      "model": {
        "provider": "openai",
        "model": "gpt-3.5-turbo",
        "messages": [
          {
            "role": "system",
            "content": "You're Ryan's assistant..."
          }
        ]
      }
    }
  }
}
I'll update our documentation to reflect this change immediately. For users currently experiencing this issue, they should wrap their assistant object responses in a "messageResponse" key.
3 Views