Can I add user message from live call control?
# support
m
I see that we can add system message from live call control - https://docs.vapi.ai/calls/call-features 2. Add Message to Conversation Adds a message to the conversation history and optionally triggers a response.
Copy code
sh
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control' 
-H 'content-type: application/json' 
--data-raw '{
  "type": "add-message",
  "message": {
    "role": "system",
    "content": "New message added to conversation"
  },
  "triggerResponseEnabled": true
}'
Is it possible add same for user message?
v
Hi there! 👋 Yes, you absolutely can add a user message from live call control, similar to how you're adding system messages! According to the [documentation](https://docs.vapi.ai/assistants/background-messages), the
add-message
functionality supports various roles including "user", "assistant", "tool", and "function" - not just "system" messages. Here's how you can modify your curl command to add a user message:
Copy code
sh
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control' 
-H 'content-type: application/json' 
--data-raw '{
  "type": "add-message",
  "message": {
    "role": "user",
    "content": "This is a user message added to the conversation"
  },
  "triggerResponseEnabled": true
}'
The key difference is simply changing the
"role": "system"
to
"role": "user"
in your JSON payload. The
triggerResponseEnabled
parameter is a boolean that determines whether the message should trigger a response from the system, which you can set based on your needs. Is there anything else you'd like to know about adding messages through live call control? Sources: - [Documentation on background messages](https://docs.vapi.ai/assistants/background-messages) - [Call features documentation](https://docs.vapi.ai/calls/call-features)
v
Message marked as helpful by @Mahimai Raja! 🎉
s
checking if this is resolved/solved for you?
m
Yes, it got resolved
2 Views