@roarkanalytics/sdk 7.7.0 → 7.8.0

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.
@@ -0,0 +1,806 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { RequestOptions } from "../internal/request-options.mjs";
4
+ export declare class CustomerProfile extends APIResource {
5
+ /**
6
+ * Returns the people who have talked to your agents in this project. Customers we
7
+ * hold nothing about beyond their identifier are left out unless includeNoData is
8
+ * true.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const customerProfiles =
13
+ * await client.customerProfile.list();
14
+ * ```
15
+ */
16
+ list(query?: CustomerProfileListParams | null | undefined, options?: RequestOptions): APIPromise<CustomerProfileListResponse>;
17
+ /**
18
+ * Permanently removes the profile, its fields, evidence and notes. Conversations
19
+ * are kept. A new conversation from the same identifier creates a new profile.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const customerProfile = await client.customerProfile.delete(
24
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
25
+ * );
26
+ * ```
27
+ */
28
+ delete(customerProfileID: string, options?: RequestOptions): APIPromise<CustomerProfileDeleteResponse>;
29
+ /**
30
+ * Removes the value and any lock, so a later conversation can fill it again.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const response =
35
+ * await client.customerProfile.clearAttribute('FULL_NAME', {
36
+ * customerProfileId:
37
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
38
+ * });
39
+ * ```
40
+ */
41
+ clearAttribute(key: 'FULL_NAME' | 'PREFERRED_NAME' | 'ACCOUNT_ID' | 'COMPANY' | 'JOB_TITLE' | 'EMAIL' | 'ALTERNATE_PHONE' | 'AGE' | 'GENDER' | 'LANGUAGE' | 'LOCATION' | 'TIMEZONE' | 'BEST_TIME_TO_REACH' | 'PREFERRED_CHANNEL', params: CustomerProfileClearAttributeParams, options?: RequestOptions): APIPromise<CustomerProfileClearAttributeResponse>;
42
+ /**
43
+ * Get a customer profile
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const response = await client.customerProfile.getByID(
48
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
49
+ * );
50
+ * ```
51
+ */
52
+ getByID(customerProfileID: string, options?: RequestOptions): APIPromise<CustomerProfileGetByIDResponse>;
53
+ /**
54
+ * Calls and chats with this customer, newest first.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const response =
59
+ * await client.customerProfile.listConversations(
60
+ * 'customerProfileId',
61
+ * );
62
+ * ```
63
+ */
64
+ listConversations(customerProfileID: string, query?: CustomerProfileListConversationsParams | null | undefined, options?: RequestOptions): APIPromise<CustomerProfileListConversationsResponse>;
65
+ /**
66
+ * Sets the value and locks the field, so newer conversations cannot change it.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const response = await client.customerProfile.setAttribute(
71
+ * 'FULL_NAME',
72
+ * {
73
+ * customerProfileId:
74
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
75
+ * value: 'x',
76
+ * },
77
+ * );
78
+ * ```
79
+ */
80
+ setAttribute(key: 'FULL_NAME' | 'PREFERRED_NAME' | 'ACCOUNT_ID' | 'COMPANY' | 'JOB_TITLE' | 'EMAIL' | 'ALTERNATE_PHONE' | 'AGE' | 'GENDER' | 'LANGUAGE' | 'LOCATION' | 'TIMEZONE' | 'BEST_TIME_TO_REACH' | 'PREFERRED_CHANNEL', params: CustomerProfileSetAttributeParams, options?: RequestOptions): APIPromise<CustomerProfileSetAttributeResponse>;
81
+ /**
82
+ * Lets newer conversations change this field again. The current value stays until
83
+ * one does.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const response =
88
+ * await client.customerProfile.unlockAttribute(
89
+ * 'FULL_NAME',
90
+ * {
91
+ * customerProfileId:
92
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
93
+ * },
94
+ * );
95
+ * ```
96
+ */
97
+ unlockAttribute(key: 'FULL_NAME' | 'PREFERRED_NAME' | 'ACCOUNT_ID' | 'COMPANY' | 'JOB_TITLE' | 'EMAIL' | 'ALTERNATE_PHONE' | 'AGE' | 'GENDER' | 'LANGUAGE' | 'LOCATION' | 'TIMEZONE' | 'BEST_TIME_TO_REACH' | 'PREFERRED_CHANNEL', params: CustomerProfileUnlockAttributeParams, options?: RequestOptions): APIPromise<CustomerProfileUnlockAttributeResponse>;
98
+ /**
99
+ * Replaces your team's shared notes. Null or empty clears them. The last save
100
+ * wins.
101
+ *
102
+ * @example
103
+ * ```ts
104
+ * const response = await client.customerProfile.updateNotes(
105
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
106
+ * { notes: 'notes' },
107
+ * );
108
+ * ```
109
+ */
110
+ updateNotes(customerProfileID: string, body: CustomerProfileUpdateNotesParams, options?: RequestOptions): APIPromise<CustomerProfileUpdateNotesResponse>;
111
+ }
112
+ export interface CustomerProfileListResponse {
113
+ data: CustomerProfileListResponse.Data;
114
+ }
115
+ export declare namespace CustomerProfileListResponse {
116
+ interface Data {
117
+ items: Array<Data.Item>;
118
+ page: number;
119
+ totalCount: number;
120
+ }
121
+ namespace Data {
122
+ interface Item {
123
+ /**
124
+ * Unique identifier of the customer profile
125
+ */
126
+ id: string;
127
+ agentIds: Array<string>;
128
+ attributes: Array<Item.Attribute>;
129
+ chatCount: number;
130
+ conversationCount: number;
131
+ /**
132
+ * Null until a name is known, which is common
133
+ */
134
+ displayName: string | null;
135
+ externalId: string | null;
136
+ firstSeenAt: string | null;
137
+ lastSeenAt: string | null;
138
+ /**
139
+ * Your team's shared notes. Never sent to the agent.
140
+ */
141
+ notes: string | null;
142
+ notesUpdatedAt: string | null;
143
+ openItems: string | null;
144
+ phoneNumberE164: string | null;
145
+ summary: string | null;
146
+ /**
147
+ * Voice only. Chat time is not included.
148
+ */
149
+ talkTimeMs: number;
150
+ voiceCount: number;
151
+ }
152
+ namespace Item {
153
+ interface Attribute {
154
+ /**
155
+ * What a newer conversation said while this field was locked
156
+ */
157
+ blockedValue: string | null;
158
+ /**
159
+ * The moment the current value was heard. Null for a value set by a person or the
160
+ * API.
161
+ */
162
+ evidence: Attribute.Evidence | null;
163
+ /**
164
+ * Other values this field has held or been offered, newest first
165
+ */
166
+ history: Array<Attribute.History>;
167
+ /**
168
+ * True when newer conversations cannot change this field
169
+ */
170
+ isLocked: boolean;
171
+ key: 'FULL_NAME' | 'PREFERRED_NAME' | 'ACCOUNT_ID' | 'COMPANY' | 'JOB_TITLE' | 'EMAIL' | 'ALTERNATE_PHONE' | 'AGE' | 'GENDER' | 'LANGUAGE' | 'LOCATION' | 'TIMEZONE' | 'BEST_TIME_TO_REACH' | 'PREFERRED_CHANNEL';
172
+ observedAt: string;
173
+ /**
174
+ * Where the current value came from. LIVE and POST_CALL extraction are read from
175
+ * conversations.
176
+ */
177
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
178
+ value: string;
179
+ }
180
+ namespace Attribute {
181
+ /**
182
+ * The moment the current value was heard. Null for a value set by a person or the
183
+ * API.
184
+ */
185
+ interface Evidence {
186
+ callId: string | null;
187
+ chatId: string | null;
188
+ observedAt: string;
189
+ /**
190
+ * Where in the conversation this was said
191
+ */
192
+ offsetMs: number | null;
193
+ /**
194
+ * The customer's words. Null on a project with redaction on.
195
+ */
196
+ quote: string | null;
197
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
198
+ value: string;
199
+ }
200
+ interface History {
201
+ callId: string | null;
202
+ chatId: string | null;
203
+ observedAt: string;
204
+ /**
205
+ * Where in the conversation this was said
206
+ */
207
+ offsetMs: number | null;
208
+ /**
209
+ * The customer's words. Null on a project with redaction on.
210
+ */
211
+ quote: string | null;
212
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
213
+ value: string;
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ export interface CustomerProfileDeleteResponse {
220
+ data: CustomerProfileDeleteResponse.Data;
221
+ }
222
+ export declare namespace CustomerProfileDeleteResponse {
223
+ interface Data {
224
+ success: boolean;
225
+ }
226
+ }
227
+ export interface CustomerProfileClearAttributeResponse {
228
+ data: CustomerProfileClearAttributeResponse.Data;
229
+ }
230
+ export declare namespace CustomerProfileClearAttributeResponse {
231
+ interface Data {
232
+ /**
233
+ * Unique identifier of the customer profile
234
+ */
235
+ id: string;
236
+ agentIds: Array<string>;
237
+ attributes: Array<Data.Attribute>;
238
+ chatCount: number;
239
+ conversationCount: number;
240
+ /**
241
+ * Null until a name is known, which is common
242
+ */
243
+ displayName: string | null;
244
+ externalId: string | null;
245
+ firstSeenAt: string | null;
246
+ lastSeenAt: string | null;
247
+ /**
248
+ * Your team's shared notes. Never sent to the agent.
249
+ */
250
+ notes: string | null;
251
+ notesUpdatedAt: string | null;
252
+ openItems: string | null;
253
+ phoneNumberE164: string | null;
254
+ summary: string | null;
255
+ /**
256
+ * Voice only. Chat time is not included.
257
+ */
258
+ talkTimeMs: number;
259
+ voiceCount: number;
260
+ }
261
+ namespace Data {
262
+ interface Attribute {
263
+ /**
264
+ * What a newer conversation said while this field was locked
265
+ */
266
+ blockedValue: string | null;
267
+ /**
268
+ * The moment the current value was heard. Null for a value set by a person or the
269
+ * API.
270
+ */
271
+ evidence: Attribute.Evidence | null;
272
+ /**
273
+ * Other values this field has held or been offered, newest first
274
+ */
275
+ history: Array<Attribute.History>;
276
+ /**
277
+ * True when newer conversations cannot change this field
278
+ */
279
+ isLocked: boolean;
280
+ key: 'FULL_NAME' | 'PREFERRED_NAME' | 'ACCOUNT_ID' | 'COMPANY' | 'JOB_TITLE' | 'EMAIL' | 'ALTERNATE_PHONE' | 'AGE' | 'GENDER' | 'LANGUAGE' | 'LOCATION' | 'TIMEZONE' | 'BEST_TIME_TO_REACH' | 'PREFERRED_CHANNEL';
281
+ observedAt: string;
282
+ /**
283
+ * Where the current value came from. LIVE and POST_CALL extraction are read from
284
+ * conversations.
285
+ */
286
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
287
+ value: string;
288
+ }
289
+ namespace Attribute {
290
+ /**
291
+ * The moment the current value was heard. Null for a value set by a person or the
292
+ * API.
293
+ */
294
+ interface Evidence {
295
+ callId: string | null;
296
+ chatId: string | null;
297
+ observedAt: string;
298
+ /**
299
+ * Where in the conversation this was said
300
+ */
301
+ offsetMs: number | null;
302
+ /**
303
+ * The customer's words. Null on a project with redaction on.
304
+ */
305
+ quote: string | null;
306
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
307
+ value: string;
308
+ }
309
+ interface History {
310
+ callId: string | null;
311
+ chatId: string | null;
312
+ observedAt: string;
313
+ /**
314
+ * Where in the conversation this was said
315
+ */
316
+ offsetMs: number | null;
317
+ /**
318
+ * The customer's words. Null on a project with redaction on.
319
+ */
320
+ quote: string | null;
321
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
322
+ value: string;
323
+ }
324
+ }
325
+ }
326
+ }
327
+ export interface CustomerProfileGetByIDResponse {
328
+ data: CustomerProfileGetByIDResponse.Data;
329
+ }
330
+ export declare namespace CustomerProfileGetByIDResponse {
331
+ interface Data {
332
+ /**
333
+ * Unique identifier of the customer profile
334
+ */
335
+ id: string;
336
+ agentIds: Array<string>;
337
+ attributes: Array<Data.Attribute>;
338
+ chatCount: number;
339
+ conversationCount: number;
340
+ /**
341
+ * Null until a name is known, which is common
342
+ */
343
+ displayName: string | null;
344
+ externalId: string | null;
345
+ firstSeenAt: string | null;
346
+ lastSeenAt: string | null;
347
+ /**
348
+ * Your team's shared notes. Never sent to the agent.
349
+ */
350
+ notes: string | null;
351
+ notesUpdatedAt: string | null;
352
+ openItems: string | null;
353
+ phoneNumberE164: string | null;
354
+ summary: string | null;
355
+ /**
356
+ * Voice only. Chat time is not included.
357
+ */
358
+ talkTimeMs: number;
359
+ voiceCount: number;
360
+ }
361
+ namespace Data {
362
+ interface Attribute {
363
+ /**
364
+ * What a newer conversation said while this field was locked
365
+ */
366
+ blockedValue: string | null;
367
+ /**
368
+ * The moment the current value was heard. Null for a value set by a person or the
369
+ * API.
370
+ */
371
+ evidence: Attribute.Evidence | null;
372
+ /**
373
+ * Other values this field has held or been offered, newest first
374
+ */
375
+ history: Array<Attribute.History>;
376
+ /**
377
+ * True when newer conversations cannot change this field
378
+ */
379
+ isLocked: boolean;
380
+ key: 'FULL_NAME' | 'PREFERRED_NAME' | 'ACCOUNT_ID' | 'COMPANY' | 'JOB_TITLE' | 'EMAIL' | 'ALTERNATE_PHONE' | 'AGE' | 'GENDER' | 'LANGUAGE' | 'LOCATION' | 'TIMEZONE' | 'BEST_TIME_TO_REACH' | 'PREFERRED_CHANNEL';
381
+ observedAt: string;
382
+ /**
383
+ * Where the current value came from. LIVE and POST_CALL extraction are read from
384
+ * conversations.
385
+ */
386
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
387
+ value: string;
388
+ }
389
+ namespace Attribute {
390
+ /**
391
+ * The moment the current value was heard. Null for a value set by a person or the
392
+ * API.
393
+ */
394
+ interface Evidence {
395
+ callId: string | null;
396
+ chatId: string | null;
397
+ observedAt: string;
398
+ /**
399
+ * Where in the conversation this was said
400
+ */
401
+ offsetMs: number | null;
402
+ /**
403
+ * The customer's words. Null on a project with redaction on.
404
+ */
405
+ quote: string | null;
406
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
407
+ value: string;
408
+ }
409
+ interface History {
410
+ callId: string | null;
411
+ chatId: string | null;
412
+ observedAt: string;
413
+ /**
414
+ * Where in the conversation this was said
415
+ */
416
+ offsetMs: number | null;
417
+ /**
418
+ * The customer's words. Null on a project with redaction on.
419
+ */
420
+ quote: string | null;
421
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
422
+ value: string;
423
+ }
424
+ }
425
+ }
426
+ }
427
+ export interface CustomerProfileListConversationsResponse {
428
+ data: CustomerProfileListConversationsResponse.Data;
429
+ }
430
+ export declare namespace CustomerProfileListConversationsResponse {
431
+ interface Data {
432
+ items: Array<Data.Item>;
433
+ page: number;
434
+ totalCount: number;
435
+ }
436
+ namespace Data {
437
+ interface Item {
438
+ id: string;
439
+ conversationType: 'call' | 'chat';
440
+ durationMs: number | null;
441
+ startedAt: string;
442
+ summary: string | null;
443
+ title: string | null;
444
+ }
445
+ }
446
+ }
447
+ export interface CustomerProfileSetAttributeResponse {
448
+ data: CustomerProfileSetAttributeResponse.Data;
449
+ }
450
+ export declare namespace CustomerProfileSetAttributeResponse {
451
+ interface Data {
452
+ /**
453
+ * Unique identifier of the customer profile
454
+ */
455
+ id: string;
456
+ agentIds: Array<string>;
457
+ attributes: Array<Data.Attribute>;
458
+ chatCount: number;
459
+ conversationCount: number;
460
+ /**
461
+ * Null until a name is known, which is common
462
+ */
463
+ displayName: string | null;
464
+ externalId: string | null;
465
+ firstSeenAt: string | null;
466
+ lastSeenAt: string | null;
467
+ /**
468
+ * Your team's shared notes. Never sent to the agent.
469
+ */
470
+ notes: string | null;
471
+ notesUpdatedAt: string | null;
472
+ openItems: string | null;
473
+ phoneNumberE164: string | null;
474
+ summary: string | null;
475
+ /**
476
+ * Voice only. Chat time is not included.
477
+ */
478
+ talkTimeMs: number;
479
+ voiceCount: number;
480
+ }
481
+ namespace Data {
482
+ interface Attribute {
483
+ /**
484
+ * What a newer conversation said while this field was locked
485
+ */
486
+ blockedValue: string | null;
487
+ /**
488
+ * The moment the current value was heard. Null for a value set by a person or the
489
+ * API.
490
+ */
491
+ evidence: Attribute.Evidence | null;
492
+ /**
493
+ * Other values this field has held or been offered, newest first
494
+ */
495
+ history: Array<Attribute.History>;
496
+ /**
497
+ * True when newer conversations cannot change this field
498
+ */
499
+ isLocked: boolean;
500
+ key: 'FULL_NAME' | 'PREFERRED_NAME' | 'ACCOUNT_ID' | 'COMPANY' | 'JOB_TITLE' | 'EMAIL' | 'ALTERNATE_PHONE' | 'AGE' | 'GENDER' | 'LANGUAGE' | 'LOCATION' | 'TIMEZONE' | 'BEST_TIME_TO_REACH' | 'PREFERRED_CHANNEL';
501
+ observedAt: string;
502
+ /**
503
+ * Where the current value came from. LIVE and POST_CALL extraction are read from
504
+ * conversations.
505
+ */
506
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
507
+ value: string;
508
+ }
509
+ namespace Attribute {
510
+ /**
511
+ * The moment the current value was heard. Null for a value set by a person or the
512
+ * API.
513
+ */
514
+ interface Evidence {
515
+ callId: string | null;
516
+ chatId: string | null;
517
+ observedAt: string;
518
+ /**
519
+ * Where in the conversation this was said
520
+ */
521
+ offsetMs: number | null;
522
+ /**
523
+ * The customer's words. Null on a project with redaction on.
524
+ */
525
+ quote: string | null;
526
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
527
+ value: string;
528
+ }
529
+ interface History {
530
+ callId: string | null;
531
+ chatId: string | null;
532
+ observedAt: string;
533
+ /**
534
+ * Where in the conversation this was said
535
+ */
536
+ offsetMs: number | null;
537
+ /**
538
+ * The customer's words. Null on a project with redaction on.
539
+ */
540
+ quote: string | null;
541
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
542
+ value: string;
543
+ }
544
+ }
545
+ }
546
+ }
547
+ export interface CustomerProfileUnlockAttributeResponse {
548
+ data: CustomerProfileUnlockAttributeResponse.Data;
549
+ }
550
+ export declare namespace CustomerProfileUnlockAttributeResponse {
551
+ interface Data {
552
+ /**
553
+ * Unique identifier of the customer profile
554
+ */
555
+ id: string;
556
+ agentIds: Array<string>;
557
+ attributes: Array<Data.Attribute>;
558
+ chatCount: number;
559
+ conversationCount: number;
560
+ /**
561
+ * Null until a name is known, which is common
562
+ */
563
+ displayName: string | null;
564
+ externalId: string | null;
565
+ firstSeenAt: string | null;
566
+ lastSeenAt: string | null;
567
+ /**
568
+ * Your team's shared notes. Never sent to the agent.
569
+ */
570
+ notes: string | null;
571
+ notesUpdatedAt: string | null;
572
+ openItems: string | null;
573
+ phoneNumberE164: string | null;
574
+ summary: string | null;
575
+ /**
576
+ * Voice only. Chat time is not included.
577
+ */
578
+ talkTimeMs: number;
579
+ voiceCount: number;
580
+ }
581
+ namespace Data {
582
+ interface Attribute {
583
+ /**
584
+ * What a newer conversation said while this field was locked
585
+ */
586
+ blockedValue: string | null;
587
+ /**
588
+ * The moment the current value was heard. Null for a value set by a person or the
589
+ * API.
590
+ */
591
+ evidence: Attribute.Evidence | null;
592
+ /**
593
+ * Other values this field has held or been offered, newest first
594
+ */
595
+ history: Array<Attribute.History>;
596
+ /**
597
+ * True when newer conversations cannot change this field
598
+ */
599
+ isLocked: boolean;
600
+ key: 'FULL_NAME' | 'PREFERRED_NAME' | 'ACCOUNT_ID' | 'COMPANY' | 'JOB_TITLE' | 'EMAIL' | 'ALTERNATE_PHONE' | 'AGE' | 'GENDER' | 'LANGUAGE' | 'LOCATION' | 'TIMEZONE' | 'BEST_TIME_TO_REACH' | 'PREFERRED_CHANNEL';
601
+ observedAt: string;
602
+ /**
603
+ * Where the current value came from. LIVE and POST_CALL extraction are read from
604
+ * conversations.
605
+ */
606
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
607
+ value: string;
608
+ }
609
+ namespace Attribute {
610
+ /**
611
+ * The moment the current value was heard. Null for a value set by a person or the
612
+ * API.
613
+ */
614
+ interface Evidence {
615
+ callId: string | null;
616
+ chatId: string | null;
617
+ observedAt: string;
618
+ /**
619
+ * Where in the conversation this was said
620
+ */
621
+ offsetMs: number | null;
622
+ /**
623
+ * The customer's words. Null on a project with redaction on.
624
+ */
625
+ quote: string | null;
626
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
627
+ value: string;
628
+ }
629
+ interface History {
630
+ callId: string | null;
631
+ chatId: string | null;
632
+ observedAt: string;
633
+ /**
634
+ * Where in the conversation this was said
635
+ */
636
+ offsetMs: number | null;
637
+ /**
638
+ * The customer's words. Null on a project with redaction on.
639
+ */
640
+ quote: string | null;
641
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
642
+ value: string;
643
+ }
644
+ }
645
+ }
646
+ }
647
+ export interface CustomerProfileUpdateNotesResponse {
648
+ data: CustomerProfileUpdateNotesResponse.Data;
649
+ }
650
+ export declare namespace CustomerProfileUpdateNotesResponse {
651
+ interface Data {
652
+ /**
653
+ * Unique identifier of the customer profile
654
+ */
655
+ id: string;
656
+ agentIds: Array<string>;
657
+ attributes: Array<Data.Attribute>;
658
+ chatCount: number;
659
+ conversationCount: number;
660
+ /**
661
+ * Null until a name is known, which is common
662
+ */
663
+ displayName: string | null;
664
+ externalId: string | null;
665
+ firstSeenAt: string | null;
666
+ lastSeenAt: string | null;
667
+ /**
668
+ * Your team's shared notes. Never sent to the agent.
669
+ */
670
+ notes: string | null;
671
+ notesUpdatedAt: string | null;
672
+ openItems: string | null;
673
+ phoneNumberE164: string | null;
674
+ summary: string | null;
675
+ /**
676
+ * Voice only. Chat time is not included.
677
+ */
678
+ talkTimeMs: number;
679
+ voiceCount: number;
680
+ }
681
+ namespace Data {
682
+ interface Attribute {
683
+ /**
684
+ * What a newer conversation said while this field was locked
685
+ */
686
+ blockedValue: string | null;
687
+ /**
688
+ * The moment the current value was heard. Null for a value set by a person or the
689
+ * API.
690
+ */
691
+ evidence: Attribute.Evidence | null;
692
+ /**
693
+ * Other values this field has held or been offered, newest first
694
+ */
695
+ history: Array<Attribute.History>;
696
+ /**
697
+ * True when newer conversations cannot change this field
698
+ */
699
+ isLocked: boolean;
700
+ key: 'FULL_NAME' | 'PREFERRED_NAME' | 'ACCOUNT_ID' | 'COMPANY' | 'JOB_TITLE' | 'EMAIL' | 'ALTERNATE_PHONE' | 'AGE' | 'GENDER' | 'LANGUAGE' | 'LOCATION' | 'TIMEZONE' | 'BEST_TIME_TO_REACH' | 'PREFERRED_CHANNEL';
701
+ observedAt: string;
702
+ /**
703
+ * Where the current value came from. LIVE and POST_CALL extraction are read from
704
+ * conversations.
705
+ */
706
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
707
+ value: string;
708
+ }
709
+ namespace Attribute {
710
+ /**
711
+ * The moment the current value was heard. Null for a value set by a person or the
712
+ * API.
713
+ */
714
+ interface Evidence {
715
+ callId: string | null;
716
+ chatId: string | null;
717
+ observedAt: string;
718
+ /**
719
+ * Where in the conversation this was said
720
+ */
721
+ offsetMs: number | null;
722
+ /**
723
+ * The customer's words. Null on a project with redaction on.
724
+ */
725
+ quote: string | null;
726
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
727
+ value: string;
728
+ }
729
+ interface History {
730
+ callId: string | null;
731
+ chatId: string | null;
732
+ observedAt: string;
733
+ /**
734
+ * Where in the conversation this was said
735
+ */
736
+ offsetMs: number | null;
737
+ /**
738
+ * The customer's words. Null on a project with redaction on.
739
+ */
740
+ quote: string | null;
741
+ source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER';
742
+ value: string;
743
+ }
744
+ }
745
+ }
746
+ }
747
+ export interface CustomerProfileListParams {
748
+ agentId?: string;
749
+ /**
750
+ * Filter by this field. Use with fieldOperator and, unless checking presence,
751
+ * fieldValue.
752
+ */
753
+ fieldKey?: 'FULL_NAME' | 'PREFERRED_NAME' | 'ACCOUNT_ID' | 'COMPANY' | 'JOB_TITLE' | 'EMAIL' | 'ALTERNATE_PHONE' | 'AGE' | 'GENDER' | 'LANGUAGE' | 'LOCATION' | 'TIMEZONE' | 'BEST_TIME_TO_REACH' | 'PREFERRED_CHANNEL';
754
+ /**
755
+ * How fieldValue is compared, ignoring case. NOT_EQUALS includes customers without
756
+ * the field.
757
+ */
758
+ fieldOperator?: 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'IS_SET' | 'IS_NOT_SET';
759
+ fieldValue?: string;
760
+ /**
761
+ * Include customers we hold nothing about beyond their identifier. Defaults to
762
+ * false.
763
+ */
764
+ includeNoData?: 'true' | 'false';
765
+ limit?: number;
766
+ modality?: 'call' | 'chat';
767
+ page?: number;
768
+ search?: string;
769
+ /**
770
+ * A column, or field.<KEY> (for example field.COMPANY) to sort by a field's value.
771
+ * Customers without a value sort last.
772
+ */
773
+ sortBy?: 'lastSeenAt' | 'firstSeenAt' | 'conversationCount' | 'voiceCount' | 'chatCount' | 'talkTimeMs' | 'displayName' | 'field.FULL_NAME' | 'field.PREFERRED_NAME' | 'field.ACCOUNT_ID' | 'field.COMPANY' | 'field.JOB_TITLE' | 'field.EMAIL' | 'field.ALTERNATE_PHONE' | 'field.AGE' | 'field.GENDER' | 'field.LANGUAGE' | 'field.LOCATION' | 'field.TIMEZONE' | 'field.BEST_TIME_TO_REACH' | 'field.PREFERRED_CHANNEL';
774
+ sortDirection?: 'asc' | 'desc';
775
+ }
776
+ export interface CustomerProfileClearAttributeParams {
777
+ customerProfileId: string;
778
+ }
779
+ export interface CustomerProfileListConversationsParams {
780
+ limit?: number;
781
+ page?: number;
782
+ }
783
+ export interface CustomerProfileSetAttributeParams {
784
+ /**
785
+ * Path param
786
+ */
787
+ customerProfileId: string;
788
+ /**
789
+ * Body param: The new value. Setting a field locks it, so newer conversations
790
+ * cannot change it.
791
+ */
792
+ value: string;
793
+ }
794
+ export interface CustomerProfileUnlockAttributeParams {
795
+ customerProfileId: string;
796
+ }
797
+ export interface CustomerProfileUpdateNotesParams {
798
+ /**
799
+ * Replaces the existing notes. Null or empty clears them.
800
+ */
801
+ notes: string | null;
802
+ }
803
+ export declare namespace CustomerProfile {
804
+ export { type CustomerProfileListResponse as CustomerProfileListResponse, type CustomerProfileDeleteResponse as CustomerProfileDeleteResponse, type CustomerProfileClearAttributeResponse as CustomerProfileClearAttributeResponse, type CustomerProfileGetByIDResponse as CustomerProfileGetByIDResponse, type CustomerProfileListConversationsResponse as CustomerProfileListConversationsResponse, type CustomerProfileSetAttributeResponse as CustomerProfileSetAttributeResponse, type CustomerProfileUnlockAttributeResponse as CustomerProfileUnlockAttributeResponse, type CustomerProfileUpdateNotesResponse as CustomerProfileUpdateNotesResponse, type CustomerProfileListParams as CustomerProfileListParams, type CustomerProfileClearAttributeParams as CustomerProfileClearAttributeParams, type CustomerProfileListConversationsParams as CustomerProfileListConversationsParams, type CustomerProfileSetAttributeParams as CustomerProfileSetAttributeParams, type CustomerProfileUnlockAttributeParams as CustomerProfileUnlockAttributeParams, type CustomerProfileUpdateNotesParams as CustomerProfileUpdateNotesParams, };
805
+ }
806
+ //# sourceMappingURL=customer-profile.d.mts.map