@vapi-ai/web 1.0.231 → 1.0.233

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.
Files changed (4) hide show
  1. package/api.ts +640 -332
  2. package/dist/api.d.ts +398 -216
  3. package/dist/api.js +79 -27
  4. package/package.json +1 -1
package/api.ts CHANGED
@@ -9,6 +9,67 @@
9
9
  * ---------------------------------------------------------------
10
10
  */
11
11
 
12
+ export interface BetaVoice {
13
+ /**
14
+ * This is the voice provider that will be used.
15
+ *
16
+ * Pro Voices: `11labs`, `playht`
17
+ *
18
+ * Basic Voices: `rimeai`, `beta`
19
+ */
20
+ provider: "beta";
21
+ /** This is the provider-specific ID that will be used. */
22
+ voiceId: string;
23
+ }
24
+
25
+ export interface CustomModel {
26
+ /**
27
+ * This is the provider that will be used for the model. Currently, only OpenAI and Custom LLM URLs are supported.
28
+ *
29
+ * If you have your own LLM, you can use the URL of your LLM endpoint here.
30
+ */
31
+ provider: "custom";
32
+ /** These is the URL we'll POST during the conversation. */
33
+ url: string;
34
+ /** This sets the objective and understanding for the assistant. */
35
+ systemPrompt?: string;
36
+ }
37
+
38
+ export interface DeepgramTranscriber {
39
+ /** This is the transcription provider that will be used. Currently, only Deepgram is supported. */
40
+ provider: "deepgram";
41
+ /** This is the Deepgram model that will be used. A list of models can be found here: https://developers.deepgram.com/docs/models-languages-overview */
42
+ model?:
43
+ | "nova-2"
44
+ | "nova-2-general"
45
+ | "nova-2-meeting"
46
+ | "nova-2-phonecall"
47
+ | "nova-2-finance"
48
+ | "nova-2-conversationalai"
49
+ | "nova-2-voicemail"
50
+ | "nova-2-video"
51
+ | "nova-2-medical"
52
+ | "nova-2-drivethru"
53
+ | "nova-2-automotive"
54
+ | "nova-2-custom"
55
+ | string;
56
+ /** These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here. */
57
+ keywords?: string[];
58
+ }
59
+
60
+ export interface ElevenLabsVoice {
61
+ /**
62
+ * This is the voice provider that will be used.
63
+ *
64
+ * Pro Voices: `11labs`, `playht`
65
+ *
66
+ * Basic Voices: `rimeai`, `beta`
67
+ */
68
+ provider: "11labs";
69
+ /** This is the provider-specific ID that will be used. */
70
+ voiceId: string;
71
+ }
72
+
12
73
  export interface OpenAIFunctionParameterProperty {
13
74
  type: "string" | "number" | "boolean";
14
75
  enum?: string[];
@@ -43,15 +104,66 @@ export interface OpenAIFunction {
43
104
  parameters: OpenAIFunctionParameters;
44
105
  }
45
106
 
46
- export interface CreateAssistantDTO {
107
+ export interface OpenAIModel {
108
+ /**
109
+ * This is the provider that will be used for the model. Currently, only OpenAI and Custom LLM URLs are supported.
110
+ *
111
+ * If you have your own LLM, you can use the URL of your LLM endpoint here.
112
+ */
113
+ provider: "openai";
47
114
  /** This is the OpenAI model that will be used. */
48
- model?: "gpt-4" | "gpt-3.5-turbo";
115
+ model: "gpt-4" | "gpt-3.5-turbo";
116
+ /** This sets the objective and understanding for the assistant. */
117
+ systemPrompt?: string;
118
+ /**
119
+ * This is the temperature that will be used for OpenAI calls.
120
+ * @min 0
121
+ * @max 2
122
+ */
123
+ temperature?: number;
124
+ /** These are the functions that the assistant can execute during the call. */
125
+ functions?: OpenAIFunction[];
126
+ }
127
+
128
+ export interface PlayHTVoice {
129
+ /**
130
+ * This is the voice provider that will be used.
131
+ *
132
+ * Pro Voices: `11labs`, `playht`
133
+ *
134
+ * Basic Voices: `rimeai`, `beta`
135
+ */
136
+ provider: "playht";
137
+ /** This is the provider-specific ID that will be used. */
138
+ voiceId: string;
139
+ }
140
+
141
+ export interface RimeAIVoice {
49
142
  /**
50
- * This is the voice that will be used.
143
+ * This is the voice provider that will be used.
51
144
  *
52
- * Pro Voices: `*-11labs`, `*-playht`
145
+ * Pro Voices: `11labs`, `playht`
53
146
  *
54
- * Basic Voices: `*-rimeai`
147
+ * Basic Voices: `rimeai`, `beta`
148
+ */
149
+ provider: "rimeai";
150
+ /** This is the provider-specific ID that will be used. */
151
+ voiceId: string;
152
+ }
153
+
154
+ export interface CreateAssistantDTO {
155
+ /**
156
+ * This is the name of the assistant. This is just for your own reference.
157
+ * @maxLength 100
158
+ */
159
+ name?: string;
160
+ /** These are the options for the assistant's transcriber. */
161
+ transcriber?: DeepgramTranscriber;
162
+ /** These are the options for the assistant's LLM. */
163
+ model?: "0" | "1" | "2" | OpenAIModel | CustomModel;
164
+ /**
165
+ * These are the options for the assistant's voice.
166
+ * @default "jennifer-playht"
55
167
  */
56
168
  voice?:
57
169
  | "jennifer-playht"
@@ -93,10 +205,14 @@ export interface CreateAssistantDTO {
93
205
  | "stella-beta"
94
206
  | "artemis-beta"
95
207
  | "andromeda-beta"
96
- | "atlas-beta";
208
+ | "atlas-beta"
209
+ | ElevenLabsVoice
210
+ | PlayHTVoice
211
+ | RimeAIVoice
212
+ | BetaVoice;
97
213
  /**
98
214
  * This sets the spoken language of the user. The assistant will do its best to respond in the same language.
99
- * When using a language other than `en-*`, only `*-11labs` voices will pronounce the words correctly. There will also be ~1sec of additional latency.
215
+ * When using a language other than `en-*`, only `11labs` voices will pronounce the words correctly. There will also be ~1sec of additional latency.
100
216
  */
101
217
  language?:
102
218
  | "en"
@@ -114,45 +230,21 @@ export interface CreateAssistantDTO {
114
230
  | "pt-BR"
115
231
  | "es"
116
232
  | "es-419";
117
- /**
118
- * This is the name of the assistant. This is just for your own reference.
119
- * @maxLength 100
120
- */
121
- name?: string;
122
- /** This sets the objective and understanding for the assistant. */
123
- context?: string;
124
- /** These are the functions that the assistant can execute during the call. */
125
- functions?: OpenAIFunction[];
126
- /**
127
- * This is the URL Vapi will send GET / POST requests for retrieving context, function calling, and end-of-call reports.
128
- *
129
- * All requests will be sent with the `call` object among other things relevant to that callback. You can find more details in the Function Calling documentation.
130
- */
131
- callbackUrl?: string;
132
- /**
133
- * If you are using a custom LLM, this is the URL Vapi will use instead of hitting OpenAI.
134
- *
135
- * A POST request will be sent with an array of messages, and the response should be like so:
136
- *
137
- * ```
138
- * { message: "Oh hey! How are..." }
139
- * ```
140
- */
141
- customLlmUrl?: string;
142
233
  /** This is the number to forward to if assistant runs into issues. */
143
234
  forwardingPhoneNumber?: string;
144
235
  /**
145
236
  * This is the first message that the assistant will say.
146
237
  *
147
238
  * If unspecified, it will wait for the user to speak.
148
- * @maxLength 400
239
+ * @maxLength 1000
240
+ * @default "Hey there!"
149
241
  */
150
242
  firstMessage?: string;
151
243
  /**
152
244
  * This is the message that the assistant will say if the call is forwarded to voicemail.
153
245
  *
154
246
  * If unspecified, it will hang up.
155
- * @maxLength 400
247
+ * @maxLength 1000
156
248
  */
157
249
  voicemailMessage?: string;
158
250
  /**
@@ -170,176 +262,21 @@ export interface CreateAssistantDTO {
170
262
  endCallFunctionEnabled?: boolean;
171
263
  /** This sets whether the assistant will use fillers like Well..., Okay cool..., etc. Defaults to true when using gpt-4. Else, defaults to false. */
172
264
  fillersEnabled?: boolean;
173
- /** These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here. */
174
- keywords?: string[];
175
- }
176
-
177
- export interface CreateCustomerDTO {
178
- /** This is the number of the customer. */
179
- number?: string;
180
- /**
181
- * This is the name of the customer. This is just for your own reference.
182
- * @maxLength 40
183
- */
184
- name?: string;
185
265
  }
186
266
 
187
- export interface ImportTwilioPhoneNumberDTO {
188
- /** These are the digits of the phone number you own on your Twilio. */
189
- twilioPhoneNumber: string;
190
- /** This is your Twilio Account SID that will be used to handle this phone number. */
191
- twilioAccountSid: string;
192
- /** This is the Twilio Auth Token that will be used to handle this phone number. */
193
- twilioAuthToken: string;
267
+ export interface Assistant {
194
268
  /**
195
- * This is the name of the phone number. This is just for your own reference.
196
- * @maxLength 40
269
+ * This is the name of the assistant. This is just for your own reference.
270
+ * @maxLength 100
197
271
  */
198
272
  name?: string;
273
+ /** These are the options for the assistant's transcriber. */
274
+ transcriber?: DeepgramTranscriber;
275
+ /** These are the options for the assistant's LLM. */
276
+ model?: "0" | "1" | "2" | OpenAIModel | CustomModel;
199
277
  /**
200
- * This is the assistant that will be used for incoming calls to this phone number.
201
- *
202
- * If this is not set, then the phone number will not handle incoming calls.
203
- */
204
- assistantId?: string;
205
- }
206
-
207
- export interface Call {
208
- type?: "inboundPhoneCall" | "outboundPhoneCall" | "webCall";
209
- /** This is the unique identifier for the call. */
210
- id: string;
211
- /** This is the unique identifier for the org that this call belongs to. */
212
- orgId: string;
213
- /**
214
- * This is the ISO 8601 date-time string of when the call was created.
215
- * @format date-time
216
- */
217
- createdAt: string;
218
- /**
219
- * This is the ISO 8601 date-time string of when the call was last updated.
220
- * @format date-time
221
- */
222
- updatedAt: string;
223
- /**
224
- * This is the ISO 8601 date-time string of when the call was started.
225
- * @format date-time
226
- */
227
- startedAt?: string;
228
- /**
229
- * This is the ISO 8601 date-time string of when the call was ended.
230
- * @format date-time
231
- */
232
- endedAt?: string;
233
- /** This is the cost of the call in USD. */
234
- cost?: number;
235
- /** This is the transcript of the call. */
236
- transcript?: string;
237
- /** This is the URL of the recording of the call. */
238
- recordingUrl?: string;
239
- /** This is the summary of the call. */
240
- summary?: string;
241
- /**
242
- * This is the callSid of the phone call.
243
- *
244
- * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
245
- */
246
- twilioCallSid?: string;
247
- /**
248
- * This is the current status of the call.
249
- *
250
- * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
251
- */
252
- twilioCallStatus?: string;
253
- /**
254
- * This is the URL of the call that the assistant will join.
255
- *
256
- * Only relevant for `webCall` type.
257
- */
258
- webCallUrl?: string;
259
- /** This is set if the call experienced an error. */
260
- error?: string;
261
- /** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
262
- assistantId?: string;
263
- /** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
264
- assistant?: CreateAssistantDTO;
265
- /**
266
- * This is the customer that will be called. To call a transient customer , use `customer` instead.
267
- *
268
- * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
269
- */
270
- customerId?: string;
271
- /**
272
- * This is the customer that will be called. To call an existing customer, use `customerId` instead.
273
- *
274
- * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
275
- */
276
- customer?: CreateCustomerDTO;
277
- /**
278
- * This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.
279
- *
280
- * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
281
- */
282
- phoneNumberId?: string;
283
- /**
284
- * This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.
285
- *
286
- * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
287
- */
288
- phoneNumber?: ImportTwilioPhoneNumberDTO;
289
- }
290
-
291
- export interface CreateOutboundCallDTO {
292
- /**
293
- * Use `customer` instead.
294
- * @deprecated
295
- */
296
- customerPhoneNumber?: string;
297
- /** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
298
- assistantId?: string;
299
- /** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
300
- assistant?: CreateAssistantDTO;
301
- /**
302
- * This is the customer that will be called. To call a transient customer , use `customer` instead.
303
- *
304
- * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
305
- */
306
- customerId?: string;
307
- /**
308
- * This is the customer that will be called. To call an existing customer, use `customerId` instead.
309
- *
310
- * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
311
- */
312
- customer?: CreateCustomerDTO;
313
- /**
314
- * This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.
315
- *
316
- * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
317
- */
318
- phoneNumberId?: string;
319
- /**
320
- * This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.
321
- *
322
- * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
323
- */
324
- phoneNumber?: ImportTwilioPhoneNumberDTO;
325
- }
326
-
327
- export interface CreateWebCallDTO {
328
- /** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
329
- assistantId?: string;
330
- /** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
331
- assistant?: CreateAssistantDTO;
332
- }
333
-
334
- export interface Assistant {
335
- /** This is the OpenAI model that will be used. */
336
- model?: "gpt-4" | "gpt-3.5-turbo";
337
- /**
338
- * This is the voice that will be used.
339
- *
340
- * Pro Voices: `*-11labs`, `*-playht`
341
- *
342
- * Basic Voices: `*-rimeai`
278
+ * These are the options for the assistant's voice.
279
+ * @default "jennifer-playht"
343
280
  */
344
281
  voice?:
345
282
  | "jennifer-playht"
@@ -381,10 +318,14 @@ export interface Assistant {
381
318
  | "stella-beta"
382
319
  | "artemis-beta"
383
320
  | "andromeda-beta"
384
- | "atlas-beta";
321
+ | "atlas-beta"
322
+ | ElevenLabsVoice
323
+ | PlayHTVoice
324
+ | RimeAIVoice
325
+ | BetaVoice;
385
326
  /**
386
327
  * This sets the spoken language of the user. The assistant will do its best to respond in the same language.
387
- * When using a language other than `en-*`, only `*-11labs` voices will pronounce the words correctly. There will also be ~1sec of additional latency.
328
+ * When using a language other than `en-*`, only `11labs` voices will pronounce the words correctly. There will also be ~1sec of additional latency.
388
329
  */
389
330
  language?:
390
331
  | "en"
@@ -402,45 +343,21 @@ export interface Assistant {
402
343
  | "pt-BR"
403
344
  | "es"
404
345
  | "es-419";
405
- /**
406
- * This is the name of the assistant. This is just for your own reference.
407
- * @maxLength 100
408
- */
409
- name?: string;
410
- /** This sets the objective and understanding for the assistant. */
411
- context?: string;
412
- /** These are the functions that the assistant can execute during the call. */
413
- functions?: OpenAIFunction[];
414
- /**
415
- * This is the URL Vapi will send GET / POST requests for retrieving context, function calling, and end-of-call reports.
416
- *
417
- * All requests will be sent with the `call` object among other things relevant to that callback. You can find more details in the Function Calling documentation.
418
- */
419
- callbackUrl?: string;
420
- /**
421
- * If you are using a custom LLM, this is the URL Vapi will use instead of hitting OpenAI.
422
- *
423
- * A POST request will be sent with an array of messages, and the response should be like so:
424
- *
425
- * ```
426
- * { message: "Oh hey! How are..." }
427
- * ```
428
- */
429
- customLlmUrl?: string;
430
346
  /** This is the number to forward to if assistant runs into issues. */
431
347
  forwardingPhoneNumber?: string;
432
348
  /**
433
349
  * This is the first message that the assistant will say.
434
350
  *
435
351
  * If unspecified, it will wait for the user to speak.
436
- * @maxLength 400
352
+ * @maxLength 1000
353
+ * @default "Hey there!"
437
354
  */
438
355
  firstMessage?: string;
439
356
  /**
440
357
  * This is the message that the assistant will say if the call is forwarded to voicemail.
441
358
  *
442
359
  * If unspecified, it will hang up.
443
- * @maxLength 400
360
+ * @maxLength 1000
444
361
  */
445
362
  voicemailMessage?: string;
446
363
  /**
@@ -458,8 +375,6 @@ export interface Assistant {
458
375
  endCallFunctionEnabled?: boolean;
459
376
  /** This sets whether the assistant will use fillers like Well..., Okay cool..., etc. Defaults to true when using gpt-4. Else, defaults to false. */
460
377
  fillersEnabled?: boolean;
461
- /** These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here. */
462
- keywords?: string[];
463
378
  /** This is the unique identifier for the assistant. */
464
379
  id: string;
465
380
  /** This is the unique identifier for the org that this assistant belongs to. */
@@ -477,14 +392,18 @@ export interface Assistant {
477
392
  }
478
393
 
479
394
  export interface UpdateAssistantDTO {
480
- /** This is the OpenAI model that will be used. */
481
- model?: "gpt-4" | "gpt-3.5-turbo";
482
395
  /**
483
- * This is the voice that will be used.
484
- *
485
- * Pro Voices: `*-11labs`, `*-playht`
486
- *
487
- * Basic Voices: `*-rimeai`
396
+ * This is the name of the assistant. This is just for your own reference.
397
+ * @maxLength 100
398
+ */
399
+ name?: string;
400
+ /** These are the options for the assistant's transcriber. */
401
+ transcriber?: DeepgramTranscriber;
402
+ /** These are the options for the assistant's LLM. */
403
+ model?: "0" | "1" | "2" | OpenAIModel | CustomModel;
404
+ /**
405
+ * These are the options for the assistant's voice.
406
+ * @default "jennifer-playht"
488
407
  */
489
408
  voice?:
490
409
  | "jennifer-playht"
@@ -526,85 +445,335 @@ export interface UpdateAssistantDTO {
526
445
  | "stella-beta"
527
446
  | "artemis-beta"
528
447
  | "andromeda-beta"
529
- | "atlas-beta";
448
+ | "atlas-beta"
449
+ | ElevenLabsVoice
450
+ | PlayHTVoice
451
+ | RimeAIVoice
452
+ | BetaVoice;
530
453
  /**
531
454
  * This sets the spoken language of the user. The assistant will do its best to respond in the same language.
532
- * When using a language other than `en-*`, only `*-11labs` voices will pronounce the words correctly. There will also be ~1sec of additional latency.
455
+ * When using a language other than `en-*`, only `11labs` voices will pronounce the words correctly. There will also be ~1sec of additional latency.
456
+ */
457
+ language?:
458
+ | "en"
459
+ | "en-US"
460
+ | "en-AU"
461
+ | "en-GB"
462
+ | "en-NZ"
463
+ | "en-IN"
464
+ | "fr"
465
+ | "fr-CA"
466
+ | "de"
467
+ | "hi"
468
+ | "hi-Latn"
469
+ | "pt"
470
+ | "pt-BR"
471
+ | "es"
472
+ | "es-419";
473
+ /** This is the number to forward to if assistant runs into issues. */
474
+ forwardingPhoneNumber?: string;
475
+ /**
476
+ * This is the first message that the assistant will say.
477
+ *
478
+ * If unspecified, it will wait for the user to speak.
479
+ * @maxLength 1000
480
+ * @default "Hey there!"
481
+ */
482
+ firstMessage?: string;
483
+ /**
484
+ * This is the message that the assistant will say if the call is forwarded to voicemail.
485
+ *
486
+ * If unspecified, it will hang up.
487
+ * @maxLength 1000
488
+ */
489
+ voicemailMessage?: string;
490
+ /**
491
+ * This is the message that the assistant will say if it ends the call.
492
+ *
493
+ * If unspecified, it will hang up without saying anything.
494
+ * @maxLength 400
495
+ */
496
+ endCallMessage?: string;
497
+ /** This sets whether the user can interrupt the assistant while it's speaking. Defaults to true. */
498
+ interruptionsEnabled?: boolean;
499
+ /** This sets whether the assistant's calls are recorded. Defaults to true. */
500
+ recordingEnabled?: boolean;
501
+ /** This sets whether the assistant will be able to hang up the call. Defaults to false. */
502
+ endCallFunctionEnabled?: boolean;
503
+ /** This sets whether the assistant will use fillers like Well..., Okay cool..., etc. Defaults to true when using gpt-4. Else, defaults to false. */
504
+ fillersEnabled?: boolean;
505
+ }
506
+
507
+ export interface CreateCustomerDTO {
508
+ /** This is the number of the customer. */
509
+ number?: string;
510
+ /**
511
+ * This is the name of the customer. This is just for your own reference.
512
+ * @maxLength 40
513
+ */
514
+ name?: string;
515
+ }
516
+
517
+ export interface ImportTwilioPhoneNumberDTO {
518
+ /** These are the digits of the phone number you own on your Twilio. */
519
+ twilioPhoneNumber: string;
520
+ /** This is your Twilio Account SID that will be used to handle this phone number. */
521
+ twilioAccountSid: string;
522
+ /** This is the Twilio Auth Token that will be used to handle this phone number. */
523
+ twilioAuthToken: string;
524
+ /**
525
+ * This is the name of the phone number. This is just for your own reference.
526
+ * @maxLength 40
527
+ */
528
+ name?: string;
529
+ /**
530
+ * This is the assistant that will be used for incoming calls to this phone number.
531
+ *
532
+ * If this is not set, then the phone number will not handle incoming calls.
533
+ */
534
+ assistantId?: string;
535
+ }
536
+
537
+ export interface Call {
538
+ /** This is the type of call. */
539
+ type?: "inboundPhoneCall" | "outboundPhoneCall" | "webCall";
540
+ /** This is the status of the call. */
541
+ status?: "queued" | "ringing" | "in-progress" | "forwarding" | "ended";
542
+ /** This is the explanation for how the call ended. */
543
+ endedReason?:
544
+ | "assistant-ended-call"
545
+ | "assistant-error"
546
+ | "assistant-forwarded-call"
547
+ | "assistant-join-timed-out"
548
+ | "assistant-not-found"
549
+ | "manually-canceled"
550
+ | "customer-busy"
551
+ | "customer-ended-call"
552
+ | "customer-did-not-answer"
553
+ | "db-error"
554
+ | "exceeded-max-duration"
555
+ | "no-server-available"
556
+ | "server-shutdown"
557
+ | "silence-timed-out"
558
+ | "twilio-failed-to-connect-call"
559
+ | "twilio-closed-websocket"
560
+ | "unknown-error"
561
+ | "voicemail";
562
+ /** This is the unique identifier for the call. */
563
+ id: string;
564
+ /** This is the unique identifier for the org that this call belongs to. */
565
+ orgId: string;
566
+ /**
567
+ * This is the ISO 8601 date-time string of when the call was created.
568
+ * @format date-time
569
+ */
570
+ createdAt: string;
571
+ /**
572
+ * This is the ISO 8601 date-time string of when the call was last updated.
573
+ * @format date-time
574
+ */
575
+ updatedAt: string;
576
+ /**
577
+ * This is the ISO 8601 date-time string of when the call was started.
578
+ * @format date-time
579
+ */
580
+ startedAt?: string;
581
+ /**
582
+ * This is the ISO 8601 date-time string of when the call was ended.
583
+ * @format date-time
584
+ */
585
+ endedAt?: string;
586
+ /** This is the cost of the call in USD. */
587
+ cost?: number;
588
+ /** This is the transcript of the call. */
589
+ transcript?: string;
590
+ /** This is the URL of the recording of the call. */
591
+ recordingUrl?: string;
592
+ /** This is the summary of the call. */
593
+ summary?: string;
594
+ /**
595
+ * This is the callSid of the phone call.
596
+ *
597
+ * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
598
+ */
599
+ twilioCallSid?: string;
600
+ /**
601
+ * This is the URL of the call that the assistant will join.
602
+ *
603
+ * Only relevant for `webCall` type.
604
+ */
605
+ webCallUrl?: string;
606
+ /** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
607
+ assistantId?: string;
608
+ /** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
609
+ assistant?: CreateAssistantDTO;
610
+ /**
611
+ * This is the customer that will be called. To call a transient customer , use `customer` instead.
612
+ *
613
+ * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
533
614
  */
534
- language?:
535
- | "en"
536
- | "en-US"
537
- | "en-AU"
538
- | "en-GB"
539
- | "en-NZ"
540
- | "en-IN"
541
- | "fr"
542
- | "fr-CA"
543
- | "de"
544
- | "hi"
545
- | "hi-Latn"
546
- | "pt"
547
- | "pt-BR"
548
- | "es"
549
- | "es-419";
615
+ customerId?: string;
550
616
  /**
551
- * This is the name of the assistant. This is just for your own reference.
552
- * @maxLength 100
617
+ * This is the customer that will be called. To call an existing customer, use `customerId` instead.
618
+ *
619
+ * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
553
620
  */
554
- name?: string;
555
- /** This sets the objective and understanding for the assistant. */
556
- context?: string;
557
- /** These are the functions that the assistant can execute during the call. */
558
- functions?: OpenAIFunction[];
621
+ customer?: CreateCustomerDTO;
559
622
  /**
560
- * This is the URL Vapi will send GET / POST requests for retrieving context, function calling, and end-of-call reports.
623
+ * This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.
561
624
  *
562
- * All requests will be sent with the `call` object among other things relevant to that callback. You can find more details in the Function Calling documentation.
625
+ * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
563
626
  */
564
- callbackUrl?: string;
627
+ phoneNumberId?: string;
565
628
  /**
566
- * If you are using a custom LLM, this is the URL Vapi will use instead of hitting OpenAI.
629
+ * This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.
567
630
  *
568
- * A POST request will be sent with an array of messages, and the response should be like so:
631
+ * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
632
+ */
633
+ phoneNumber?: ImportTwilioPhoneNumberDTO;
634
+ }
635
+
636
+ export interface CreateOutboundCallDTO {
637
+ /** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
638
+ assistantId?: string;
639
+ /** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
640
+ assistant?: CreateAssistantDTO;
641
+ /**
642
+ * This is the customer that will be called. To call a transient customer , use `customer` instead.
569
643
  *
570
- * ```
571
- * { message: "Oh hey! How are..." }
572
- * ```
644
+ * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
573
645
  */
574
- customLlmUrl?: string;
575
- /** This is the number to forward to if assistant runs into issues. */
576
- forwardingPhoneNumber?: string;
646
+ customerId?: string;
577
647
  /**
578
- * This is the first message that the assistant will say.
648
+ * This is the customer that will be called. To call an existing customer, use `customerId` instead.
579
649
  *
580
- * If unspecified, it will wait for the user to speak.
581
- * @maxLength 400
650
+ * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
582
651
  */
583
- firstMessage?: string;
652
+ customer?: CreateCustomerDTO;
584
653
  /**
585
- * This is the message that the assistant will say if the call is forwarded to voicemail.
654
+ * This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.
586
655
  *
587
- * If unspecified, it will hang up.
588
- * @maxLength 400
656
+ * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
589
657
  */
590
- voicemailMessage?: string;
658
+ phoneNumberId?: string;
591
659
  /**
592
- * This is the message that the assistant will say if it ends the call.
660
+ * This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.
593
661
  *
594
- * If unspecified, it will hang up without saying anything.
595
- * @maxLength 400
662
+ * Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
596
663
  */
597
- endCallMessage?: string;
598
- /** This sets whether the user can interrupt the assistant while it's speaking. Defaults to true. */
599
- interruptionsEnabled?: boolean;
600
- /** This sets whether the assistant's calls are recorded. Defaults to true. */
601
- recordingEnabled?: boolean;
602
- /** This sets whether the assistant will be able to hang up the call. Defaults to false. */
603
- endCallFunctionEnabled?: boolean;
604
- /** This sets whether the assistant will use fillers like Well..., Okay cool..., etc. Defaults to true when using gpt-4. Else, defaults to false. */
605
- fillersEnabled?: boolean;
606
- /** These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here. */
607
- keywords?: string[];
664
+ phoneNumber?: ImportTwilioPhoneNumberDTO;
665
+ }
666
+
667
+ export interface CreateWebCallDTO {
668
+ /** This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. */
669
+ assistantId?: string;
670
+ /** This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. */
671
+ assistant?: CreateAssistantDTO;
672
+ }
673
+
674
+ export interface CreateTwilioCredentialDTO {
675
+ provider: "twilio";
676
+ /** This is hidden in the API responses. */
677
+ authToken: string;
678
+ accountSid: string;
679
+ }
680
+
681
+ export interface CreateDeepgramCredentialDTO {
682
+ provider: "deepgram";
683
+ /** This is hidden in the API responses. */
684
+ apiKey: string;
685
+ }
686
+
687
+ export interface CreateAzureCredentialDTO {
688
+ provider: "azure-openai";
689
+ /** This is hidden in the API responses. */
690
+ openAIKey: string;
691
+ openAIEndpoint: string;
692
+ }
693
+
694
+ export interface CreateElevenLabsCredentialDTO {
695
+ provider: "11labs";
696
+ /** This is hidden in the API responses. */
697
+ apiKey: string;
698
+ }
699
+
700
+ export interface CreatePlayHTCredentialDTO {
701
+ provider: "playht";
702
+ /** This is hidden in the API responses. */
703
+ apiKey: string;
704
+ userId: string;
705
+ }
706
+
707
+ export interface CreateRimeAICredentialDTO {
708
+ provider: "rimeai";
709
+ /** This is hidden in the API responses. */
710
+ apiKey: string;
711
+ }
712
+
713
+ export interface UpdateTwilioCredentialDTO {
714
+ provider: "twilio";
715
+ /** This is hidden in the API responses. */
716
+ authToken: string;
717
+ accountSid: string;
718
+ }
719
+
720
+ export interface UpdateDeepgramCredentialDTO {
721
+ provider: "deepgram";
722
+ /** This is hidden in the API responses. */
723
+ apiKey: string;
724
+ }
725
+
726
+ export interface UpdateAzureCredentialDTO {
727
+ provider: "azure-openai";
728
+ /** This is hidden in the API responses. */
729
+ openAIKey: string;
730
+ openAIEndpoint: string;
731
+ }
732
+
733
+ export interface UpdateElevenLabsCredentialDTO {
734
+ provider: "11labs";
735
+ /** This is hidden in the API responses. */
736
+ apiKey: string;
737
+ }
738
+
739
+ export interface UpdatePlayHTCredentialDTO {
740
+ provider: "playht";
741
+ /** This is hidden in the API responses. */
742
+ apiKey: string;
743
+ userId: string;
744
+ }
745
+
746
+ export interface UpdateRimeAICredentialDTO {
747
+ provider: "rimeai";
748
+ /** This is hidden in the API responses. */
749
+ apiKey: string;
750
+ }
751
+
752
+ export interface Credential {
753
+ /** This is hidden in the API responses. */
754
+ authToken?: string;
755
+ /** This is hidden in the API responses. */
756
+ apiKey?: string;
757
+ /** This is hidden in the API responses. */
758
+ openAIKey?: string;
759
+ provider: "twilio" | "deepgram" | "azure-openai" | "11labs" | "playht" | "rimeai";
760
+ /** This is the unique identifier for the credential. */
761
+ id: string;
762
+ /** This is the unique identifier for the org that this credential belongs to. */
763
+ orgId: string;
764
+ /**
765
+ * This is the ISO 8601 date-time string of when the credential was created.
766
+ * @format date-time
767
+ */
768
+ createdAt: string;
769
+ /**
770
+ * This is the ISO 8601 date-time string of when the assistant was last updated.
771
+ * @format date-time
772
+ */
773
+ updatedAt: string;
774
+ accountSid?: string;
775
+ openAIEndpoint?: string;
776
+ userId?: string;
608
777
  }
609
778
 
610
779
  export interface BuyPhoneNumberDTO {
@@ -911,6 +1080,101 @@ export class HttpClient<SecurityDataType = unknown> {
911
1080
  * API for building voice assistants
912
1081
  */
913
1082
  export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
1083
+ assistant = {
1084
+ /**
1085
+ * No description
1086
+ *
1087
+ * @tags Assistants
1088
+ * @name AssistantControllerCreate
1089
+ * @summary Create Assistant
1090
+ * @request POST:/assistant
1091
+ * @secure
1092
+ */
1093
+ assistantControllerCreate: (data: CreateAssistantDTO, params: RequestParams = {}) =>
1094
+ this.request<Assistant, any>({
1095
+ path: `/assistant`,
1096
+ method: "POST",
1097
+ body: data,
1098
+ secure: true,
1099
+ type: ContentType.Json,
1100
+ format: "json",
1101
+ ...params,
1102
+ }),
1103
+
1104
+ /**
1105
+ * No description
1106
+ *
1107
+ * @tags Assistants
1108
+ * @name AssistantControllerFindAll
1109
+ * @summary List Assistants
1110
+ * @request GET:/assistant
1111
+ * @secure
1112
+ */
1113
+ assistantControllerFindAll: (params: RequestParams = {}) =>
1114
+ this.request<Assistant[], any>({
1115
+ path: `/assistant`,
1116
+ method: "GET",
1117
+ secure: true,
1118
+ format: "json",
1119
+ ...params,
1120
+ }),
1121
+
1122
+ /**
1123
+ * No description
1124
+ *
1125
+ * @tags Assistants
1126
+ * @name AssistantControllerFindOne
1127
+ * @summary Get Assistant
1128
+ * @request GET:/assistant/{id}
1129
+ * @secure
1130
+ */
1131
+ assistantControllerFindOne: (id: string, params: RequestParams = {}) =>
1132
+ this.request<Assistant, any>({
1133
+ path: `/assistant/${id}`,
1134
+ method: "GET",
1135
+ secure: true,
1136
+ format: "json",
1137
+ ...params,
1138
+ }),
1139
+
1140
+ /**
1141
+ * No description
1142
+ *
1143
+ * @tags Assistants
1144
+ * @name AssistantControllerUpdate
1145
+ * @summary Update Assistant
1146
+ * @request PATCH:/assistant/{id}
1147
+ * @secure
1148
+ */
1149
+ assistantControllerUpdate: (id: string, data: UpdateAssistantDTO, params: RequestParams = {}) =>
1150
+ this.request<Assistant, any>({
1151
+ path: `/assistant/${id}`,
1152
+ method: "PATCH",
1153
+ body: data,
1154
+ secure: true,
1155
+ type: ContentType.Json,
1156
+ format: "json",
1157
+ ...params,
1158
+ }),
1159
+
1160
+ /**
1161
+ * No description
1162
+ *
1163
+ * @tags Assistants
1164
+ * @name AssistantControllerRemove
1165
+ * @summary Delete Assistant
1166
+ * @request DELETE:/assistant/{id}
1167
+ * @secure
1168
+ */
1169
+ assistantControllerRemove: (id: string, params: RequestParams = {}) =>
1170
+ this.request<Assistant, any>({
1171
+ path: `/assistant/${id}`,
1172
+ method: "DELETE",
1173
+ secure: true,
1174
+ format: "json",
1175
+ ...params,
1176
+ }),
1177
+ };
914
1178
  call = {
915
1179
  /**
916
1180
  * No description
@@ -988,19 +1252,40 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
988
1252
  ...params,
989
1253
  }),
990
1254
  };
991
- assistant = {
1255
+ credential = {
992
1256
  /**
993
1257
  * No description
994
1258
  *
995
- * @tags Assistants
996
- * @name AssistantControllerCreate
997
- * @summary Create Assistant
998
- * @request POST:/assistant
1259
+ * @tags Credentials
1260
+ * @name CredentialControllerCreate
1261
+ * @summary Create Credential
1262
+ * @request POST:/credential
999
1263
  * @secure
1000
1264
  */
1001
- assistantControllerCreate: (data: CreateAssistantDTO, params: RequestParams = {}) =>
1002
- this.request<Assistant, any>({
1003
- path: `/assistant`,
1265
+ credentialControllerCreate: (
1266
+ data:
1267
+ | ({
1268
+ provider: "twilio";
1269
+ } & CreateTwilioCredentialDTO)
1270
+ | ({
1271
+ provider: "deepgram";
1272
+ } & CreateDeepgramCredentialDTO)
1273
+ | ({
1274
+ provider: "azure-openai";
1275
+ } & CreateAzureCredentialDTO)
1276
+ | ({
1277
+ provider: "11labs";
1278
+ } & CreateElevenLabsCredentialDTO)
1279
+ | ({
1280
+ provider: "playht";
1281
+ } & CreatePlayHTCredentialDTO)
1282
+ | ({
1283
+ provider: "rimeai";
1284
+ } & CreateRimeAICredentialDTO),
1285
+ params: RequestParams = {},
1286
+ ) =>
1287
+ this.request<Credential, any>({
1288
+ path: `/credential`,
1004
1289
  method: "POST",
1005
1290
  body: data,
1006
1291
  secure: true,
@@ -1012,15 +1297,15 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1012
1297
  /**
1013
1298
  * No description
1014
1299
  *
1015
- * @tags Assistants
1016
- * @name AssistantControllerFindAll
1017
- * @summary List Assistants
1018
- * @request GET:/assistant
1300
+ * @tags Credentials
1301
+ * @name CredentialControllerFindAll
1302
+ * @summary List Credentials
1303
+ * @request GET:/credential
1019
1304
  * @secure
1020
1305
  */
1021
- assistantControllerFindAll: (params: RequestParams = {}) =>
1022
- this.request<Assistant[], any>({
1023
- path: `/assistant`,
1306
+ credentialControllerFindAll: (params: RequestParams = {}) =>
1307
+ this.request<Credential[], any>({
1308
+ path: `/credential`,
1024
1309
  method: "GET",
1025
1310
  secure: true,
1026
1311
  format: "json",
@@ -1030,15 +1315,15 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1030
1315
  /**
1031
1316
  * No description
1032
1317
  *
1033
- * @tags Assistants
1034
- * @name AssistantControllerFindOne
1035
- * @summary Get Assistant
1036
- * @request GET:/assistant/{id}
1318
+ * @tags Credentials
1319
+ * @name CredentialControllerFindOne
1320
+ * @summary Get Credential
1321
+ * @request GET:/credential/{id}
1037
1322
  * @secure
1038
1323
  */
1039
- assistantControllerFindOne: (id: string, params: RequestParams = {}) =>
1040
- this.request<Assistant, any>({
1041
- path: `/assistant/${id}`,
1324
+ credentialControllerFindOne: (id: string, params: RequestParams = {}) =>
1325
+ this.request<Credential, any>({
1326
+ path: `/credential/${id}`,
1042
1327
  method: "GET",
1043
1328
  secure: true,
1044
1329
  format: "json",
@@ -1048,16 +1333,38 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1048
1333
  /**
1049
1334
  * No description
1050
1335
  *
1051
- * @tags Assistants
1052
- * @name AssistantControllerUpdate
1053
- * @summary Update Assistant
1054
- * @request PATCH:/assistant/{id}
1336
+ * @tags Credentials
1337
+ * @name CredentialControllerUpdate
1338
+ * @summary Update Credential
1339
+ * @request PUT:/credential/{id}
1055
1340
  * @secure
1056
1341
  */
1057
- assistantControllerUpdate: (id: string, data: UpdateAssistantDTO, params: RequestParams = {}) =>
1058
- this.request<Assistant, any>({
1059
- path: `/assistant/${id}`,
1060
- method: "PATCH",
1342
+ credentialControllerUpdate: (
1343
+ id: string,
1344
+ data:
1345
+ | ({
1346
+ provider: "twilio";
1347
+ } & UpdateTwilioCredentialDTO)
1348
+ | ({
1349
+ provider: "deepgram";
1350
+ } & UpdateDeepgramCredentialDTO)
1351
+ | ({
1352
+ provider: "azure-openai";
1353
+ } & UpdateAzureCredentialDTO)
1354
+ | ({
1355
+ provider: "11labs";
1356
+ } & UpdateElevenLabsCredentialDTO)
1357
+ | ({
1358
+ provider: "playht";
1359
+ } & UpdatePlayHTCredentialDTO)
1360
+ | ({
1361
+ provider: "rimeai";
1362
+ } & UpdateRimeAICredentialDTO),
1363
+ params: RequestParams = {},
1364
+ ) =>
1365
+ this.request<Credential, any>({
1366
+ path: `/credential/${id}`,
1367
+ method: "PUT",
1061
1368
  body: data,
1062
1369
  secure: true,
1063
1370
  type: ContentType.Json,
@@ -1068,15 +1375,15 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1068
1375
  /**
1069
1376
  * No description
1070
1377
  *
1071
- * @tags Assistants
1072
- * @name AssistantControllerRemove
1073
- * @summary Delete Assistant
1074
- * @request DELETE:/assistant/{id}
1378
+ * @tags Credentials
1379
+ * @name CredentialControllerRemove
1380
+ * @summary Delete Credential
1381
+ * @request DELETE:/credential/{id}
1075
1382
  * @secure
1076
1383
  */
1077
- assistantControllerRemove: (id: string, params: RequestParams = {}) =>
1078
- this.request<Assistant, any>({
1079
- path: `/assistant/${id}`,
1384
+ credentialControllerRemove: (id: string, params: RequestParams = {}) =>
1385
+ this.request<Credential, any>({
1386
+ path: `/credential/${id}`,
1080
1387
  method: "DELETE",
1081
1388
  secure: true,
1082
1389
  format: "json",
@@ -1190,10 +1497,11 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
1190
1497
  * @secure
1191
1498
  */
1192
1499
  phoneNumberControllerRemove: (id: string, params: RequestParams = {}) =>
1193
- this.request<void, any>({
1500
+ this.request<PhoneNumber, any>({
1194
1501
  path: `/phone-number/${id}`,
1195
1502
  method: "DELETE",
1196
1503
  secure: true,
1504
+ format: "json",
1197
1505
  ...params,
1198
1506
  }),
1199
1507
  };