Documentation on controlling a live call
# support
s
So, i see in the vapi docs it shows the call.monitor.controlUrl can be posted to, to control the call. But I cannot find any documentation on how that is supposed to be done. The link will take you to the inbound client messages documentation, which is for responding to client messages. As seen in the second photo attatched. But I don't see how I need to structure my request to add messages, end calls, or transfer them live. Do i need to inlude the ID of the call in the URL? Do I place it in the body, do i need authentication? What does that request look like to the *call.monitor.controlUrl * ? thank you https://cdn.discordapp.com/attachments/1369025703294533856/1369025703869415525/image.png?ex=681a5c0b&is=68190a8b&hm=76038b2992994d617ad01c5ca86589658f8d834b464eb147285e7a424080dd72& https://cdn.discordapp.com/attachments/1369025703294533856/1369025704225673316/image.png?ex=681a5c0b&is=68190a8b&hm=6b39c0eeaa142baf1dffb79a4428c93998a29d24915242c006b60fd89e50cadd&
v
Based on the information I found, here's how to use the
call.monitor.controlUrl
in Vapi: 1. The call ID is already included in the
controlUrl
itself (e.g.,
https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control
), so you don't need to add it separately. 2. For adding messages, use this structure:
Copy code
javascript
await fetch(call.monitor.controlUrl, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    type: 'add-message',
    message: {
      role: 'tool',
      content: 'Your tool result here'
    }
  })
});
3. For saying text during a call:
Copy code
{
  "type": "say",
  "message": "Welcome to Vapi, this message was injected during the call."
}
Would you like me to provide examples for the other message types like
end-call
or
transfer
? Sources: - [Discord Channel](https://discord.com/channels/1211482211119796234/1340737584309211136) - [Vapi Documentation](https://docs.vapi.ai/calls/call-features) - [Discord Channel](https://discord.com/channels/1211482211119796234/1334251359519641692)
v
Message marked as helpful by @SlaviSavanovic! 🎉
s
@Shubham Bajaj @User Can you confirm the above for me please?
k
Send a POST request with your API key to the call.monitor.controlUrl (which includes the call ID), using JSON to specify actions like "type": "say", "end-call", "transfer", or "add-message".
s
@Kings_big💫 Beast bode - appreciate your help!
3 Views