@vapi-ai/web 1.0.212 → 1.0.214
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.ts +355 -135
- package/dist/api.d.ts +318 -95
- package/dist/api.js +30 -15
- package/dist/vapi.js +5 -2
- package/package.json +1 -1
- package/vapi.ts +5 -2
package/api.ts
CHANGED
|
@@ -9,34 +9,6 @@
|
|
|
9
9
|
* ---------------------------------------------------------------
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
export interface PhoneCallParams {
|
|
13
|
-
callSid?: string;
|
|
14
|
-
status?: string[];
|
|
15
|
-
customerPhoneNumber: string;
|
|
16
|
-
twilioPhoneNumber: string;
|
|
17
|
-
twilioAccountSid: string;
|
|
18
|
-
twilioAuthToken: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface Call {
|
|
22
|
-
type: "inboundPhoneCall" | "outboundPhoneCall" | "webCall";
|
|
23
|
-
id: string;
|
|
24
|
-
orgId: string;
|
|
25
|
-
createdAt: string;
|
|
26
|
-
updatedAt: string;
|
|
27
|
-
assistantId?: string;
|
|
28
|
-
customerId?: string;
|
|
29
|
-
phoneNumberId?: string;
|
|
30
|
-
startedAt: string;
|
|
31
|
-
endedAt?: string;
|
|
32
|
-
transcript?: string;
|
|
33
|
-
recordingUrl?: string;
|
|
34
|
-
cost?: number;
|
|
35
|
-
summary?: string;
|
|
36
|
-
assistantParams?: object;
|
|
37
|
-
callParams?: PhoneCallParams;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
12
|
export interface OpenAIFunctionParamaters {
|
|
41
13
|
type: string;
|
|
42
14
|
properties: object;
|
|
@@ -44,12 +16,19 @@ export interface OpenAIFunctionParamaters {
|
|
|
44
16
|
}
|
|
45
17
|
|
|
46
18
|
export interface OpenAIFunction {
|
|
47
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* This is the the name of the function to be called.
|
|
21
|
+
*
|
|
22
|
+
* Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
|
|
23
|
+
* @maxLength 64
|
|
24
|
+
*/
|
|
48
25
|
name: string;
|
|
49
|
-
/** This is
|
|
26
|
+
/** This is the description of what the function does, used by the AI to choose when and how to call the function. */
|
|
50
27
|
description?: string;
|
|
51
28
|
/**
|
|
52
|
-
* These are the parameters the functions accepts, described as a JSON Schema object.
|
|
29
|
+
* These are the parameters the functions accepts, described as a JSON Schema object.
|
|
30
|
+
*
|
|
31
|
+
* See the [OpenAI guide](https://platform.openai.com/docs/guides/gpt/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema) for documentation about the format.
|
|
53
32
|
*
|
|
54
33
|
* To describe a function that accepts no parameters, provide the value {"type": "object", "properties": {}}.
|
|
55
34
|
*/
|
|
@@ -62,17 +41,18 @@ export interface CreateAssistantDTO {
|
|
|
62
41
|
/**
|
|
63
42
|
* This is the voice that will be used.
|
|
64
43
|
*
|
|
65
|
-
* Pro Voices: `*-11labs`, `*-playht
|
|
44
|
+
* Pro Voices: `*-11labs`, `*-playht`
|
|
66
45
|
*
|
|
67
|
-
* Basic Voices: `*-
|
|
46
|
+
* Basic Voices: `*-rimeai`
|
|
68
47
|
*/
|
|
69
48
|
voice?:
|
|
70
|
-
| "
|
|
71
|
-
| "
|
|
72
|
-
| "
|
|
73
|
-
| "
|
|
74
|
-
| "
|
|
75
|
-
| "
|
|
49
|
+
| "jennifer-playht"
|
|
50
|
+
| "melissa-playht"
|
|
51
|
+
| "will-playht"
|
|
52
|
+
| "jack-playht"
|
|
53
|
+
| "ruby-playht"
|
|
54
|
+
| "davis-playht"
|
|
55
|
+
| "donna-playht"
|
|
76
56
|
| "burt-11labs"
|
|
77
57
|
| "andrea-11labs"
|
|
78
58
|
| "phillip-11labs"
|
|
@@ -85,13 +65,6 @@ export interface CreateAssistantDTO {
|
|
|
85
65
|
| "paul-11labs"
|
|
86
66
|
| "mrb-11labs"
|
|
87
67
|
| "matilda-11labs"
|
|
88
|
-
| "jennifer-playht"
|
|
89
|
-
| "melissa-playht"
|
|
90
|
-
| "will-playht"
|
|
91
|
-
| "jack-playht"
|
|
92
|
-
| "ruby-playht"
|
|
93
|
-
| "davis-playht"
|
|
94
|
-
| "donna-playht"
|
|
95
68
|
| "kai-rimeai"
|
|
96
69
|
| "zion-rimeai"
|
|
97
70
|
| "xavier-rimeai"
|
|
@@ -102,44 +75,191 @@ export interface CreateAssistantDTO {
|
|
|
102
75
|
| "daphne-rimeai"
|
|
103
76
|
| "aurora-rimeai"
|
|
104
77
|
| "nova-rimeai";
|
|
105
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* This is the name of the assistant. This is just for your own reference.
|
|
80
|
+
* @maxLength 40
|
|
81
|
+
*/
|
|
106
82
|
name?: string;
|
|
107
|
-
/** This
|
|
83
|
+
/** This sets the objective and understanding for the assistant. */
|
|
108
84
|
context?: string;
|
|
109
85
|
/** These are the functions that the assistant can execute during the call. */
|
|
110
86
|
functions?: OpenAIFunction[];
|
|
111
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* This is the URL Vapi will send GET / POST requests for retrieving context, function calling, and end-of-call reports.
|
|
89
|
+
*
|
|
90
|
+
* All requests will be sent with customerPhoneNumber and all the assistant parameters. You can find more details in the Function Calling documentation.
|
|
91
|
+
*/
|
|
112
92
|
callbackUrl?: string;
|
|
113
|
-
/** This is the number
|
|
93
|
+
/** This is the number to forward to if assistant runs into issues. */
|
|
114
94
|
forwardingPhoneNumber?: string;
|
|
115
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* This is the first message that the assistant will say.
|
|
97
|
+
*
|
|
98
|
+
* If unspecified, it will wait for the user to speak.
|
|
99
|
+
* @maxLength 280
|
|
100
|
+
*/
|
|
116
101
|
firstMessage?: string;
|
|
117
|
-
/**
|
|
102
|
+
/** This sets whether calls are recorded for the assistant. */
|
|
118
103
|
recordingEnabled?: boolean;
|
|
119
|
-
/**
|
|
104
|
+
/** This sets whether assistant leaves voicemails when call is not picked up. */
|
|
120
105
|
voicemailEnabled?: boolean;
|
|
121
106
|
}
|
|
122
107
|
|
|
123
|
-
export interface
|
|
124
|
-
/** This is the
|
|
108
|
+
export interface CreateCustomerDTO {
|
|
109
|
+
/** This is the number of the customer. */
|
|
110
|
+
number?: string;
|
|
111
|
+
/**
|
|
112
|
+
* This is the name of the customer. This is just for your own reference.
|
|
113
|
+
* @maxLength 40
|
|
114
|
+
*/
|
|
115
|
+
name?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface ImportTwilioPhoneNumberDTO {
|
|
119
|
+
/** These are the digits of the phone number you own on your Twilio. */
|
|
120
|
+
twilioPhoneNumber: string;
|
|
121
|
+
/** This is your Twilio Account SID that will be used to handle this phone number. */
|
|
122
|
+
twilioAccountSid: string;
|
|
123
|
+
/** This is the Twilio Auth Token that will be used to handle this phone number. */
|
|
124
|
+
twilioAuthToken: string;
|
|
125
|
+
/**
|
|
126
|
+
* This is the name of the phone number. This is just for your own reference.
|
|
127
|
+
* @maxLength 40
|
|
128
|
+
*/
|
|
129
|
+
name?: string;
|
|
130
|
+
/**
|
|
131
|
+
* This is the assistant that will be used for incoming calls to this phone number.
|
|
132
|
+
*
|
|
133
|
+
* If this is not set, then the phone number will not handle incoming calls.
|
|
134
|
+
*/
|
|
135
|
+
assistantId?: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface Call {
|
|
139
|
+
type?: "inboundPhoneCall" | "outboundPhoneCall" | "webCall";
|
|
140
|
+
/** This is the unique identifier for the call. */
|
|
141
|
+
id: string;
|
|
142
|
+
/** This is the unique identifier for the org that this call belongs to. */
|
|
143
|
+
orgId: string;
|
|
144
|
+
/**
|
|
145
|
+
* This is the ISO 8601 date-time string of when the call was created.
|
|
146
|
+
* @format date-time
|
|
147
|
+
*/
|
|
148
|
+
createdAt: string;
|
|
149
|
+
/**
|
|
150
|
+
* This is the ISO 8601 date-time string of when the call was last updated.
|
|
151
|
+
* @format date-time
|
|
152
|
+
*/
|
|
153
|
+
updatedAt: string;
|
|
154
|
+
/**
|
|
155
|
+
* This is the ISO 8601 date-time string of when the call was started.
|
|
156
|
+
* @format date-time
|
|
157
|
+
*/
|
|
158
|
+
startedAt?: string;
|
|
159
|
+
/**
|
|
160
|
+
* This is the ISO 8601 date-time string of when the call was ended.
|
|
161
|
+
* @format date-time
|
|
162
|
+
*/
|
|
163
|
+
endedAt?: string;
|
|
164
|
+
/** This is the cost of the call in USD. */
|
|
165
|
+
cost?: number;
|
|
166
|
+
/** This is the transcript of the call. */
|
|
167
|
+
transcript?: string;
|
|
168
|
+
/** This is the URL of the recording of the call. */
|
|
169
|
+
recordingUrl?: string;
|
|
170
|
+
/** This is the summary of the call. */
|
|
171
|
+
summary?: string;
|
|
172
|
+
/**
|
|
173
|
+
* This is the callSid of the phone call.
|
|
174
|
+
*
|
|
175
|
+
* Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
|
176
|
+
*/
|
|
177
|
+
twilioCallSid?: string;
|
|
178
|
+
/**
|
|
179
|
+
* This is the current status of the call.
|
|
180
|
+
*
|
|
181
|
+
* Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
|
182
|
+
*/
|
|
183
|
+
twilioCallStatus?: string;
|
|
184
|
+
/**
|
|
185
|
+
* This is the URL of the call that the assistant will join.
|
|
186
|
+
*
|
|
187
|
+
* Only relevant for `webCall` type.
|
|
188
|
+
*/
|
|
189
|
+
webCallUrl?: string;
|
|
190
|
+
/** This is set if the call experienced an error. */
|
|
191
|
+
error?: string;
|
|
192
|
+
/** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
|
|
125
193
|
assistantId?: string;
|
|
126
194
|
/** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
|
|
127
195
|
assistant?: CreateAssistantDTO;
|
|
128
|
-
/**
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
196
|
+
/**
|
|
197
|
+
* This is the customer that will be called. To call a transient customer , use `customer` instead.
|
|
198
|
+
*
|
|
199
|
+
* Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
|
200
|
+
*/
|
|
201
|
+
customerId?: string;
|
|
202
|
+
/**
|
|
203
|
+
* This is the customer that will be called. To call an existing customer, use `customerId` instead.
|
|
204
|
+
*
|
|
205
|
+
* Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
|
206
|
+
*/
|
|
207
|
+
customer?: CreateCustomerDTO;
|
|
208
|
+
/**
|
|
209
|
+
* This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.
|
|
210
|
+
*
|
|
211
|
+
* Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
|
212
|
+
*/
|
|
213
|
+
phoneNumberId?: string;
|
|
214
|
+
/**
|
|
215
|
+
* This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.
|
|
216
|
+
*
|
|
217
|
+
* Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
|
218
|
+
*/
|
|
219
|
+
phoneNumber?: ImportTwilioPhoneNumberDTO;
|
|
132
220
|
}
|
|
133
221
|
|
|
134
|
-
export interface
|
|
135
|
-
/**
|
|
222
|
+
export interface CreateOutboundCallDTO {
|
|
223
|
+
/**
|
|
224
|
+
* Use `customer` instead.
|
|
225
|
+
* @deprecated
|
|
226
|
+
*/
|
|
227
|
+
customerPhoneNumber?: string;
|
|
228
|
+
/** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
|
|
136
229
|
assistantId?: string;
|
|
137
230
|
/** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
|
|
138
231
|
assistant?: CreateAssistantDTO;
|
|
232
|
+
/**
|
|
233
|
+
* This is the customer that will be called. To call a transient customer , use `customer` instead.
|
|
234
|
+
*
|
|
235
|
+
* Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
|
236
|
+
*/
|
|
237
|
+
customerId?: string;
|
|
238
|
+
/**
|
|
239
|
+
* This is the customer that will be called. To call an existing customer, use `customerId` instead.
|
|
240
|
+
*
|
|
241
|
+
* Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
|
242
|
+
*/
|
|
243
|
+
customer?: CreateCustomerDTO;
|
|
244
|
+
/**
|
|
245
|
+
* This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.
|
|
246
|
+
*
|
|
247
|
+
* Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
|
248
|
+
*/
|
|
249
|
+
phoneNumberId?: string;
|
|
250
|
+
/**
|
|
251
|
+
* This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.
|
|
252
|
+
*
|
|
253
|
+
* Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
|
254
|
+
*/
|
|
255
|
+
phoneNumber?: ImportTwilioPhoneNumberDTO;
|
|
139
256
|
}
|
|
140
257
|
|
|
141
|
-
export interface
|
|
142
|
-
|
|
258
|
+
export interface CreateWebCallDTO {
|
|
259
|
+
/** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
|
|
260
|
+
assistantId?: string;
|
|
261
|
+
/** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
|
|
262
|
+
assistant?: CreateAssistantDTO;
|
|
143
263
|
}
|
|
144
264
|
|
|
145
265
|
export interface Assistant {
|
|
@@ -148,17 +268,18 @@ export interface Assistant {
|
|
|
148
268
|
/**
|
|
149
269
|
* This is the voice that will be used.
|
|
150
270
|
*
|
|
151
|
-
* Pro Voices: `*-11labs`, `*-playht
|
|
271
|
+
* Pro Voices: `*-11labs`, `*-playht`
|
|
152
272
|
*
|
|
153
|
-
* Basic Voices: `*-
|
|
273
|
+
* Basic Voices: `*-rimeai`
|
|
154
274
|
*/
|
|
155
275
|
voice?:
|
|
156
|
-
| "
|
|
157
|
-
| "
|
|
158
|
-
| "
|
|
159
|
-
| "
|
|
160
|
-
| "
|
|
161
|
-
| "
|
|
276
|
+
| "jennifer-playht"
|
|
277
|
+
| "melissa-playht"
|
|
278
|
+
| "will-playht"
|
|
279
|
+
| "jack-playht"
|
|
280
|
+
| "ruby-playht"
|
|
281
|
+
| "davis-playht"
|
|
282
|
+
| "donna-playht"
|
|
162
283
|
| "burt-11labs"
|
|
163
284
|
| "andrea-11labs"
|
|
164
285
|
| "phillip-11labs"
|
|
@@ -171,13 +292,6 @@ export interface Assistant {
|
|
|
171
292
|
| "paul-11labs"
|
|
172
293
|
| "mrb-11labs"
|
|
173
294
|
| "matilda-11labs"
|
|
174
|
-
| "jennifer-playht"
|
|
175
|
-
| "melissa-playht"
|
|
176
|
-
| "will-playht"
|
|
177
|
-
| "jack-playht"
|
|
178
|
-
| "ruby-playht"
|
|
179
|
-
| "davis-playht"
|
|
180
|
-
| "donna-playht"
|
|
181
295
|
| "kai-rimeai"
|
|
182
296
|
| "zion-rimeai"
|
|
183
297
|
| "xavier-rimeai"
|
|
@@ -188,30 +302,48 @@ export interface Assistant {
|
|
|
188
302
|
| "daphne-rimeai"
|
|
189
303
|
| "aurora-rimeai"
|
|
190
304
|
| "nova-rimeai";
|
|
191
|
-
/**
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
/** ISO 8601 date-time string of when the assistant was created. */
|
|
196
|
-
createdAt: string;
|
|
197
|
-
/** ISO 8601 date-time string of when the assistant was last updated. */
|
|
198
|
-
updatedAt: string;
|
|
199
|
-
/** This is the assistant’s name, just for your own reference. */
|
|
305
|
+
/**
|
|
306
|
+
* This is the name of the assistant. This is just for your own reference.
|
|
307
|
+
* @maxLength 40
|
|
308
|
+
*/
|
|
200
309
|
name?: string;
|
|
201
|
-
/** This
|
|
310
|
+
/** This sets the objective and understanding for the assistant. */
|
|
202
311
|
context?: string;
|
|
203
312
|
/** These are the functions that the assistant can execute during the call. */
|
|
204
313
|
functions?: OpenAIFunction[];
|
|
205
|
-
/**
|
|
314
|
+
/**
|
|
315
|
+
* This is the URL Vapi will send GET / POST requests for retrieving context, function calling, and end-of-call reports.
|
|
316
|
+
*
|
|
317
|
+
* All requests will be sent with customerPhoneNumber and all the assistant parameters. You can find more details in the Function Calling documentation.
|
|
318
|
+
*/
|
|
206
319
|
callbackUrl?: string;
|
|
207
|
-
/** This is the number
|
|
320
|
+
/** This is the number to forward to if assistant runs into issues. */
|
|
208
321
|
forwardingPhoneNumber?: string;
|
|
209
|
-
/**
|
|
322
|
+
/**
|
|
323
|
+
* This is the first message that the assistant will say.
|
|
324
|
+
*
|
|
325
|
+
* If unspecified, it will wait for the user to speak.
|
|
326
|
+
* @maxLength 280
|
|
327
|
+
*/
|
|
210
328
|
firstMessage?: string;
|
|
211
|
-
/**
|
|
329
|
+
/** This sets whether calls are recorded for the assistant. */
|
|
212
330
|
recordingEnabled?: boolean;
|
|
213
|
-
/**
|
|
331
|
+
/** This sets whether assistant leaves voicemails when call is not picked up. */
|
|
214
332
|
voicemailEnabled?: boolean;
|
|
333
|
+
/** This is the unique identifier for the assistant. */
|
|
334
|
+
id: string;
|
|
335
|
+
/** This is the unique identifier for the org that this assistant belongs to. */
|
|
336
|
+
orgId: string;
|
|
337
|
+
/**
|
|
338
|
+
* This is the ISO 8601 date-time string of when the assistant was created.
|
|
339
|
+
* @format date-time
|
|
340
|
+
*/
|
|
341
|
+
createdAt: string;
|
|
342
|
+
/**
|
|
343
|
+
* This is the ISO 8601 date-time string of when the assistant was last updated.
|
|
344
|
+
* @format date-time
|
|
345
|
+
*/
|
|
346
|
+
updatedAt: string;
|
|
215
347
|
}
|
|
216
348
|
|
|
217
349
|
export interface UpdateAssistantDTO {
|
|
@@ -220,17 +352,18 @@ export interface UpdateAssistantDTO {
|
|
|
220
352
|
/**
|
|
221
353
|
* This is the voice that will be used.
|
|
222
354
|
*
|
|
223
|
-
* Pro Voices: `*-11labs`, `*-playht
|
|
355
|
+
* Pro Voices: `*-11labs`, `*-playht`
|
|
224
356
|
*
|
|
225
|
-
* Basic Voices: `*-
|
|
357
|
+
* Basic Voices: `*-rimeai`
|
|
226
358
|
*/
|
|
227
359
|
voice?:
|
|
228
|
-
| "
|
|
229
|
-
| "
|
|
230
|
-
| "
|
|
231
|
-
| "
|
|
232
|
-
| "
|
|
233
|
-
| "
|
|
360
|
+
| "jennifer-playht"
|
|
361
|
+
| "melissa-playht"
|
|
362
|
+
| "will-playht"
|
|
363
|
+
| "jack-playht"
|
|
364
|
+
| "ruby-playht"
|
|
365
|
+
| "davis-playht"
|
|
366
|
+
| "donna-playht"
|
|
234
367
|
| "burt-11labs"
|
|
235
368
|
| "andrea-11labs"
|
|
236
369
|
| "phillip-11labs"
|
|
@@ -243,13 +376,6 @@ export interface UpdateAssistantDTO {
|
|
|
243
376
|
| "paul-11labs"
|
|
244
377
|
| "mrb-11labs"
|
|
245
378
|
| "matilda-11labs"
|
|
246
|
-
| "jennifer-playht"
|
|
247
|
-
| "melissa-playht"
|
|
248
|
-
| "will-playht"
|
|
249
|
-
| "jack-playht"
|
|
250
|
-
| "ruby-playht"
|
|
251
|
-
| "davis-playht"
|
|
252
|
-
| "donna-playht"
|
|
253
379
|
| "kai-rimeai"
|
|
254
380
|
| "zion-rimeai"
|
|
255
381
|
| "xavier-rimeai"
|
|
@@ -260,52 +386,115 @@ export interface UpdateAssistantDTO {
|
|
|
260
386
|
| "daphne-rimeai"
|
|
261
387
|
| "aurora-rimeai"
|
|
262
388
|
| "nova-rimeai";
|
|
263
|
-
/**
|
|
389
|
+
/**
|
|
390
|
+
* This is the name of the assistant. This is just for your own reference.
|
|
391
|
+
* @maxLength 40
|
|
392
|
+
*/
|
|
264
393
|
name?: string;
|
|
265
|
-
/** This
|
|
394
|
+
/** This sets the objective and understanding for the assistant. */
|
|
266
395
|
context?: string;
|
|
267
396
|
/** These are the functions that the assistant can execute during the call. */
|
|
268
397
|
functions?: OpenAIFunction[];
|
|
269
|
-
/**
|
|
398
|
+
/**
|
|
399
|
+
* This is the URL Vapi will send GET / POST requests for retrieving context, function calling, and end-of-call reports.
|
|
400
|
+
*
|
|
401
|
+
* All requests will be sent with customerPhoneNumber and all the assistant parameters. You can find more details in the Function Calling documentation.
|
|
402
|
+
*/
|
|
270
403
|
callbackUrl?: string;
|
|
271
|
-
/** This is the number
|
|
404
|
+
/** This is the number to forward to if assistant runs into issues. */
|
|
272
405
|
forwardingPhoneNumber?: string;
|
|
273
|
-
/**
|
|
406
|
+
/**
|
|
407
|
+
* This is the first message that the assistant will say.
|
|
408
|
+
*
|
|
409
|
+
* If unspecified, it will wait for the user to speak.
|
|
410
|
+
* @maxLength 280
|
|
411
|
+
*/
|
|
274
412
|
firstMessage?: string;
|
|
275
|
-
/**
|
|
413
|
+
/** This sets whether calls are recorded for the assistant. */
|
|
276
414
|
recordingEnabled?: boolean;
|
|
277
|
-
/**
|
|
415
|
+
/** This sets whether assistant leaves voicemails when call is not picked up. */
|
|
278
416
|
voicemailEnabled?: boolean;
|
|
279
417
|
}
|
|
280
418
|
|
|
281
|
-
export interface
|
|
282
|
-
/**
|
|
419
|
+
export interface BuyPhoneNumberDTO {
|
|
420
|
+
/**
|
|
421
|
+
* This is the area code of the phone number to purchase.
|
|
422
|
+
* @minLength 3
|
|
423
|
+
* @maxLength 3
|
|
424
|
+
*/
|
|
283
425
|
areaCode: string;
|
|
426
|
+
/**
|
|
427
|
+
* This is the name of the phone number. This is just for your own reference.
|
|
428
|
+
* @maxLength 40
|
|
429
|
+
*/
|
|
430
|
+
name?: string;
|
|
431
|
+
/**
|
|
432
|
+
* This is the assistant that will be used for incoming calls to this phone number.
|
|
433
|
+
*
|
|
434
|
+
* If this is not set, then the phone number will not handle incoming calls.
|
|
435
|
+
*/
|
|
284
436
|
assistantId?: string;
|
|
285
437
|
}
|
|
286
438
|
|
|
287
439
|
export interface PhoneNumber {
|
|
440
|
+
/** This is the unique identifier for the phone number. */
|
|
288
441
|
id: string;
|
|
442
|
+
/** This is the unique identifier for the org that this phone number belongs to. */
|
|
443
|
+
orgId: string;
|
|
444
|
+
/**
|
|
445
|
+
* This is the ISO 8601 date-time string of when the phone number was created.
|
|
446
|
+
* @format date-time
|
|
447
|
+
*/
|
|
289
448
|
createdAt: string;
|
|
449
|
+
/**
|
|
450
|
+
* This is the ISO 8601 date-time string of when the phone number was last updated.
|
|
451
|
+
* @format date-time
|
|
452
|
+
*/
|
|
290
453
|
updatedAt: string;
|
|
291
|
-
|
|
454
|
+
/** This is the subscription for the phone number. */
|
|
292
455
|
stripeSubscriptionId?: string;
|
|
456
|
+
/** This is the subscription's status. */
|
|
457
|
+
stripeSubscriptionStatus?: string;
|
|
458
|
+
/** This is the subscription's current period start. */
|
|
459
|
+
stripeSubscriptionCurrentPeriodStart?: string;
|
|
460
|
+
/** These are the digits of the phone number. */
|
|
293
461
|
number: string;
|
|
294
|
-
|
|
462
|
+
/**
|
|
463
|
+
* This is the Twilio Account SID for the phone number.
|
|
464
|
+
*
|
|
465
|
+
* This is for numbers not bought on Vapi.
|
|
466
|
+
*/
|
|
295
467
|
twilioAccountSid?: string;
|
|
468
|
+
/**
|
|
469
|
+
* This is the Twilio Auth Token for the phone number.
|
|
470
|
+
*
|
|
471
|
+
* This is for numbers not bought on Vapi.
|
|
472
|
+
*/
|
|
296
473
|
twilioAuthToken?: string;
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
474
|
+
/**
|
|
475
|
+
* This is the name of the phone number. This is just for your own reference.
|
|
476
|
+
* @maxLength 40
|
|
477
|
+
*/
|
|
478
|
+
name?: string;
|
|
479
|
+
/**
|
|
480
|
+
* This is the assistant that will be used for incoming calls to this phone number.
|
|
481
|
+
*
|
|
482
|
+
* If this is not set, then the phone number will not handle incoming calls.
|
|
483
|
+
*/
|
|
304
484
|
assistantId?: string;
|
|
305
485
|
}
|
|
306
486
|
|
|
307
|
-
export interface
|
|
308
|
-
/**
|
|
487
|
+
export interface UpdatePhoneNumberDTO {
|
|
488
|
+
/**
|
|
489
|
+
* This is the name of the phone number. This is just for your own reference.
|
|
490
|
+
* @maxLength 40
|
|
491
|
+
*/
|
|
492
|
+
name?: string;
|
|
493
|
+
/**
|
|
494
|
+
* This is the assistant that will be used for incoming calls to this phone number.
|
|
495
|
+
*
|
|
496
|
+
* If this is not set, then the phone number will not handle incoming calls.
|
|
497
|
+
*/
|
|
309
498
|
assistantId?: string;
|
|
310
499
|
}
|
|
311
500
|
|
|
@@ -535,11 +724,13 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
535
724
|
* @name CallControllerFindAll
|
|
536
725
|
* @summary List Calls
|
|
537
726
|
* @request GET:/call
|
|
727
|
+
* @secure
|
|
538
728
|
*/
|
|
539
729
|
callControllerFindAll: (params: RequestParams = {}) =>
|
|
540
730
|
this.request<Call[], any>({
|
|
541
731
|
path: `/call`,
|
|
542
732
|
method: "GET",
|
|
733
|
+
secure: true,
|
|
543
734
|
format: "json",
|
|
544
735
|
...params,
|
|
545
736
|
}),
|
|
@@ -551,11 +742,13 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
551
742
|
* @name CallControllerFindOne
|
|
552
743
|
* @summary Get Call
|
|
553
744
|
* @request GET:/call/{id}
|
|
745
|
+
* @secure
|
|
554
746
|
*/
|
|
555
747
|
callControllerFindOne: (id: string, params: RequestParams = {}) =>
|
|
556
748
|
this.request<Call, any>({
|
|
557
749
|
path: `/call/${id}`,
|
|
558
750
|
method: "GET",
|
|
751
|
+
secure: true,
|
|
559
752
|
format: "json",
|
|
560
753
|
...params,
|
|
561
754
|
}),
|
|
@@ -567,12 +760,14 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
567
760
|
* @name CallControllerCreatePhoneCall
|
|
568
761
|
* @summary Create Phone Call
|
|
569
762
|
* @request POST:/call/phone
|
|
763
|
+
* @secure
|
|
570
764
|
*/
|
|
571
|
-
callControllerCreatePhoneCall: (data:
|
|
765
|
+
callControllerCreatePhoneCall: (data: CreateOutboundCallDTO, params: RequestParams = {}) =>
|
|
572
766
|
this.request<Call, any>({
|
|
573
767
|
path: `/call/phone`,
|
|
574
768
|
method: "POST",
|
|
575
769
|
body: data,
|
|
770
|
+
secure: true,
|
|
576
771
|
type: ContentType.Json,
|
|
577
772
|
format: "json",
|
|
578
773
|
...params,
|
|
@@ -585,12 +780,14 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
585
780
|
* @name CallControllerCreateWebCall
|
|
586
781
|
* @summary Create Web Call
|
|
587
782
|
* @request POST:/call/web
|
|
783
|
+
* @secure
|
|
588
784
|
*/
|
|
589
|
-
callControllerCreateWebCall: (data:
|
|
590
|
-
this.request<
|
|
785
|
+
callControllerCreateWebCall: (data: CreateWebCallDTO, params: RequestParams = {}) =>
|
|
786
|
+
this.request<Call, any>({
|
|
591
787
|
path: `/call/web`,
|
|
592
788
|
method: "POST",
|
|
593
789
|
body: data,
|
|
790
|
+
secure: true,
|
|
594
791
|
type: ContentType.Json,
|
|
595
792
|
format: "json",
|
|
596
793
|
...params,
|
|
@@ -604,12 +801,14 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
604
801
|
* @name AssistantControllerCreate
|
|
605
802
|
* @summary Create Assistant
|
|
606
803
|
* @request POST:/assistant
|
|
804
|
+
* @secure
|
|
607
805
|
*/
|
|
608
806
|
assistantControllerCreate: (data: CreateAssistantDTO, params: RequestParams = {}) =>
|
|
609
807
|
this.request<Assistant, any>({
|
|
610
808
|
path: `/assistant`,
|
|
611
809
|
method: "POST",
|
|
612
810
|
body: data,
|
|
811
|
+
secure: true,
|
|
613
812
|
type: ContentType.Json,
|
|
614
813
|
format: "json",
|
|
615
814
|
...params,
|
|
@@ -622,11 +821,13 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
622
821
|
* @name AssistantControllerFindAll
|
|
623
822
|
* @summary List Assistants
|
|
624
823
|
* @request GET:/assistant
|
|
824
|
+
* @secure
|
|
625
825
|
*/
|
|
626
826
|
assistantControllerFindAll: (params: RequestParams = {}) =>
|
|
627
827
|
this.request<Assistant[], any>({
|
|
628
828
|
path: `/assistant`,
|
|
629
829
|
method: "GET",
|
|
830
|
+
secure: true,
|
|
630
831
|
format: "json",
|
|
631
832
|
...params,
|
|
632
833
|
}),
|
|
@@ -638,11 +839,13 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
638
839
|
* @name AssistantControllerFindOne
|
|
639
840
|
* @summary Get Assistant
|
|
640
841
|
* @request GET:/assistant/{id}
|
|
842
|
+
* @secure
|
|
641
843
|
*/
|
|
642
844
|
assistantControllerFindOne: (id: string, params: RequestParams = {}) =>
|
|
643
845
|
this.request<Assistant, any>({
|
|
644
846
|
path: `/assistant/${id}`,
|
|
645
847
|
method: "GET",
|
|
848
|
+
secure: true,
|
|
646
849
|
format: "json",
|
|
647
850
|
...params,
|
|
648
851
|
}),
|
|
@@ -654,12 +857,14 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
654
857
|
* @name AssistantControllerUpdate
|
|
655
858
|
* @summary Update Assistant
|
|
656
859
|
* @request PATCH:/assistant/{id}
|
|
860
|
+
* @secure
|
|
657
861
|
*/
|
|
658
862
|
assistantControllerUpdate: (id: string, data: UpdateAssistantDTO, params: RequestParams = {}) =>
|
|
659
863
|
this.request<Assistant, any>({
|
|
660
864
|
path: `/assistant/${id}`,
|
|
661
865
|
method: "PATCH",
|
|
662
866
|
body: data,
|
|
867
|
+
secure: true,
|
|
663
868
|
type: ContentType.Json,
|
|
664
869
|
format: "json",
|
|
665
870
|
...params,
|
|
@@ -672,11 +877,14 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
672
877
|
* @name AssistantControllerRemove
|
|
673
878
|
* @summary Delete Assistant
|
|
674
879
|
* @request DELETE:/assistant/{id}
|
|
880
|
+
* @secure
|
|
675
881
|
*/
|
|
676
882
|
assistantControllerRemove: (id: string, params: RequestParams = {}) =>
|
|
677
|
-
this.request<
|
|
883
|
+
this.request<Assistant, any>({
|
|
678
884
|
path: `/assistant/${id}`,
|
|
679
885
|
method: "DELETE",
|
|
886
|
+
secure: true,
|
|
887
|
+
format: "json",
|
|
680
888
|
...params,
|
|
681
889
|
}),
|
|
682
890
|
};
|
|
@@ -688,12 +896,14 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
688
896
|
* @name PhoneNumberControllerBuy
|
|
689
897
|
* @summary Buy Phone Number
|
|
690
898
|
* @request POST:/phone-number/buy
|
|
899
|
+
* @secure
|
|
691
900
|
*/
|
|
692
|
-
phoneNumberControllerBuy: (data:
|
|
901
|
+
phoneNumberControllerBuy: (data: BuyPhoneNumberDTO, params: RequestParams = {}) =>
|
|
693
902
|
this.request<PhoneNumber, any>({
|
|
694
903
|
path: `/phone-number/buy`,
|
|
695
904
|
method: "POST",
|
|
696
905
|
body: data,
|
|
906
|
+
secure: true,
|
|
697
907
|
type: ContentType.Json,
|
|
698
908
|
format: "json",
|
|
699
909
|
...params,
|
|
@@ -706,12 +916,14 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
706
916
|
* @name PhoneNumberControllerImport
|
|
707
917
|
* @summary Import Twilio Number
|
|
708
918
|
* @request POST:/phone-number/import
|
|
919
|
+
* @secure
|
|
709
920
|
*/
|
|
710
|
-
phoneNumberControllerImport: (data:
|
|
921
|
+
phoneNumberControllerImport: (data: ImportTwilioPhoneNumberDTO, params: RequestParams = {}) =>
|
|
711
922
|
this.request<PhoneNumber, any>({
|
|
712
923
|
path: `/phone-number/import`,
|
|
713
924
|
method: "POST",
|
|
714
925
|
body: data,
|
|
926
|
+
secure: true,
|
|
715
927
|
type: ContentType.Json,
|
|
716
928
|
format: "json",
|
|
717
929
|
...params,
|
|
@@ -724,11 +936,13 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
724
936
|
* @name PhoneNumberControllerFindAll
|
|
725
937
|
* @summary List Phone Numbers
|
|
726
938
|
* @request GET:/phone-number
|
|
939
|
+
* @secure
|
|
727
940
|
*/
|
|
728
941
|
phoneNumberControllerFindAll: (params: RequestParams = {}) =>
|
|
729
942
|
this.request<PhoneNumber[], any>({
|
|
730
943
|
path: `/phone-number`,
|
|
731
944
|
method: "GET",
|
|
945
|
+
secure: true,
|
|
732
946
|
format: "json",
|
|
733
947
|
...params,
|
|
734
948
|
}),
|
|
@@ -740,11 +954,13 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
740
954
|
* @name PhoneNumberControllerFindOne
|
|
741
955
|
* @summary Get Phone Number
|
|
742
956
|
* @request GET:/phone-number/{id}
|
|
957
|
+
* @secure
|
|
743
958
|
*/
|
|
744
959
|
phoneNumberControllerFindOne: (id: string, params: RequestParams = {}) =>
|
|
745
960
|
this.request<PhoneNumber, any>({
|
|
746
961
|
path: `/phone-number/${id}`,
|
|
747
962
|
method: "GET",
|
|
963
|
+
secure: true,
|
|
748
964
|
format: "json",
|
|
749
965
|
...params,
|
|
750
966
|
}),
|
|
@@ -756,12 +972,14 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
756
972
|
* @name PhoneNumberControllerUpdate
|
|
757
973
|
* @summary Update Phone Number
|
|
758
974
|
* @request PATCH:/phone-number/{id}
|
|
975
|
+
* @secure
|
|
759
976
|
*/
|
|
760
|
-
phoneNumberControllerUpdate: (id: string, data:
|
|
977
|
+
phoneNumberControllerUpdate: (id: string, data: UpdatePhoneNumberDTO, params: RequestParams = {}) =>
|
|
761
978
|
this.request<PhoneNumber, any>({
|
|
762
979
|
path: `/phone-number/${id}`,
|
|
763
980
|
method: "PATCH",
|
|
764
981
|
body: data,
|
|
982
|
+
secure: true,
|
|
765
983
|
type: ContentType.Json,
|
|
766
984
|
format: "json",
|
|
767
985
|
...params,
|
|
@@ -774,11 +992,13 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
774
992
|
* @name PhoneNumberControllerRemove
|
|
775
993
|
* @summary Delete Phone Number
|
|
776
994
|
* @request DELETE:/phone-number/{id}
|
|
995
|
+
* @secure
|
|
777
996
|
*/
|
|
778
997
|
phoneNumberControllerRemove: (id: string, params: RequestParams = {}) =>
|
|
779
998
|
this.request<void, any>({
|
|
780
999
|
path: `/phone-number/${id}`,
|
|
781
1000
|
method: "DELETE",
|
|
1001
|
+
secure: true,
|
|
782
1002
|
...params,
|
|
783
1003
|
}),
|
|
784
1004
|
};
|