Question : Is it possible to send a server Message...
# support
t
I wanna know if I can send a message to my assistant during a call to feed it data , without having to make a toolcall and expecting a response. I'm wondering how can I send a message/data to my assistant during a call ... I know that Vapi's toolcallId is a requirement .. and in this case no tool exsits ... I wanna exploit the Server message to trigger couple of automations and send back to the Assistant during a call. Any hint ? .. Is it technically possible from VPI perspective ? @User
v
@Talel Absolutely, you can send a message to your assistant during a call to feed it data without initiating a tool call and waiting for a response. This is done using the
.send()
method, which allows you to send intermediate messages to the assistant. These messages can be used to trigger automations or provide additional context to the assistant during an ongoing call. Here's how you can send a server message to your assistant:
Copy code
javascript
vapi.send({
  type: "add-message",
  message: {
    role: "system",
    content: "Your custom message or command here",
  },
});
This method does not require a
toolcallId
since it's not initiating a new tool call but rather sending data to an existing session. It's a way to push information to the assistant in real-time. If you have specific automations or actions you want to trigger, just replace the content with the appropriate command or data you wish to send. Would you like to send a specific message right now? If so, please provide me with the details, and I'll assist you with that.
You can continue this conversation by mentioning me in the message.
t
Thanks , I figured it , and it's working like a Charm .. with just small exception error , status update works for the 1st push, but then return 500 for the sencond status-update , I don't feel/see any impact on the Assistant, but i see the errors in the logs //
s
call id please.
t
4d1f1752-01a3-42d2-88ea-70623867284a
s
it's working check your logs.
k
@User @Shubham Bajaj Is it possible to send data in Google sheets like name, email_id to Vapi during live call in the similar way ??
s
you can use transscript event and then update it accoringly/
k
@Shubham Bajaj please share the documentation link for transcript event.
s
go to https://api.vapi.ai/api-json# then components > schemas > ServerMessageTranscript
4 Views