Mahimai Raja
04/08/2025, 3:21 AMsh
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?Vapi Support Bot
04/08/2025, 3:22 AMadd-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:
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)Vapi Support Bot
04/08/2025, 4:34 AMShubham Bajaj
04/08/2025, 7:30 PMMahimai Raja
04/13/2025, 4:52 AM