retell-sdk 6.0.1 → 6.1.1

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 (96) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/agent.d.mts +3222 -526
  10. package/resources/agent.d.mts.map +1 -1
  11. package/resources/agent.d.ts +3222 -526
  12. package/resources/agent.d.ts.map +1 -1
  13. package/resources/app.d.mts +122 -5
  14. package/resources/app.d.mts.map +1 -1
  15. package/resources/app.d.ts +122 -5
  16. package/resources/app.d.ts.map +1 -1
  17. package/resources/app.js +17 -1
  18. package/resources/app.js.map +1 -1
  19. package/resources/app.mjs +17 -1
  20. package/resources/app.mjs.map +1 -1
  21. package/resources/batch-call.d.mts +912 -13
  22. package/resources/batch-call.d.mts.map +1 -1
  23. package/resources/batch-call.d.ts +912 -13
  24. package/resources/batch-call.d.ts.map +1 -1
  25. package/resources/call.d.mts +7843 -3792
  26. package/resources/call.d.mts.map +1 -1
  27. package/resources/call.d.ts +7843 -3792
  28. package/resources/call.d.ts.map +1 -1
  29. package/resources/call.js +1 -1
  30. package/resources/call.mjs +1 -1
  31. package/resources/chat-agent.d.mts +3125 -453
  32. package/resources/chat-agent.d.mts.map +1 -1
  33. package/resources/chat-agent.d.ts +3125 -453
  34. package/resources/chat-agent.d.ts.map +1 -1
  35. package/resources/chat.d.mts +892 -26
  36. package/resources/chat.d.mts.map +1 -1
  37. package/resources/chat.d.ts +892 -26
  38. package/resources/chat.d.ts.map +1 -1
  39. package/resources/contact.d.mts +162 -20
  40. package/resources/contact.d.mts.map +1 -1
  41. package/resources/contact.d.ts +162 -20
  42. package/resources/contact.d.ts.map +1 -1
  43. package/resources/contact.js +98 -4
  44. package/resources/contact.js.map +1 -1
  45. package/resources/contact.mjs +98 -4
  46. package/resources/contact.mjs.map +1 -1
  47. package/resources/conversation-flow-component.d.mts +3282 -243
  48. package/resources/conversation-flow-component.d.mts.map +1 -1
  49. package/resources/conversation-flow-component.d.ts +3282 -243
  50. package/resources/conversation-flow-component.d.ts.map +1 -1
  51. package/resources/conversation-flow.d.mts +7347 -1269
  52. package/resources/conversation-flow.d.mts.map +1 -1
  53. package/resources/conversation-flow.d.ts +7347 -1269
  54. package/resources/conversation-flow.d.ts.map +1 -1
  55. package/resources/crm.d.mts +37 -5
  56. package/resources/crm.d.mts.map +1 -1
  57. package/resources/crm.d.ts +37 -5
  58. package/resources/crm.d.ts.map +1 -1
  59. package/resources/identity.d.mts +4 -0
  60. package/resources/identity.d.mts.map +1 -1
  61. package/resources/identity.d.ts +4 -0
  62. package/resources/identity.d.ts.map +1 -1
  63. package/resources/index.d.mts +1 -1
  64. package/resources/index.d.mts.map +1 -1
  65. package/resources/index.d.ts +1 -1
  66. package/resources/index.d.ts.map +1 -1
  67. package/resources/index.js.map +1 -1
  68. package/resources/index.mjs.map +1 -1
  69. package/resources/llm.d.mts +867 -9
  70. package/resources/llm.d.mts.map +1 -1
  71. package/resources/llm.d.ts +867 -9
  72. package/resources/llm.d.ts.map +1 -1
  73. package/resources/tests.d.mts +3 -3
  74. package/resources/tests.d.mts.map +1 -1
  75. package/resources/tests.d.ts +3 -3
  76. package/resources/tests.d.ts.map +1 -1
  77. package/src/client.ts +4 -0
  78. package/src/resources/agent.ts +4786 -1504
  79. package/src/resources/app.ts +144 -4
  80. package/src/resources/batch-call.ts +1115 -10
  81. package/src/resources/call.ts +9825 -4806
  82. package/src/resources/chat-agent.ts +3958 -698
  83. package/src/resources/chat.ts +1133 -50
  84. package/src/resources/contact.ts +168 -20
  85. package/src/resources/conversation-flow-component.ts +4466 -191
  86. package/src/resources/conversation-flow.ts +9084 -525
  87. package/src/resources/crm.ts +44 -5
  88. package/src/resources/identity.ts +5 -0
  89. package/src/resources/index.ts +2 -0
  90. package/src/resources/llm.ts +1045 -46
  91. package/src/resources/tests.ts +21 -0
  92. package/src/version.ts +1 -1
  93. package/version.d.mts +1 -1
  94. package/version.d.ts +1 -1
  95. package/version.js +1 -1
  96. package/version.mjs +1 -1
@@ -172,6 +172,19 @@ export interface ChatResponse {
172
172
  * can later get this field from the chat object.
173
173
  */
174
174
  metadata?: unknown;
175
+ /**
176
+ * Tool call invocations and results of integration tools run after post-chat
177
+ * analysis (post-session). Stored separately from the main transcript. Available
178
+ * after chat ends if post-session integration tools ran.
179
+ */
180
+ post_session_message_with_tool_calls?: Array<ChatResponse.MessageBase | ChatResponse.ToolCallInvocationMessageBase | ChatResponse.ToolCallResultMessageBase | ChatResponse.NodeTransitionMessageBase | ChatResponse.StateTransitionMessageBase | ChatResponse.InjectedMessageBase | ChatResponse.SMSMessageBase>;
181
+ /**
182
+ * Tool call invocations and results of integration tools run before the chat's
183
+ * first message (pre-session). Stored separately from the main transcript.
184
+ * Available once pre-session integration tools have run (from the chat's first
185
+ * turn).
186
+ */
187
+ pre_session_message_with_tool_calls?: Array<ChatResponse.MessageBase | ChatResponse.ToolCallInvocationMessageBase | ChatResponse.ToolCallResultMessageBase | ChatResponse.NodeTransitionMessageBase | ChatResponse.StateTransitionMessageBase | ChatResponse.InjectedMessageBase | ChatResponse.SMSMessageBase>;
175
188
  /**
176
189
  * Add optional dynamic variables in key value pairs of string that injects into
177
190
  * your Response Engine prompt and tool description. Only applicable for Response
@@ -180,6 +193,18 @@ export interface ChatResponse {
180
193
  retell_llm_dynamic_variables?: {
181
194
  [key: string]: string;
182
195
  };
196
+ /**
197
+ * Post-session integration tool call invocations and results, without PII.
198
+ * Available after chat ends if post-session integration tools ran and PII
199
+ * scrubbing is enabled.
200
+ */
201
+ scrubbed_post_session_message_with_tool_calls?: Array<ChatResponse.MessageBase | ChatResponse.ToolCallInvocationMessageBase | ChatResponse.ToolCallResultMessageBase | ChatResponse.NodeTransitionMessageBase | ChatResponse.StateTransitionMessageBase | ChatResponse.InjectedMessageBase | ChatResponse.SMSMessageBase>;
202
+ /**
203
+ * Pre-session integration tool call invocations and results, without PII.
204
+ * Available after chat ends if pre-session integration tools ran and PII scrubbing
205
+ * is enabled.
206
+ */
207
+ scrubbed_pre_session_message_with_tool_calls?: Array<ChatResponse.MessageBase | ChatResponse.ToolCallInvocationMessageBase | ChatResponse.ToolCallResultMessageBase | ChatResponse.NodeTransitionMessageBase | ChatResponse.StateTransitionMessageBase | ChatResponse.InjectedMessageBase | ChatResponse.SMSMessageBase>;
183
208
  /**
184
209
  * Begin timestamp (milliseconds since epoch) of the chat. Available after chat
185
210
  * starts.
@@ -202,52 +227,888 @@ export declare namespace ChatResponse {
202
227
  */
203
228
  interface ChatAnalysis {
204
229
  /**
205
- * Whether the agent seems to have a successful chat with the user, where the agent
206
- * finishes the task, and the call was complete without being cutoff.
230
+ * Whether the agent seems to have a successful chat with the user, where the agent
231
+ * finishes the task, and the call was complete without being cutoff.
232
+ */
233
+ chat_successful?: boolean;
234
+ /**
235
+ * A high level summary of the chat.
236
+ */
237
+ chat_summary?: string;
238
+ /**
239
+ * Custom analysis data that was extracted based on the schema defined in chat
240
+ * agent post chat analysis data. Can be empty if nothing is specified.
241
+ */
242
+ custom_analysis_data?: unknown;
243
+ /**
244
+ * Sentiment of the user in the chat.
245
+ */
246
+ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
247
+ }
248
+ interface ChatCost {
249
+ /**
250
+ * Combined cost of all individual costs in cents
251
+ */
252
+ combined_cost?: number;
253
+ /**
254
+ * List of products with their unit prices and costs in cents
255
+ */
256
+ product_costs?: Array<ChatCost.ProductCost>;
257
+ }
258
+ namespace ChatCost {
259
+ interface ProductCost {
260
+ /**
261
+ * Cost for the product in cents for the duration of the call.
262
+ */
263
+ cost: number;
264
+ /**
265
+ * Product name that has a cost associated with it.
266
+ */
267
+ product: string;
268
+ /**
269
+ * True if this cost item is for a transfer segment.
270
+ */
271
+ is_transfer_leg_cost?: boolean;
272
+ /**
273
+ * Unit price of the product in cents per second.
274
+ */
275
+ unit_price?: number;
276
+ }
277
+ }
278
+ interface MessageBase {
279
+ /**
280
+ * Content of the message
281
+ */
282
+ content: string;
283
+ /**
284
+ * Documents whether this message is sent by agent or user.
285
+ */
286
+ role: 'agent' | 'user';
287
+ /**
288
+ * Create timestamp of the message
289
+ */
290
+ created_timestamp?: number;
291
+ /**
292
+ * Unique id of the message
293
+ */
294
+ message_id?: string;
295
+ /**
296
+ * Multimedia attachments received with this message (MMS). Display only; a textual
297
+ * summary of each attachment is already included in content. Response only —
298
+ * supplying it in a request has no effect and is silently ignored. Omitted from
299
+ * PII-scrubbed messages.
300
+ */
301
+ multimedia?: Array<MessageBase.Multimedia>;
302
+ }
303
+ namespace MessageBase {
304
+ interface Multimedia {
305
+ /**
306
+ * URL of the multimedia attachment.
307
+ */
308
+ url: string;
309
+ /**
310
+ * Optional textual summary of the attachment.
311
+ */
312
+ summary?: string;
313
+ }
314
+ }
315
+ interface ToolCallInvocationMessageBase {
316
+ /**
317
+ * Arguments for this tool call, it's a stringified JSON object.
318
+ */
319
+ arguments: string;
320
+ /**
321
+ * Name of the function in this tool call.
322
+ */
323
+ name: string;
324
+ /**
325
+ * This is a tool call invocation.
326
+ */
327
+ role: 'tool_call_invocation';
328
+ /**
329
+ * Tool call id, globally unique.
330
+ */
331
+ tool_call_id: string;
332
+ /**
333
+ * Create timestamp of the message
334
+ */
335
+ created_timestamp?: number;
336
+ /**
337
+ * Unique id of the message
338
+ */
339
+ message_id?: string;
340
+ /**
341
+ * Optional thought signature from Google Gemini thinking models. This is used
342
+ * internally to maintain reasoning chain in multi-turn function calling.
343
+ */
344
+ thought_signature?: string;
345
+ }
346
+ interface ToolCallResultMessageBase {
347
+ /**
348
+ * Result of the tool call, can be a string, a stringified json, etc.
349
+ */
350
+ content: string;
351
+ /**
352
+ * This is the result of a tool call.
353
+ */
354
+ role: 'tool_call_result';
355
+ /**
356
+ * Tool call id, globally unique.
357
+ */
358
+ tool_call_id: string;
359
+ /**
360
+ * Create timestamp of the message
361
+ */
362
+ created_timestamp?: number;
363
+ /**
364
+ * Unique id of the message
365
+ */
366
+ message_id?: string;
367
+ /**
368
+ * Whether the tool call was successful.
369
+ */
370
+ successful?: boolean;
371
+ }
372
+ interface NodeTransitionMessageBase {
373
+ /**
374
+ * This is a node transition.
375
+ */
376
+ role: 'node_transition';
377
+ /**
378
+ * Create timestamp of the message
379
+ */
380
+ created_timestamp?: number;
381
+ /**
382
+ * Former node id
383
+ */
384
+ former_node_id?: string;
385
+ /**
386
+ * Former node name
387
+ */
388
+ former_node_name?: string;
389
+ /**
390
+ * Unique id of the message
391
+ */
392
+ message_id?: string;
393
+ /**
394
+ * New node id
395
+ */
396
+ new_node_id?: string;
397
+ /**
398
+ * New node name
399
+ */
400
+ new_node_name?: string;
401
+ /**
402
+ * How this node was reached. "global" means a global node transition,
403
+ * "global_go_back" means returning from a global node, "interrupt_go_back" means
404
+ * going back due to user interruption, and "normal" means a regular edge
405
+ * transition.
406
+ */
407
+ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal';
408
+ }
409
+ interface StateTransitionMessageBase {
410
+ /**
411
+ * This is a state transition.
412
+ */
413
+ role: 'state_transition';
414
+ /**
415
+ * Create timestamp of the message
416
+ */
417
+ created_timestamp?: number;
418
+ /**
419
+ * Former state name
420
+ */
421
+ former_state_name?: string;
422
+ /**
423
+ * Unique id of the message
424
+ */
425
+ message_id?: string;
426
+ /**
427
+ * New state name
428
+ */
429
+ new_state_name?: string;
430
+ }
431
+ interface InjectedMessageBase {
432
+ /**
433
+ * The injected context text.
434
+ */
435
+ content: string;
436
+ /**
437
+ * External context injected into the conversation via the update-live-call API.
438
+ * Not spoken by either party.
439
+ */
440
+ role: 'injected';
441
+ /**
442
+ * Create timestamp of the message
443
+ */
444
+ created_timestamp?: number;
445
+ /**
446
+ * Unique id of the message
447
+ */
448
+ message_id?: string;
449
+ }
450
+ interface SMSMessageBase {
451
+ /**
452
+ * Text content of the SMS message.
453
+ */
454
+ content: string;
455
+ /**
456
+ * SMS message exchanged during the call (for example received from the user).
457
+ * Woven into the transcript and shown to the agent, but not part of the spoken
458
+ * conversation.
459
+ */
460
+ role: 'sms';
461
+ /**
462
+ * Create timestamp of the message
463
+ */
464
+ created_timestamp?: number;
465
+ /**
466
+ * Unique id of the message
467
+ */
468
+ message_id?: string;
469
+ /**
470
+ * Multimedia attachments (MMS). Display only; not relayed into the spoken
471
+ * conversation.
472
+ */
473
+ multimedia?: Array<SMSMessageBase.Multimedia>;
474
+ }
475
+ namespace SMSMessageBase {
476
+ interface Multimedia {
477
+ /**
478
+ * URL of the multimedia attachment.
479
+ */
480
+ url: string;
481
+ /**
482
+ * Optional textual summary of the attachment.
483
+ */
484
+ summary?: string;
485
+ }
486
+ }
487
+ interface MessageBase {
488
+ /**
489
+ * Content of the message
490
+ */
491
+ content: string;
492
+ /**
493
+ * Documents whether this message is sent by agent or user.
494
+ */
495
+ role: 'agent' | 'user';
496
+ /**
497
+ * Create timestamp of the message
498
+ */
499
+ created_timestamp?: number;
500
+ /**
501
+ * Unique id of the message
502
+ */
503
+ message_id?: string;
504
+ /**
505
+ * Multimedia attachments received with this message (MMS). Display only; a textual
506
+ * summary of each attachment is already included in content. Response only —
507
+ * supplying it in a request has no effect and is silently ignored. Omitted from
508
+ * PII-scrubbed messages.
509
+ */
510
+ multimedia?: Array<MessageBase.Multimedia>;
511
+ }
512
+ namespace MessageBase {
513
+ interface Multimedia {
514
+ /**
515
+ * URL of the multimedia attachment.
516
+ */
517
+ url: string;
518
+ /**
519
+ * Optional textual summary of the attachment.
520
+ */
521
+ summary?: string;
522
+ }
523
+ }
524
+ interface ToolCallInvocationMessageBase {
525
+ /**
526
+ * Arguments for this tool call, it's a stringified JSON object.
527
+ */
528
+ arguments: string;
529
+ /**
530
+ * Name of the function in this tool call.
531
+ */
532
+ name: string;
533
+ /**
534
+ * This is a tool call invocation.
535
+ */
536
+ role: 'tool_call_invocation';
537
+ /**
538
+ * Tool call id, globally unique.
539
+ */
540
+ tool_call_id: string;
541
+ /**
542
+ * Create timestamp of the message
543
+ */
544
+ created_timestamp?: number;
545
+ /**
546
+ * Unique id of the message
547
+ */
548
+ message_id?: string;
549
+ /**
550
+ * Optional thought signature from Google Gemini thinking models. This is used
551
+ * internally to maintain reasoning chain in multi-turn function calling.
552
+ */
553
+ thought_signature?: string;
554
+ }
555
+ interface ToolCallResultMessageBase {
556
+ /**
557
+ * Result of the tool call, can be a string, a stringified json, etc.
558
+ */
559
+ content: string;
560
+ /**
561
+ * This is the result of a tool call.
562
+ */
563
+ role: 'tool_call_result';
564
+ /**
565
+ * Tool call id, globally unique.
566
+ */
567
+ tool_call_id: string;
568
+ /**
569
+ * Create timestamp of the message
570
+ */
571
+ created_timestamp?: number;
572
+ /**
573
+ * Unique id of the message
574
+ */
575
+ message_id?: string;
576
+ /**
577
+ * Whether the tool call was successful.
578
+ */
579
+ successful?: boolean;
580
+ }
581
+ interface NodeTransitionMessageBase {
582
+ /**
583
+ * This is a node transition.
584
+ */
585
+ role: 'node_transition';
586
+ /**
587
+ * Create timestamp of the message
588
+ */
589
+ created_timestamp?: number;
590
+ /**
591
+ * Former node id
592
+ */
593
+ former_node_id?: string;
594
+ /**
595
+ * Former node name
596
+ */
597
+ former_node_name?: string;
598
+ /**
599
+ * Unique id of the message
600
+ */
601
+ message_id?: string;
602
+ /**
603
+ * New node id
604
+ */
605
+ new_node_id?: string;
606
+ /**
607
+ * New node name
608
+ */
609
+ new_node_name?: string;
610
+ /**
611
+ * How this node was reached. "global" means a global node transition,
612
+ * "global_go_back" means returning from a global node, "interrupt_go_back" means
613
+ * going back due to user interruption, and "normal" means a regular edge
614
+ * transition.
615
+ */
616
+ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal';
617
+ }
618
+ interface StateTransitionMessageBase {
619
+ /**
620
+ * This is a state transition.
621
+ */
622
+ role: 'state_transition';
623
+ /**
624
+ * Create timestamp of the message
625
+ */
626
+ created_timestamp?: number;
627
+ /**
628
+ * Former state name
629
+ */
630
+ former_state_name?: string;
631
+ /**
632
+ * Unique id of the message
633
+ */
634
+ message_id?: string;
635
+ /**
636
+ * New state name
637
+ */
638
+ new_state_name?: string;
639
+ }
640
+ interface InjectedMessageBase {
641
+ /**
642
+ * The injected context text.
643
+ */
644
+ content: string;
645
+ /**
646
+ * External context injected into the conversation via the update-live-call API.
647
+ * Not spoken by either party.
648
+ */
649
+ role: 'injected';
650
+ /**
651
+ * Create timestamp of the message
652
+ */
653
+ created_timestamp?: number;
654
+ /**
655
+ * Unique id of the message
656
+ */
657
+ message_id?: string;
658
+ }
659
+ interface SMSMessageBase {
660
+ /**
661
+ * Text content of the SMS message.
662
+ */
663
+ content: string;
664
+ /**
665
+ * SMS message exchanged during the call (for example received from the user).
666
+ * Woven into the transcript and shown to the agent, but not part of the spoken
667
+ * conversation.
668
+ */
669
+ role: 'sms';
670
+ /**
671
+ * Create timestamp of the message
672
+ */
673
+ created_timestamp?: number;
674
+ /**
675
+ * Unique id of the message
676
+ */
677
+ message_id?: string;
678
+ /**
679
+ * Multimedia attachments (MMS). Display only; not relayed into the spoken
680
+ * conversation.
681
+ */
682
+ multimedia?: Array<SMSMessageBase.Multimedia>;
683
+ }
684
+ namespace SMSMessageBase {
685
+ interface Multimedia {
686
+ /**
687
+ * URL of the multimedia attachment.
688
+ */
689
+ url: string;
690
+ /**
691
+ * Optional textual summary of the attachment.
692
+ */
693
+ summary?: string;
694
+ }
695
+ }
696
+ interface MessageBase {
697
+ /**
698
+ * Content of the message
699
+ */
700
+ content: string;
701
+ /**
702
+ * Documents whether this message is sent by agent or user.
703
+ */
704
+ role: 'agent' | 'user';
705
+ /**
706
+ * Create timestamp of the message
707
+ */
708
+ created_timestamp?: number;
709
+ /**
710
+ * Unique id of the message
711
+ */
712
+ message_id?: string;
713
+ /**
714
+ * Multimedia attachments received with this message (MMS). Display only; a textual
715
+ * summary of each attachment is already included in content. Response only —
716
+ * supplying it in a request has no effect and is silently ignored. Omitted from
717
+ * PII-scrubbed messages.
718
+ */
719
+ multimedia?: Array<MessageBase.Multimedia>;
720
+ }
721
+ namespace MessageBase {
722
+ interface Multimedia {
723
+ /**
724
+ * URL of the multimedia attachment.
725
+ */
726
+ url: string;
727
+ /**
728
+ * Optional textual summary of the attachment.
729
+ */
730
+ summary?: string;
731
+ }
732
+ }
733
+ interface ToolCallInvocationMessageBase {
734
+ /**
735
+ * Arguments for this tool call, it's a stringified JSON object.
736
+ */
737
+ arguments: string;
738
+ /**
739
+ * Name of the function in this tool call.
740
+ */
741
+ name: string;
742
+ /**
743
+ * This is a tool call invocation.
744
+ */
745
+ role: 'tool_call_invocation';
746
+ /**
747
+ * Tool call id, globally unique.
748
+ */
749
+ tool_call_id: string;
750
+ /**
751
+ * Create timestamp of the message
752
+ */
753
+ created_timestamp?: number;
754
+ /**
755
+ * Unique id of the message
756
+ */
757
+ message_id?: string;
758
+ /**
759
+ * Optional thought signature from Google Gemini thinking models. This is used
760
+ * internally to maintain reasoning chain in multi-turn function calling.
761
+ */
762
+ thought_signature?: string;
763
+ }
764
+ interface ToolCallResultMessageBase {
765
+ /**
766
+ * Result of the tool call, can be a string, a stringified json, etc.
767
+ */
768
+ content: string;
769
+ /**
770
+ * This is the result of a tool call.
771
+ */
772
+ role: 'tool_call_result';
773
+ /**
774
+ * Tool call id, globally unique.
775
+ */
776
+ tool_call_id: string;
777
+ /**
778
+ * Create timestamp of the message
779
+ */
780
+ created_timestamp?: number;
781
+ /**
782
+ * Unique id of the message
783
+ */
784
+ message_id?: string;
785
+ /**
786
+ * Whether the tool call was successful.
787
+ */
788
+ successful?: boolean;
789
+ }
790
+ interface NodeTransitionMessageBase {
791
+ /**
792
+ * This is a node transition.
793
+ */
794
+ role: 'node_transition';
795
+ /**
796
+ * Create timestamp of the message
797
+ */
798
+ created_timestamp?: number;
799
+ /**
800
+ * Former node id
801
+ */
802
+ former_node_id?: string;
803
+ /**
804
+ * Former node name
805
+ */
806
+ former_node_name?: string;
807
+ /**
808
+ * Unique id of the message
809
+ */
810
+ message_id?: string;
811
+ /**
812
+ * New node id
813
+ */
814
+ new_node_id?: string;
815
+ /**
816
+ * New node name
817
+ */
818
+ new_node_name?: string;
819
+ /**
820
+ * How this node was reached. "global" means a global node transition,
821
+ * "global_go_back" means returning from a global node, "interrupt_go_back" means
822
+ * going back due to user interruption, and "normal" means a regular edge
823
+ * transition.
824
+ */
825
+ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal';
826
+ }
827
+ interface StateTransitionMessageBase {
828
+ /**
829
+ * This is a state transition.
830
+ */
831
+ role: 'state_transition';
832
+ /**
833
+ * Create timestamp of the message
834
+ */
835
+ created_timestamp?: number;
836
+ /**
837
+ * Former state name
838
+ */
839
+ former_state_name?: string;
840
+ /**
841
+ * Unique id of the message
842
+ */
843
+ message_id?: string;
844
+ /**
845
+ * New state name
846
+ */
847
+ new_state_name?: string;
848
+ }
849
+ interface InjectedMessageBase {
850
+ /**
851
+ * The injected context text.
852
+ */
853
+ content: string;
854
+ /**
855
+ * External context injected into the conversation via the update-live-call API.
856
+ * Not spoken by either party.
857
+ */
858
+ role: 'injected';
859
+ /**
860
+ * Create timestamp of the message
861
+ */
862
+ created_timestamp?: number;
863
+ /**
864
+ * Unique id of the message
207
865
  */
208
- chat_successful?: boolean;
866
+ message_id?: string;
867
+ }
868
+ interface SMSMessageBase {
209
869
  /**
210
- * A high level summary of the chat.
870
+ * Text content of the SMS message.
211
871
  */
212
- chat_summary?: string;
872
+ content: string;
213
873
  /**
214
- * Custom analysis data that was extracted based on the schema defined in chat
215
- * agent post chat analysis data. Can be empty if nothing is specified.
874
+ * SMS message exchanged during the call (for example received from the user).
875
+ * Woven into the transcript and shown to the agent, but not part of the spoken
876
+ * conversation.
216
877
  */
217
- custom_analysis_data?: unknown;
878
+ role: 'sms';
218
879
  /**
219
- * Sentiment of the user in the chat.
880
+ * Create timestamp of the message
220
881
  */
221
- user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
882
+ created_timestamp?: number;
883
+ /**
884
+ * Unique id of the message
885
+ */
886
+ message_id?: string;
887
+ /**
888
+ * Multimedia attachments (MMS). Display only; not relayed into the spoken
889
+ * conversation.
890
+ */
891
+ multimedia?: Array<SMSMessageBase.Multimedia>;
222
892
  }
223
- interface ChatCost {
893
+ namespace SMSMessageBase {
894
+ interface Multimedia {
895
+ /**
896
+ * URL of the multimedia attachment.
897
+ */
898
+ url: string;
899
+ /**
900
+ * Optional textual summary of the attachment.
901
+ */
902
+ summary?: string;
903
+ }
904
+ }
905
+ interface MessageBase {
224
906
  /**
225
- * Combined cost of all individual costs in cents
907
+ * Content of the message
226
908
  */
227
- combined_cost?: number;
909
+ content: string;
228
910
  /**
229
- * List of products with their unit prices and costs in cents
911
+ * Documents whether this message is sent by agent or user.
230
912
  */
231
- product_costs?: Array<ChatCost.ProductCost>;
913
+ role: 'agent' | 'user';
914
+ /**
915
+ * Create timestamp of the message
916
+ */
917
+ created_timestamp?: number;
918
+ /**
919
+ * Unique id of the message
920
+ */
921
+ message_id?: string;
922
+ /**
923
+ * Multimedia attachments received with this message (MMS). Display only; a textual
924
+ * summary of each attachment is already included in content. Response only —
925
+ * supplying it in a request has no effect and is silently ignored. Omitted from
926
+ * PII-scrubbed messages.
927
+ */
928
+ multimedia?: Array<MessageBase.Multimedia>;
232
929
  }
233
- namespace ChatCost {
234
- interface ProductCost {
930
+ namespace MessageBase {
931
+ interface Multimedia {
235
932
  /**
236
- * Cost for the product in cents for the duration of the call.
933
+ * URL of the multimedia attachment.
237
934
  */
238
- cost: number;
935
+ url: string;
239
936
  /**
240
- * Product name that has a cost associated with it.
937
+ * Optional textual summary of the attachment.
241
938
  */
242
- product: string;
939
+ summary?: string;
940
+ }
941
+ }
942
+ interface ToolCallInvocationMessageBase {
943
+ /**
944
+ * Arguments for this tool call, it's a stringified JSON object.
945
+ */
946
+ arguments: string;
947
+ /**
948
+ * Name of the function in this tool call.
949
+ */
950
+ name: string;
951
+ /**
952
+ * This is a tool call invocation.
953
+ */
954
+ role: 'tool_call_invocation';
955
+ /**
956
+ * Tool call id, globally unique.
957
+ */
958
+ tool_call_id: string;
959
+ /**
960
+ * Create timestamp of the message
961
+ */
962
+ created_timestamp?: number;
963
+ /**
964
+ * Unique id of the message
965
+ */
966
+ message_id?: string;
967
+ /**
968
+ * Optional thought signature from Google Gemini thinking models. This is used
969
+ * internally to maintain reasoning chain in multi-turn function calling.
970
+ */
971
+ thought_signature?: string;
972
+ }
973
+ interface ToolCallResultMessageBase {
974
+ /**
975
+ * Result of the tool call, can be a string, a stringified json, etc.
976
+ */
977
+ content: string;
978
+ /**
979
+ * This is the result of a tool call.
980
+ */
981
+ role: 'tool_call_result';
982
+ /**
983
+ * Tool call id, globally unique.
984
+ */
985
+ tool_call_id: string;
986
+ /**
987
+ * Create timestamp of the message
988
+ */
989
+ created_timestamp?: number;
990
+ /**
991
+ * Unique id of the message
992
+ */
993
+ message_id?: string;
994
+ /**
995
+ * Whether the tool call was successful.
996
+ */
997
+ successful?: boolean;
998
+ }
999
+ interface NodeTransitionMessageBase {
1000
+ /**
1001
+ * This is a node transition.
1002
+ */
1003
+ role: 'node_transition';
1004
+ /**
1005
+ * Create timestamp of the message
1006
+ */
1007
+ created_timestamp?: number;
1008
+ /**
1009
+ * Former node id
1010
+ */
1011
+ former_node_id?: string;
1012
+ /**
1013
+ * Former node name
1014
+ */
1015
+ former_node_name?: string;
1016
+ /**
1017
+ * Unique id of the message
1018
+ */
1019
+ message_id?: string;
1020
+ /**
1021
+ * New node id
1022
+ */
1023
+ new_node_id?: string;
1024
+ /**
1025
+ * New node name
1026
+ */
1027
+ new_node_name?: string;
1028
+ /**
1029
+ * How this node was reached. "global" means a global node transition,
1030
+ * "global_go_back" means returning from a global node, "interrupt_go_back" means
1031
+ * going back due to user interruption, and "normal" means a regular edge
1032
+ * transition.
1033
+ */
1034
+ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal';
1035
+ }
1036
+ interface StateTransitionMessageBase {
1037
+ /**
1038
+ * This is a state transition.
1039
+ */
1040
+ role: 'state_transition';
1041
+ /**
1042
+ * Create timestamp of the message
1043
+ */
1044
+ created_timestamp?: number;
1045
+ /**
1046
+ * Former state name
1047
+ */
1048
+ former_state_name?: string;
1049
+ /**
1050
+ * Unique id of the message
1051
+ */
1052
+ message_id?: string;
1053
+ /**
1054
+ * New state name
1055
+ */
1056
+ new_state_name?: string;
1057
+ }
1058
+ interface InjectedMessageBase {
1059
+ /**
1060
+ * The injected context text.
1061
+ */
1062
+ content: string;
1063
+ /**
1064
+ * External context injected into the conversation via the update-live-call API.
1065
+ * Not spoken by either party.
1066
+ */
1067
+ role: 'injected';
1068
+ /**
1069
+ * Create timestamp of the message
1070
+ */
1071
+ created_timestamp?: number;
1072
+ /**
1073
+ * Unique id of the message
1074
+ */
1075
+ message_id?: string;
1076
+ }
1077
+ interface SMSMessageBase {
1078
+ /**
1079
+ * Text content of the SMS message.
1080
+ */
1081
+ content: string;
1082
+ /**
1083
+ * SMS message exchanged during the call (for example received from the user).
1084
+ * Woven into the transcript and shown to the agent, but not part of the spoken
1085
+ * conversation.
1086
+ */
1087
+ role: 'sms';
1088
+ /**
1089
+ * Create timestamp of the message
1090
+ */
1091
+ created_timestamp?: number;
1092
+ /**
1093
+ * Unique id of the message
1094
+ */
1095
+ message_id?: string;
1096
+ /**
1097
+ * Multimedia attachments (MMS). Display only; not relayed into the spoken
1098
+ * conversation.
1099
+ */
1100
+ multimedia?: Array<SMSMessageBase.Multimedia>;
1101
+ }
1102
+ namespace SMSMessageBase {
1103
+ interface Multimedia {
243
1104
  /**
244
- * True if this cost item is for a transfer segment.
1105
+ * URL of the multimedia attachment.
245
1106
  */
246
- is_transfer_leg_cost?: boolean;
1107
+ url: string;
247
1108
  /**
248
- * Unit price of the product in cents per second.
1109
+ * Optional textual summary of the attachment.
249
1110
  */
250
- unit_price?: number;
1111
+ summary?: string;
251
1112
  }
252
1113
  }
253
1114
  interface MessageBase {
@@ -1114,7 +1975,7 @@ export declare namespace ChatListParams {
1114
1975
  */
1115
1976
  op: 'in';
1116
1977
  type: 'enum';
1117
- value: Array<'user_hangup' | 'agent_hangup' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_concurrency_fallback' | 'no_valid_payment' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped' | 'call_take_over'>;
1978
+ value: Array<'user_hangup' | 'agent_hangup' | 'user_requested_dnc' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_concurrency_fallback' | 'no_valid_payment' | 'credit_exhausted' | 'budget_reached' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'network_blocked' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped' | 'call_take_over'>;
1118
1979
  }
1119
1980
  interface NumberFilter {
1120
1981
  /**
@@ -1217,6 +2078,11 @@ export interface ChatCreateSMSChatParams {
1217
2078
  * The phone number to send SMS to in E.164 format
1218
2079
  */
1219
2080
  to_number: string;
2081
+ /**
2082
+ * If true, the chat is rejected with a 400 error when the contact for to_number is
2083
+ * marked do_not_call. If omitted, the default value is false.
2084
+ */
2085
+ honor_internal_dnc?: boolean;
1220
2086
  /**
1221
2087
  * An arbitrary object for storage purpose only. You can put anything here like
1222
2088
  * your internal customer id associated with the chat. Not used for processing. You