@gtmi/ramp-agent-client 0.0.1 → 0.0.2

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.
@@ -4,6 +4,11 @@ export type ClientOptions = {
4
4
  baseUrl: `${string}://${string}` | (string & {});
5
5
  };
6
6
 
7
+ export type ErrorResponse = {
8
+ error?: string;
9
+ details?: string;
10
+ };
11
+
7
12
  export type GetCountryConfigsData = {
8
13
  body?: never;
9
14
  path?: never;
@@ -17,18 +22,30 @@ export type GetCountryConfigsErrors = {
17
22
  */
18
23
  401: unknown;
19
24
  /**
20
- * Internal server error
25
+ * Failed to get country configs
21
26
  */
22
- 500: unknown;
27
+ 500: ErrorResponse;
23
28
  };
24
29
 
30
+ export type GetCountryConfigsError = GetCountryConfigsErrors[keyof GetCountryConfigsErrors];
31
+
25
32
  export type GetCountryConfigsResponses = {
26
33
  /**
27
34
  * Success
28
35
  */
29
- 200: unknown;
36
+ 200: {
37
+ /**
38
+ * Array of country configurations
39
+ */
40
+ configs: Array<{
41
+ [key: string]: unknown;
42
+ }>;
43
+ };
30
44
  };
31
45
 
46
+ export type GetCountryConfigsResponse =
47
+ GetCountryConfigsResponses[keyof GetCountryConfigsResponses];
48
+
32
49
  export type GetRecentlyActiveNumbersData = {
33
50
  body?: never;
34
51
  path?: never;
@@ -42,18 +59,31 @@ export type GetRecentlyActiveNumbersErrors = {
42
59
  */
43
60
  401: unknown;
44
61
  /**
45
- * Internal server error
62
+ * Failed to get active numbers
46
63
  */
47
- 500: unknown;
64
+ 500: ErrorResponse;
48
65
  };
49
66
 
67
+ export type GetRecentlyActiveNumbersError =
68
+ GetRecentlyActiveNumbersErrors[keyof GetRecentlyActiveNumbersErrors];
69
+
50
70
  export type GetRecentlyActiveNumbersResponses = {
51
71
  /**
52
72
  * Success
53
73
  */
54
- 200: unknown;
74
+ 200: {
75
+ /**
76
+ * Array of phone number activity objects
77
+ */
78
+ numbers: Array<{
79
+ [key: string]: unknown;
80
+ }>;
81
+ };
55
82
  };
56
83
 
84
+ export type GetRecentlyActiveNumbersResponse =
85
+ GetRecentlyActiveNumbersResponses[keyof GetRecentlyActiveNumbersResponses];
86
+
57
87
  export type GetStatsData = {
58
88
  body?: never;
59
89
  path?: never;
@@ -67,18 +97,31 @@ export type GetStatsErrors = {
67
97
  */
68
98
  401: unknown;
69
99
  /**
70
- * Internal server error
100
+ * Failed to get stats
71
101
  */
72
- 500: unknown;
102
+ 500: ErrorResponse;
73
103
  };
74
104
 
105
+ export type GetStatsError = GetStatsErrors[keyof GetStatsErrors];
106
+
75
107
  export type GetStatsResponses = {
76
108
  /**
77
109
  * Success
78
110
  */
79
- 200: unknown;
111
+ 200: {
112
+ /**
113
+ * Number of currently active conversations
114
+ */
115
+ activeCalls: number;
116
+ /**
117
+ * ISO 8601 timestamp of server deployment
118
+ */
119
+ deployedAt: string;
120
+ };
80
121
  };
81
122
 
123
+ export type GetStatsResponse = GetStatsResponses[keyof GetStatsResponses];
124
+
82
125
  export type GetPhoneLogsByPhoneNumberData = {
83
126
  body?: never;
84
127
  path: {
@@ -89,23 +132,58 @@ export type GetPhoneLogsByPhoneNumberData = {
89
132
  };
90
133
 
91
134
  export type GetPhoneLogsByPhoneNumberErrors = {
135
+ /**
136
+ * Phone number is required
137
+ */
138
+ 400: ErrorResponse;
92
139
  /**
93
140
  * Unauthorized — requires Bearer token
94
141
  */
95
142
  401: unknown;
96
143
  /**
97
- * Internal server error
144
+ * No call logs found for this phone number
98
145
  */
99
- 500: unknown;
146
+ 404: ErrorResponse;
147
+ /**
148
+ * Failed to retrieve call logs
149
+ */
150
+ 500: ErrorResponse;
100
151
  };
101
152
 
153
+ export type GetPhoneLogsByPhoneNumberError =
154
+ GetPhoneLogsByPhoneNumberErrors[keyof GetPhoneLogsByPhoneNumberErrors];
155
+
102
156
  export type GetPhoneLogsByPhoneNumberResponses = {
103
157
  /**
104
158
  * Success
105
159
  */
106
- 200: unknown;
160
+ 200: {
161
+ /**
162
+ * Always true on success
163
+ */
164
+ success: boolean;
165
+ /**
166
+ * The phone number queried
167
+ */
168
+ phoneNumber: string;
169
+ /**
170
+ * Array of call records
171
+ */
172
+ calls: Array<{
173
+ [key: string]: unknown;
174
+ }>;
175
+ /**
176
+ * Array of conversation log entries
177
+ */
178
+ logs: Array<{
179
+ [key: string]: unknown;
180
+ }>;
181
+ };
107
182
  };
108
183
 
184
+ export type GetPhoneLogsByPhoneNumberResponse =
185
+ GetPhoneLogsByPhoneNumberResponses[keyof GetPhoneLogsByPhoneNumberResponses];
186
+
109
187
  export type PostOutboundCallData = {
110
188
  body: {
111
189
  /**
@@ -123,23 +201,48 @@ export type PostOutboundCallData = {
123
201
  };
124
202
 
125
203
  export type PostOutboundCallErrors = {
204
+ /**
205
+ * Missing required parameters: to and from are required
206
+ */
207
+ 400: ErrorResponse;
126
208
  /**
127
209
  * Unauthorized — requires Bearer token
128
210
  */
129
211
  401: unknown;
130
212
  /**
131
- * Internal server error
213
+ * Failed to initiate outbound call
132
214
  */
133
- 500: unknown;
215
+ 500: ErrorResponse;
134
216
  };
135
217
 
218
+ export type PostOutboundCallError = PostOutboundCallErrors[keyof PostOutboundCallErrors];
219
+
136
220
  export type PostOutboundCallResponses = {
137
221
  /**
138
222
  * Success
139
223
  */
140
- 200: unknown;
224
+ 200: {
225
+ /**
226
+ * Always true on success
227
+ */
228
+ success: boolean;
229
+ /**
230
+ * Twilio call SID
231
+ */
232
+ callSid: string;
233
+ /**
234
+ * Initial call status
235
+ */
236
+ status: string;
237
+ /**
238
+ * Success message
239
+ */
240
+ message: string;
241
+ };
141
242
  };
142
243
 
244
+ export type PostOutboundCallResponse = PostOutboundCallResponses[keyof PostOutboundCallResponses];
245
+
143
246
  export type GetOutboundCallByCallSidData = {
144
247
  body?: never;
145
248
  path: {
@@ -150,23 +253,62 @@ export type GetOutboundCallByCallSidData = {
150
253
  };
151
254
 
152
255
  export type GetOutboundCallByCallSidErrors = {
256
+ /**
257
+ * Call SID is required
258
+ */
259
+ 400: ErrorResponse;
153
260
  /**
154
261
  * Unauthorized — requires Bearer token
155
262
  */
156
263
  401: unknown;
157
264
  /**
158
- * Internal server error
265
+ * Failed to fetch call status
159
266
  */
160
- 500: unknown;
267
+ 500: ErrorResponse;
161
268
  };
162
269
 
270
+ export type GetOutboundCallByCallSidError =
271
+ GetOutboundCallByCallSidErrors[keyof GetOutboundCallByCallSidErrors];
272
+
163
273
  export type GetOutboundCallByCallSidResponses = {
164
274
  /**
165
275
  * Success
166
276
  */
167
- 200: unknown;
277
+ 200: {
278
+ /**
279
+ * The call SID
280
+ */
281
+ callSid: string;
282
+ /**
283
+ * Current call status
284
+ */
285
+ status: string;
286
+ /**
287
+ * Call duration in seconds (if completed)
288
+ */
289
+ duration: number;
290
+ /**
291
+ * Call start timestamp
292
+ */
293
+ startTime: string;
294
+ /**
295
+ * Call end timestamp (if completed)
296
+ */
297
+ endTime: string;
298
+ /**
299
+ * Caller phone number
300
+ */
301
+ from: string;
302
+ /**
303
+ * Called phone number
304
+ */
305
+ to: string;
306
+ };
168
307
  };
169
308
 
309
+ export type GetOutboundCallByCallSidResponse =
310
+ GetOutboundCallByCallSidResponses[keyof GetOutboundCallByCallSidResponses];
311
+
170
312
  export type PostOutboundCommunicationTextData = {
171
313
  body: {
172
314
  [key: string]: unknown;
@@ -177,23 +319,50 @@ export type PostOutboundCommunicationTextData = {
177
319
  };
178
320
 
179
321
  export type PostOutboundCommunicationTextErrors = {
322
+ /**
323
+ * Validation failure or failed to start conversation
324
+ */
325
+ 400: ErrorResponse;
180
326
  /**
181
327
  * Unauthorized — requires Bearer token
182
328
  */
183
329
  401: unknown;
184
330
  /**
185
- * Internal server error
331
+ * Error processing outbound communication
186
332
  */
187
- 500: unknown;
333
+ 500: ErrorResponse;
188
334
  };
189
335
 
336
+ export type PostOutboundCommunicationTextError =
337
+ PostOutboundCommunicationTextErrors[keyof PostOutboundCommunicationTextErrors];
338
+
190
339
  export type PostOutboundCommunicationTextResponses = {
191
340
  /**
192
341
  * Success
193
342
  */
194
- 200: unknown;
343
+ 200: {
344
+ /**
345
+ * Resolved channel the message was sent on
346
+ */
347
+ channel: string;
348
+ /**
349
+ * Normalized sender address
350
+ */
351
+ from: string;
352
+ /**
353
+ * The message content (or template reference) that was sent
354
+ */
355
+ outboundMessage: string;
356
+ /**
357
+ * Normalized recipient address
358
+ */
359
+ to: string;
360
+ };
195
361
  };
196
362
 
363
+ export type PostOutboundCommunicationTextResponse =
364
+ PostOutboundCommunicationTextResponses[keyof PostOutboundCommunicationTextResponses];
365
+
197
366
  export type PostExportLogsData = {
198
367
  body?: never;
199
368
  path?: never;
@@ -207,18 +376,45 @@ export type PostExportLogsErrors = {
207
376
  */
208
377
  401: unknown;
209
378
  /**
210
- * Internal server error
379
+ * Failed to export logs to Snowflake
211
380
  */
212
- 500: unknown;
381
+ 500: ErrorResponse;
213
382
  };
214
383
 
384
+ export type PostExportLogsError = PostExportLogsErrors[keyof PostExportLogsErrors];
385
+
215
386
  export type PostExportLogsResponses = {
216
387
  /**
217
388
  * Success
218
389
  */
219
- 200: unknown;
390
+ 200: {
391
+ /**
392
+ * Whether the export ran without a connection failure
393
+ */
394
+ success: boolean;
395
+ /**
396
+ * Number of rows exported
397
+ */
398
+ exported: number;
399
+ /**
400
+ * Number of rows that failed to export
401
+ */
402
+ failed: number;
403
+ /**
404
+ * Number of rows skipped
405
+ */
406
+ skipped: number;
407
+ /**
408
+ * Per-call export detail entries
409
+ */
410
+ details: Array<{
411
+ [key: string]: unknown;
412
+ }>;
413
+ };
220
414
  };
221
415
 
416
+ export type PostExportLogsResponse = PostExportLogsResponses[keyof PostExportLogsResponses];
417
+
222
418
  export type DeleteLiveNumbersData = {
223
419
  body?: never;
224
420
  path?: never;
@@ -232,18 +428,40 @@ export type DeleteLiveNumbersErrors = {
232
428
  */
233
429
  401: unknown;
234
430
  /**
235
- * Internal server error
431
+ * Failed to clear live conversations
236
432
  */
237
- 500: unknown;
433
+ 500: ErrorResponse;
238
434
  };
239
435
 
436
+ export type DeleteLiveNumbersError = DeleteLiveNumbersErrors[keyof DeleteLiveNumbersErrors];
437
+
240
438
  export type DeleteLiveNumbersResponses = {
241
439
  /**
242
440
  * Success
243
441
  */
244
- 200: unknown;
442
+ 200: {
443
+ /**
444
+ * Number of conversations cleared
445
+ */
446
+ clearedCount: number;
447
+ /**
448
+ * Phone numbers that were cleared
449
+ */
450
+ clearedNumbers: Array<string>;
451
+ /**
452
+ * Confirmation message with counts
453
+ */
454
+ message: string;
455
+ /**
456
+ * Call SIDs that were terminated
457
+ */
458
+ terminatedCalls: Array<string>;
459
+ };
245
460
  };
246
461
 
462
+ export type DeleteLiveNumbersResponse =
463
+ DeleteLiveNumbersResponses[keyof DeleteLiveNumbersResponses];
464
+
247
465
  export type GetLiveNumbersData = {
248
466
  body?: never;
249
467
  path?: never;
@@ -257,18 +475,33 @@ export type GetLiveNumbersErrors = {
257
475
  */
258
476
  401: unknown;
259
477
  /**
260
- * Internal server error
478
+ * Failed to get live numbers
261
479
  */
262
- 500: unknown;
480
+ 500: ErrorResponse;
263
481
  };
264
482
 
483
+ export type GetLiveNumbersError = GetLiveNumbersErrors[keyof GetLiveNumbersErrors];
484
+
265
485
  export type GetLiveNumbersResponses = {
266
486
  /**
267
487
  * Success
268
488
  */
269
- 200: unknown;
489
+ 200: {
490
+ /**
491
+ * Array of active conversation objects
492
+ */
493
+ liveNumbers: Array<{
494
+ [key: string]: unknown;
495
+ }>;
496
+ /**
497
+ * Total number of active conversations
498
+ */
499
+ count: number;
500
+ };
270
501
  };
271
502
 
503
+ export type GetLiveNumbersResponse = GetLiveNumbersResponses[keyof GetLiveNumbersResponses];
504
+
272
505
  export type DeleteLiveNumbersByPhoneNumberData = {
273
506
  body?: never;
274
507
  path: {
@@ -280,18 +513,45 @@ export type DeleteLiveNumbersByPhoneNumberData = {
280
513
 
281
514
  export type DeleteLiveNumbersByPhoneNumberErrors = {
282
515
  /**
283
- * Internal server error
516
+ * Phone number is required
284
517
  */
285
- 500: unknown;
518
+ 400: ErrorResponse;
519
+ /**
520
+ * Phone number not found in active conversations
521
+ */
522
+ 404: ErrorResponse;
523
+ /**
524
+ * Failed to clear specific conversation
525
+ */
526
+ 500: ErrorResponse;
286
527
  };
287
528
 
529
+ export type DeleteLiveNumbersByPhoneNumberError =
530
+ DeleteLiveNumbersByPhoneNumberErrors[keyof DeleteLiveNumbersByPhoneNumberErrors];
531
+
288
532
  export type DeleteLiveNumbersByPhoneNumberResponses = {
289
533
  /**
290
534
  * Success
291
535
  */
292
- 200: unknown;
536
+ 200: {
537
+ /**
538
+ * Confirmation message
539
+ */
540
+ message: string;
541
+ /**
542
+ * The cleared phone number
543
+ */
544
+ phoneNumber: string;
545
+ /**
546
+ * Call SID that was terminated, or null
547
+ */
548
+ terminatedCall: string;
549
+ };
293
550
  };
294
551
 
552
+ export type DeleteLiveNumbersByPhoneNumberResponse =
553
+ DeleteLiveNumbersByPhoneNumberResponses[keyof DeleteLiveNumbersByPhoneNumberResponses];
554
+
295
555
  export type DeleteKillConversationByPhoneNumberData = {
296
556
  body?: never;
297
557
  path: {
@@ -302,23 +562,56 @@ export type DeleteKillConversationByPhoneNumberData = {
302
562
  };
303
563
 
304
564
  export type DeleteKillConversationByPhoneNumberErrors = {
565
+ /**
566
+ * Phone number is required
567
+ */
568
+ 400: ErrorResponse;
305
569
  /**
306
570
  * Unauthorized — requires Bearer token
307
571
  */
308
572
  401: unknown;
309
573
  /**
310
- * Internal server error
574
+ * Failed to kill conversations
311
575
  */
312
- 500: unknown;
576
+ 500: ErrorResponse;
313
577
  };
314
578
 
579
+ export type DeleteKillConversationByPhoneNumberError =
580
+ DeleteKillConversationByPhoneNumberErrors[keyof DeleteKillConversationByPhoneNumberErrors];
581
+
315
582
  export type DeleteKillConversationByPhoneNumberResponses = {
316
583
  /**
317
584
  * Success
318
585
  */
319
- 200: unknown;
586
+ 200: {
587
+ /**
588
+ * Confirmation message including the phone number
589
+ */
590
+ message: string;
591
+ /**
592
+ * SIDs of conversations deleted
593
+ */
594
+ conversationsDeleted: Array<string>;
595
+ /**
596
+ * Conversation SIDs that failed to delete, with error
597
+ */
598
+ conversationsFailed: Array<{
599
+ [key: string]: unknown;
600
+ }>;
601
+ /**
602
+ * SID of the call terminated, or null
603
+ */
604
+ callTerminated: string;
605
+ /**
606
+ * Whether in-memory active details were cleared
607
+ */
608
+ activeConversationCleared: boolean;
609
+ };
320
610
  };
321
611
 
612
+ export type DeleteKillConversationByPhoneNumberResponse =
613
+ DeleteKillConversationByPhoneNumberResponses[keyof DeleteKillConversationByPhoneNumberResponses];
614
+
322
615
  export type PostSendEmailData = {
323
616
  body: {
324
617
  /**
@@ -340,23 +633,36 @@ export type PostSendEmailData = {
340
633
  };
341
634
 
342
635
  export type PostSendEmailErrors = {
636
+ /**
637
+ * Missing required fields: to, subject, text
638
+ */
639
+ 400: ErrorResponse;
343
640
  /**
344
641
  * Unauthorized — requires Bearer token
345
642
  */
346
643
  401: unknown;
347
644
  /**
348
- * Internal server error
645
+ * Email service not configured, or failed to send email
349
646
  */
350
- 500: unknown;
647
+ 500: ErrorResponse;
351
648
  };
352
649
 
650
+ export type PostSendEmailError = PostSendEmailErrors[keyof PostSendEmailErrors];
651
+
353
652
  export type PostSendEmailResponses = {
354
653
  /**
355
654
  * Success
356
655
  */
357
- 200: unknown;
656
+ 200: {
657
+ /**
658
+ * Always true on success
659
+ */
660
+ success: boolean;
661
+ };
358
662
  };
359
663
 
664
+ export type PostSendEmailResponse = PostSendEmailResponses[keyof PostSendEmailResponses];
665
+
360
666
  export type PostAddMessageData = {
361
667
  body: {
362
668
  /**
@@ -374,23 +680,44 @@ export type PostAddMessageData = {
374
680
  };
375
681
 
376
682
  export type PostAddMessageErrors = {
683
+ /**
684
+ * Missing required parameter "to" or "content"
685
+ */
686
+ 400: ErrorResponse;
377
687
  /**
378
688
  * Unauthorized — requires Bearer token
379
689
  */
380
690
  401: unknown;
691
+ /**
692
+ * No active conversation found for the provided number
693
+ */
694
+ 404: ErrorResponse;
381
695
  /**
382
696
  * Internal server error
383
697
  */
384
698
  500: unknown;
385
699
  };
386
700
 
701
+ export type PostAddMessageError = PostAddMessageErrors[keyof PostAddMessageErrors];
702
+
387
703
  export type PostAddMessageResponses = {
388
704
  /**
389
705
  * Success
390
706
  */
391
- 200: unknown;
707
+ 200: {
708
+ /**
709
+ * Confirmation message
710
+ */
711
+ message: string;
712
+ /**
713
+ * Always true on success
714
+ */
715
+ success: boolean;
716
+ };
392
717
  };
393
718
 
719
+ export type PostAddMessageResponse = PostAddMessageResponses[keyof PostAddMessageResponses];
720
+
394
721
  export type PostActiveConversationsAgentClaimData = {
395
722
  body: {
396
723
  [key: string]: unknown;
@@ -401,23 +728,42 @@ export type PostActiveConversationsAgentClaimData = {
401
728
  };
402
729
 
403
730
  export type PostActiveConversationsAgentClaimErrors = {
731
+ /**
732
+ * Missing required parameter "conversationId"
733
+ */
734
+ 400: ErrorResponse;
404
735
  /**
405
736
  * Unauthorized — requires Bearer token
406
737
  */
407
738
  401: unknown;
739
+ /**
740
+ * Conversation already claimed or not found
741
+ */
742
+ 409: ErrorResponse;
408
743
  /**
409
744
  * Internal server error
410
745
  */
411
746
  500: unknown;
412
747
  };
413
748
 
749
+ export type PostActiveConversationsAgentClaimError =
750
+ PostActiveConversationsAgentClaimErrors[keyof PostActiveConversationsAgentClaimErrors];
751
+
414
752
  export type PostActiveConversationsAgentClaimResponses = {
415
753
  /**
416
754
  * Success
417
755
  */
418
- 200: unknown;
756
+ 200: {
757
+ /**
758
+ * Always true once the conversation is claimed
759
+ */
760
+ success: boolean;
761
+ };
419
762
  };
420
763
 
764
+ export type PostActiveConversationsAgentClaimResponse =
765
+ PostActiveConversationsAgentClaimResponses[keyof PostActiveConversationsAgentClaimResponses];
766
+
421
767
  export type GetActiveConversationsAgentByAgentNumberData = {
422
768
  body?: never;
423
769
  path: {
@@ -432,19 +778,36 @@ export type GetActiveConversationsAgentByAgentNumberErrors = {
432
778
  * Unauthorized — requires Bearer token
433
779
  */
434
780
  401: unknown;
781
+ /**
782
+ * No unassigned campaign conversation found for agent
783
+ */
784
+ 404: ErrorResponse;
435
785
  /**
436
786
  * Internal server error
437
787
  */
438
788
  500: unknown;
439
789
  };
440
790
 
791
+ export type GetActiveConversationsAgentByAgentNumberError =
792
+ GetActiveConversationsAgentByAgentNumberErrors[keyof GetActiveConversationsAgentByAgentNumberErrors];
793
+
441
794
  export type GetActiveConversationsAgentByAgentNumberResponses = {
442
795
  /**
443
796
  * Success
444
797
  */
445
- 200: unknown;
798
+ 200: {
799
+ /**
800
+ * Conversation details for the agent to claim
801
+ */
802
+ activeConversation: {
803
+ [key: string]: unknown;
804
+ };
805
+ };
446
806
  };
447
807
 
808
+ export type GetActiveConversationsAgentByAgentNumberResponse =
809
+ GetActiveConversationsAgentByAgentNumberResponses[keyof GetActiveConversationsAgentByAgentNumberResponses];
810
+
448
811
  export type GetActiveConversationsByCustomerNumberData = {
449
812
  body?: never;
450
813
  path: {
@@ -459,19 +822,36 @@ export type GetActiveConversationsByCustomerNumberErrors = {
459
822
  * Unauthorized — requires Bearer token
460
823
  */
461
824
  401: unknown;
825
+ /**
826
+ * Conversation not found
827
+ */
828
+ 404: ErrorResponse;
462
829
  /**
463
830
  * Internal server error
464
831
  */
465
832
  500: unknown;
466
833
  };
467
834
 
835
+ export type GetActiveConversationsByCustomerNumberError =
836
+ GetActiveConversationsByCustomerNumberErrors[keyof GetActiveConversationsByCustomerNumberErrors];
837
+
468
838
  export type GetActiveConversationsByCustomerNumberResponses = {
469
839
  /**
470
840
  * Success
471
841
  */
472
- 200: unknown;
842
+ 200: {
843
+ /**
844
+ * Conversation details including realtime CINTEL data
845
+ */
846
+ activeConversation: {
847
+ [key: string]: unknown;
848
+ };
849
+ };
473
850
  };
474
851
 
852
+ export type GetActiveConversationsByCustomerNumberResponse =
853
+ GetActiveConversationsByCustomerNumberResponses[keyof GetActiveConversationsByCustomerNumberResponses];
854
+
475
855
  export type GetHealthData = {
476
856
  body?: never;
477
857
  path?: never;
@@ -490,9 +870,16 @@ export type GetHealthResponses = {
490
870
  /**
491
871
  * Success
492
872
  */
493
- 200: unknown;
873
+ 200: {
874
+ /**
875
+ * "ok"
876
+ */
877
+ status: string;
878
+ };
494
879
  };
495
880
 
881
+ export type GetHealthResponse = GetHealthResponses[keyof GetHealthResponses];
882
+
496
883
  export type PostCallData = {
497
884
  body: {
498
885
  [key: string]: unknown;
@@ -511,11 +898,13 @@ export type PostCallErrors = {
511
898
 
512
899
  export type PostCallResponses = {
513
900
  /**
514
- * Success
901
+ * TwiML XML response connecting the call to ConversationRelay (or a Say if setup failed)
515
902
  */
516
- 200: unknown;
903
+ 200: string;
517
904
  };
518
905
 
906
+ export type PostCallResponse = PostCallResponses[keyof PostCallResponses];
907
+
519
908
  export type PostLiveAgentData = {
520
909
  body: {
521
910
  /**
@@ -545,11 +934,13 @@ export type PostLiveAgentErrors = {
545
934
 
546
935
  export type PostLiveAgentResponses = {
547
936
  /**
548
- * Success
937
+ * TwiML XML response (Dial, Enqueue, or external Flex handoff) — TwiML
549
938
  */
550
- 200: unknown;
939
+ 200: string;
551
940
  };
552
941
 
942
+ export type PostLiveAgentResponse = PostLiveAgentResponses[keyof PostLiveAgentResponses];
943
+
553
944
  export type PostRedirectToLiveAgentData = {
554
945
  body: {
555
946
  [key: string]: unknown;
@@ -561,18 +952,41 @@ export type PostRedirectToLiveAgentData = {
561
952
 
562
953
  export type PostRedirectToLiveAgentErrors = {
563
954
  /**
564
- * Internal server error
955
+ * phoneNumber or callSid is required
565
956
  */
566
- 500: unknown;
957
+ 400: ErrorResponse;
958
+ /**
959
+ * active_call_not_found
960
+ */
961
+ 404: ErrorResponse;
962
+ /**
963
+ * missing_twilio_credentials or redirect_failed
964
+ */
965
+ 500: ErrorResponse;
567
966
  };
568
967
 
968
+ export type PostRedirectToLiveAgentError =
969
+ PostRedirectToLiveAgentErrors[keyof PostRedirectToLiveAgentErrors];
970
+
569
971
  export type PostRedirectToLiveAgentResponses = {
570
972
  /**
571
973
  * Success
572
974
  */
573
- 200: unknown;
975
+ 200: {
976
+ /**
977
+ * The call SID that was redirected
978
+ */
979
+ callSid: string;
980
+ /**
981
+ * Always true on success
982
+ */
983
+ success: boolean;
984
+ };
574
985
  };
575
986
 
987
+ export type PostRedirectToLiveAgentResponse =
988
+ PostRedirectToLiveAgentResponses[keyof PostRedirectToLiveAgentResponses];
989
+
576
990
  export type GetStressTestData = {
577
991
  body?: never;
578
992
  path?: never;
@@ -596,24 +1010,30 @@ export type GetStressTestErrors = {
596
1010
 
597
1011
  export type GetStressTestResponses = {
598
1012
  /**
599
- * Success
1013
+ * TwiML XML response with a Say/Gather/Redirect (or Hangup if the call closes) — TwiML
600
1014
  */
601
- 200: unknown;
1015
+ 200: string;
602
1016
  };
603
1017
 
1018
+ export type GetStressTestResponse = GetStressTestResponses[keyof GetStressTestResponses];
1019
+
604
1020
  export type PostStressTestSmsData = {
605
1021
  body: {
606
- [key: string]: unknown;
1022
+ /**
1023
+ * Sender phone number
1024
+ */
1025
+ From: string;
1026
+ /**
1027
+ * Recipient phone number (Twilio number)
1028
+ */
1029
+ To: string;
1030
+ /**
1031
+ * SMS message content
1032
+ */
1033
+ Body: string;
607
1034
  };
608
1035
  path?: never;
609
- query?: {
610
- From?: string;
611
- To?: string;
612
- CallSid?: string;
613
- SpeechResult?: string;
614
- Confidence?: string;
615
- CallStatus?: string;
616
- };
1036
+ query?: never;
617
1037
  url: '/stress-test-sms';
618
1038
  };
619
1039
 
@@ -626,11 +1046,14 @@ export type PostStressTestSmsErrors = {
626
1046
 
627
1047
  export type PostStressTestSmsResponses = {
628
1048
  /**
629
- * Success
1049
+ * TwiML XML response that reads the SMS body aloud, then gathers speech — TwiML
630
1050
  */
631
- 200: unknown;
1051
+ 200: string;
632
1052
  };
633
1053
 
1054
+ export type PostStressTestSmsResponse =
1055
+ PostStressTestSmsResponses[keyof PostStressTestSmsResponses];
1056
+
634
1057
  export type PostWebchatSendData = {
635
1058
  body: {
636
1059
  [key: string]: unknown;
@@ -642,18 +1065,47 @@ export type PostWebchatSendData = {
642
1065
 
643
1066
  export type PostWebchatSendErrors = {
644
1067
  /**
645
- * Internal server error
1068
+ * "identity is required" or "customerNumber is required"
646
1069
  */
647
- 500: unknown;
1070
+ 400: ErrorResponse;
1071
+ /**
1072
+ * Failed to retrieve template data, initialize conversation, or process webchat
1073
+ */
1074
+ 500: ErrorResponse;
648
1075
  };
649
1076
 
1077
+ export type PostWebchatSendError = PostWebchatSendErrors[keyof PostWebchatSendErrors];
1078
+
650
1079
  export type PostWebchatSendResponses = {
651
1080
  /**
652
1081
  * Success
653
1082
  */
654
- 200: unknown;
1083
+ 200: {
1084
+ /**
1085
+ * Resolved agent number for the session
1086
+ */
1087
+ agentNumber: string;
1088
+ /**
1089
+ * The conversation's ID
1090
+ */
1091
+ conversationId: string;
1092
+ /**
1093
+ * The webchat participant identity
1094
+ */
1095
+ identity: string;
1096
+ /**
1097
+ * The assistant's reply text
1098
+ */
1099
+ response: string;
1100
+ /**
1101
+ * Always "ok"
1102
+ */
1103
+ status: string;
1104
+ };
655
1105
  };
656
1106
 
1107
+ export type PostWebchatSendResponse = PostWebchatSendResponses[keyof PostWebchatSendResponses];
1108
+
657
1109
  export type PostCintelOperatorsData = {
658
1110
  body: {
659
1111
  [key: string]: unknown;
@@ -664,19 +1116,42 @@ export type PostCintelOperatorsData = {
664
1116
  };
665
1117
 
666
1118
  export type PostCintelOperatorsErrors = {
1119
+ /**
1120
+ * Missing required fields or invalid operator results
1121
+ */
1122
+ 400: ErrorResponse;
667
1123
  /**
668
1124
  * Internal server error
669
1125
  */
670
- 500: unknown;
1126
+ 500: {
1127
+ /**
1128
+ * Failed to process CINTEL operator response
1129
+ */
1130
+ error: string;
1131
+ /**
1132
+ * Underlying error message
1133
+ */
1134
+ message: string;
1135
+ };
671
1136
  };
672
1137
 
1138
+ export type PostCintelOperatorsError = PostCintelOperatorsErrors[keyof PostCintelOperatorsErrors];
1139
+
673
1140
  export type PostCintelOperatorsResponses = {
674
1141
  /**
675
1142
  * Success
676
1143
  */
677
- 200: unknown;
1144
+ 200: {
1145
+ /**
1146
+ * Always true on success
1147
+ */
1148
+ success: boolean;
1149
+ };
678
1150
  };
679
1151
 
1152
+ export type PostCintelOperatorsResponse =
1153
+ PostCintelOperatorsResponses[keyof PostCintelOperatorsResponses];
1154
+
680
1155
  export type PostFlexTranscriptionData = {
681
1156
  body: {
682
1157
  [key: string]: unknown;
@@ -695,11 +1170,14 @@ export type PostFlexTranscriptionErrors = {
695
1170
 
696
1171
  export type PostFlexTranscriptionResponses = {
697
1172
  /**
698
- * Success
1173
+ * "OK" (Express default sendStatus body, no JSON payload)
699
1174
  */
700
- 200: unknown;
1175
+ 200: string;
701
1176
  };
702
1177
 
1178
+ export type PostFlexTranscriptionResponse =
1179
+ PostFlexTranscriptionResponses[keyof PostFlexTranscriptionResponses];
1180
+
703
1181
  export type PostTaskrouterWebhookData = {
704
1182
  body: {
705
1183
  [key: string]: unknown;
@@ -718,11 +1196,14 @@ export type PostTaskrouterWebhookErrors = {
718
1196
 
719
1197
  export type PostTaskrouterWebhookResponses = {
720
1198
  /**
721
- * Success
1199
+ * "OK" (Express default sendStatus body, no JSON payload)
722
1200
  */
723
- 200: unknown;
1201
+ 200: string;
724
1202
  };
725
1203
 
1204
+ export type PostTaskrouterWebhookResponse =
1205
+ PostTaskrouterWebhookResponses[keyof PostTaskrouterWebhookResponses];
1206
+
726
1207
  export type PostResolvePhoneData = {
727
1208
  body: {
728
1209
  [key: string]: unknown;
@@ -764,11 +1245,14 @@ export type PostCommunicationTextErrors = {
764
1245
 
765
1246
  export type PostCommunicationTextResponses = {
766
1247
  /**
767
- * Success
1248
+ * TwiML XML response, optionally containing the LLM's reply message
768
1249
  */
769
- 200: unknown;
1250
+ 200: string;
770
1251
  };
771
1252
 
1253
+ export type PostCommunicationTextResponse =
1254
+ PostCommunicationTextResponses[keyof PostCommunicationTextResponses];
1255
+
772
1256
  export type GetDocsOpenapiJsonData = {
773
1257
  body?: never;
774
1258
  path?: never;
@@ -781,15 +1265,26 @@ export type GetDocsOpenapiJsonErrors = {
781
1265
  * Unauthorized — requires Bearer token
782
1266
  */
783
1267
  401: unknown;
1268
+ /**
1269
+ * OpenAPI spec not found
1270
+ */
1271
+ 404: ErrorResponse;
784
1272
  /**
785
1273
  * Internal server error
786
1274
  */
787
1275
  500: unknown;
788
1276
  };
789
1277
 
1278
+ export type GetDocsOpenapiJsonError = GetDocsOpenapiJsonErrors[keyof GetDocsOpenapiJsonErrors];
1279
+
790
1280
  export type GetDocsOpenapiJsonResponses = {
791
1281
  /**
792
- * Success
1282
+ * The OpenAPI 3.1 spec document
793
1283
  */
794
- 200: unknown;
1284
+ 200: {
1285
+ [key: string]: unknown;
1286
+ };
795
1287
  };
1288
+
1289
+ export type GetDocsOpenapiJsonResponse =
1290
+ GetDocsOpenapiJsonResponses[keyof GetDocsOpenapiJsonResponses];