Skip to content

Commit cced900

Browse files
committed
updated live control documentation.
Signed-off-by: sahil suman <[email protected]>
1 parent 9dddf83 commit cced900

File tree

1 file changed

+59
-5
lines changed

1 file changed

+59
-5
lines changed

fern/calls/call-features.mdx

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,77 @@ curl 'https://api.vapi.ai/call'
5757

5858
```
5959

60-
## Call Control Feature
60+
## Call Control Features
6161

62-
Once you have the `controlUrl`, you can inject a message into the live call using a POST request. This can be done by sending a JSON payload to the `controlUrl`.
62+
Once you have the `controlUrl`, you can use various control features during a live call. Here are all the available control options:
6363

64-
### Example: Injecting a Message
64+
### 1. Say Message
65+
Makes the assistant say a specific message during the call.
6566

6667
```bash
6768
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control'
6869
-H 'content-type: application/json'
6970
--data-raw '{
7071
"type": "say",
71-
"message": "Welcome to Vapi, this message was injected during the call."
72+
"content": "Welcome to Vapi, this message was injected during the call.",
73+
"endCallAfterSpoken": false
7274
}'
75+
```
76+
77+
### 2. Add Message to Conversation
78+
Adds a message to the conversation history and optionally triggers a response.
79+
80+
```bash
81+
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control'
82+
-H 'content-type: application/json'
83+
--data-raw '{
84+
"type": "add-message",
85+
"message": {
86+
"role": "system",
87+
"content": "New message added to conversation"
88+
},
89+
"triggerResponseEnabled": true
90+
}'
91+
```
92+
93+
### 3. Assistant Control
94+
Control the assistant's behavior during the call.
95+
96+
```bash
97+
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control'
98+
-H 'content-type: application/json'
99+
--data-raw '{
100+
"type": "control",
101+
"control": "mute-assistant" // Options: "mute-assistant", "unmute-assistant", "say-first-message"
102+
}'
103+
```
73104

105+
### 4. End Call
106+
Programmatically end the ongoing call.
107+
108+
```bash
109+
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control'
110+
-H 'content-type: application/json'
111+
--data-raw '{
112+
"type": "end-call"
113+
}'
74114
```
75115

76-
The message will be spoken in real-time during the ongoing call.
116+
### 5. Transfer Call
117+
Transfer the call to a different destination.
118+
119+
```bash
120+
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control'
121+
-H 'content-type: application/json'
122+
--data-raw '{
123+
"type": "transfer",
124+
"destination": {
125+
"type": "number",
126+
"number": "+1234567890"
127+
},
128+
"content": "Transferring your call now"
129+
}'
130+
```
77131

78132
## Call Listen Feature
79133

0 commit comments

Comments
 (0)