retell-sdk 5.63.0 → 5.64.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/client.d.mts +15 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +15 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent.d.mts +64 -4
  12. package/resources/agent.d.mts.map +1 -1
  13. package/resources/agent.d.ts +64 -4
  14. package/resources/agent.d.ts.map +1 -1
  15. package/resources/agent.js +13 -4
  16. package/resources/agent.js.map +1 -1
  17. package/resources/agent.mjs +13 -4
  18. package/resources/agent.mjs.map +1 -1
  19. package/resources/app.d.mts +457 -0
  20. package/resources/app.d.mts.map +1 -0
  21. package/resources/app.d.ts +457 -0
  22. package/resources/app.d.ts.map +1 -0
  23. package/resources/app.js +67 -0
  24. package/resources/app.js.map +1 -0
  25. package/resources/app.mjs +63 -0
  26. package/resources/app.mjs.map +1 -0
  27. package/resources/call.d.mts +66 -6
  28. package/resources/call.d.mts.map +1 -1
  29. package/resources/call.d.ts +66 -6
  30. package/resources/call.d.ts.map +1 -1
  31. package/resources/chat-agent.d.mts +2 -8
  32. package/resources/chat-agent.d.mts.map +1 -1
  33. package/resources/chat-agent.d.ts +2 -8
  34. package/resources/chat-agent.d.ts.map +1 -1
  35. package/resources/chat-agent.js +2 -8
  36. package/resources/chat-agent.js.map +1 -1
  37. package/resources/chat-agent.mjs +2 -8
  38. package/resources/chat-agent.mjs.map +1 -1
  39. package/resources/contact.d.mts +541 -0
  40. package/resources/contact.d.mts.map +1 -0
  41. package/resources/contact.d.ts +541 -0
  42. package/resources/contact.d.ts.map +1 -0
  43. package/resources/contact.js +77 -0
  44. package/resources/contact.js.map +1 -0
  45. package/resources/contact.mjs +73 -0
  46. package/resources/contact.mjs.map +1 -0
  47. package/resources/conversation-flow-component.d.mts +18 -6
  48. package/resources/conversation-flow-component.d.mts.map +1 -1
  49. package/resources/conversation-flow-component.d.ts +18 -6
  50. package/resources/conversation-flow-component.d.ts.map +1 -1
  51. package/resources/conversation-flow.d.mts +46 -14
  52. package/resources/conversation-flow.d.mts.map +1 -1
  53. package/resources/conversation-flow.d.ts +46 -14
  54. package/resources/conversation-flow.d.ts.map +1 -1
  55. package/resources/conversation-flow.js +3 -1
  56. package/resources/conversation-flow.js.map +1 -1
  57. package/resources/conversation-flow.mjs +3 -1
  58. package/resources/conversation-flow.mjs.map +1 -1
  59. package/resources/crm.d.mts +222 -0
  60. package/resources/crm.d.mts.map +1 -0
  61. package/resources/crm.d.ts +222 -0
  62. package/resources/crm.d.ts.map +1 -0
  63. package/resources/crm.js +46 -0
  64. package/resources/crm.js.map +1 -0
  65. package/resources/crm.mjs +42 -0
  66. package/resources/crm.mjs.map +1 -0
  67. package/resources/index.d.mts +6 -3
  68. package/resources/index.d.mts.map +1 -1
  69. package/resources/index.d.ts +6 -3
  70. package/resources/index.d.ts.map +1 -1
  71. package/resources/index.js +7 -1
  72. package/resources/index.js.map +1 -1
  73. package/resources/index.mjs +3 -0
  74. package/resources/index.mjs.map +1 -1
  75. package/resources/knowledge-base.d.mts +12 -4
  76. package/resources/knowledge-base.d.mts.map +1 -1
  77. package/resources/knowledge-base.d.ts +12 -4
  78. package/resources/knowledge-base.d.ts.map +1 -1
  79. package/resources/llm.d.mts +28 -8
  80. package/resources/llm.d.mts.map +1 -1
  81. package/resources/llm.d.ts +28 -8
  82. package/resources/llm.d.ts.map +1 -1
  83. package/resources/llm.js +3 -1
  84. package/resources/llm.js.map +1 -1
  85. package/resources/llm.mjs +3 -1
  86. package/resources/llm.mjs.map +1 -1
  87. package/src/client.ts +85 -0
  88. package/src/resources/agent.ts +85 -4
  89. package/src/resources/app.ts +622 -0
  90. package/src/resources/call.ts +93 -7
  91. package/src/resources/chat-agent.ts +2 -8
  92. package/src/resources/contact.ts +732 -0
  93. package/src/resources/conversation-flow-component.ts +18 -6
  94. package/src/resources/conversation-flow.ts +53 -13
  95. package/src/resources/crm.ts +293 -0
  96. package/src/resources/index.ts +38 -0
  97. package/src/resources/knowledge-base.ts +12 -4
  98. package/src/resources/llm.ts +35 -7
  99. package/src/version.ts +1 -1
  100. package/version.d.mts +1 -1
  101. package/version.d.ts +1 -1
  102. package/version.js +1 -1
  103. package/version.mjs +1 -1
@@ -0,0 +1,732 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { buildHeaders } from '../internal/headers';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class Contact extends APIResource {
10
+ /**
11
+ * Create a new contact.
12
+ */
13
+ create(body: ContactCreateParams, options?: RequestOptions): APIPromise<ContactResponse> {
14
+ return this._client.post('/create-contact', { body, ...options });
15
+ }
16
+
17
+ /**
18
+ * Update an existing contact.
19
+ */
20
+ update(
21
+ contactID: string,
22
+ body: ContactUpdateParams,
23
+ options?: RequestOptions,
24
+ ): APIPromise<ContactResponse> {
25
+ return this._client.patch(path`/update-contact/${contactID}`, { body, ...options });
26
+ }
27
+
28
+ /**
29
+ * List contacts, newest conversation first by default, with the total count of
30
+ * matches alongside the page. Page through results with `pagination_key`; `skip`
31
+ * is available for offset-style paging but is slower on large contact sets and can
32
+ * repeat or miss rows as contacts are updated.
33
+ */
34
+ list(
35
+ body: ContactListParams | null | undefined = {},
36
+ options?: RequestOptions,
37
+ ): APIPromise<ContactListResponse> {
38
+ return this._client.post('/list-contacts', { body, ...options });
39
+ }
40
+
41
+ /**
42
+ * Delete a contact. A contact linked to a record in a connected CRM cannot be
43
+ * deleted while two-way sync is active — unlink the CRM app first, otherwise the
44
+ * next sync would recreate it.
45
+ */
46
+ delete(contactID: string, options?: RequestOptions): APIPromise<void> {
47
+ return this._client.delete(path`/delete-contact/${contactID}`, {
48
+ ...options,
49
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
50
+ });
51
+ }
52
+
53
+ /**
54
+ * Trigger a backfill job that re-applies analysis data mappings to contacts using
55
+ * historical call data. Only one backfill job can run per organization at a time.
56
+ */
57
+ backfillAnalysisData(
58
+ body: ContactBackfillAnalysisDataParams,
59
+ options?: RequestOptions,
60
+ ): APIPromise<ContactBackfillAnalysisDataResponse> {
61
+ return this._client.post('/backfill-contact-analysis-data', { body, ...options });
62
+ }
63
+
64
+ /**
65
+ * Retrieve a contact by ID.
66
+ */
67
+ get(contactID: string, options?: RequestOptions): APIPromise<ContactResponse> {
68
+ return this._client.get(path`/get-contact/${contactID}`, options);
69
+ }
70
+
71
+ /**
72
+ * Get the status of the contact analysis data backfill job.
73
+ */
74
+ getBackfillJobStatus(options?: RequestOptions): APIPromise<ContactGetBackfillJobStatusResponse> {
75
+ return this._client.get('/get-backfill-contact-job-status', options);
76
+ }
77
+
78
+ /**
79
+ * Retrieve a contact by phone number. At most one contact exists per phone number
80
+ * in an organization.
81
+ */
82
+ getByPhone(phoneNumber: string, options?: RequestOptions): APIPromise<ContactResponse> {
83
+ return this._client.get(path`/get-contact-by-phone/${phoneNumber}`, options);
84
+ }
85
+
86
+ /**
87
+ * List a contact's conversations (inbound calls, outbound calls, and chats) merged
88
+ * into a single timeline, most recent first. Results are matched by the contact's
89
+ * phone number. Use the returned `pagination_key` to fetch the next page.
90
+ */
91
+ listConversations(
92
+ contactID: string,
93
+ query: ContactListConversationsParams | null | undefined = {},
94
+ options?: RequestOptions,
95
+ ): APIPromise<ContactListConversationsResponse> {
96
+ return this._client.get(path`/list-contact-conversations/${contactID}`, { query, ...options });
97
+ }
98
+ }
99
+
100
+ export interface ContactResponse {
101
+ /**
102
+ * Unique identifier for the contact.
103
+ */
104
+ contact_id: string;
105
+
106
+ /**
107
+ * Epoch milliseconds when the contact was created.
108
+ */
109
+ created_timestamp: number;
110
+
111
+ /**
112
+ * Organization this contact belongs to.
113
+ */
114
+ org_id: string;
115
+
116
+ /**
117
+ * Phone number of the contact.
118
+ */
119
+ phone_number: string;
120
+
121
+ /**
122
+ * Number of conversations (calls and chats) associated with this contact.
123
+ */
124
+ conversation_count?: number;
125
+
126
+ /**
127
+ * Custom fields defined in CRM config.
128
+ */
129
+ custom_fields?: unknown;
130
+
131
+ /**
132
+ * Whether this contact should not be called.
133
+ */
134
+ do_not_call?: boolean;
135
+
136
+ /**
137
+ * CRM record ID from the external provider.
138
+ */
139
+ external_id?: string;
140
+
141
+ /**
142
+ * First name of the contact.
143
+ */
144
+ first_name?: string;
145
+
146
+ /**
147
+ * Epoch milliseconds of the most recent conversation with this contact.
148
+ */
149
+ last_conversation_timestamp?: number;
150
+
151
+ /**
152
+ * Last name of the contact.
153
+ */
154
+ last_name?: string;
155
+
156
+ /**
157
+ * Epoch milliseconds when the contact was last modified.
158
+ */
159
+ user_modified_timestamp?: number;
160
+ }
161
+
162
+ export interface ContactListResponse {
163
+ has_more?: boolean;
164
+
165
+ items?: Array<ContactResponse>;
166
+
167
+ /**
168
+ * Base64url-encoded pagination key for the next page.
169
+ */
170
+ pagination_key?: string;
171
+
172
+ /**
173
+ * Total count of contacts matching the filter.
174
+ */
175
+ total?: number;
176
+ }
177
+
178
+ export interface ContactBackfillAnalysisDataResponse {
179
+ status: 'queued' | 'running' | 'idle';
180
+
181
+ /**
182
+ * Number of items that errored so far.
183
+ */
184
+ failed?: number;
185
+
186
+ /**
187
+ * Epoch milliseconds when the job started.
188
+ */
189
+ start_timestamp?: number;
190
+
191
+ /**
192
+ * Number of items processed successfully so far.
193
+ */
194
+ succeeded?: number;
195
+
196
+ /**
197
+ * Whether the job was started by an explicit API call (`manual`) or by the
198
+ * scheduled sync (`cron`).
199
+ */
200
+ triggered_by?: 'manual' | 'cron';
201
+ }
202
+
203
+ export interface ContactGetBackfillJobStatusResponse {
204
+ status: 'queued' | 'running' | 'idle';
205
+
206
+ /**
207
+ * Number of items that errored so far.
208
+ */
209
+ failed?: number;
210
+
211
+ /**
212
+ * Epoch milliseconds when the job started.
213
+ */
214
+ start_timestamp?: number;
215
+
216
+ /**
217
+ * Number of items processed successfully so far.
218
+ */
219
+ succeeded?: number;
220
+
221
+ /**
222
+ * Whether the job was started by an explicit API call (`manual`) or by the
223
+ * scheduled sync (`cron`).
224
+ */
225
+ triggered_by?: 'manual' | 'cron';
226
+ }
227
+
228
+ export interface ContactListConversationsResponse {
229
+ /**
230
+ * Whether more conversations exist beyond the returned window.
231
+ */
232
+ has_more?: boolean;
233
+
234
+ items?: Array<ContactListConversationsResponse.ContactCall | ContactListConversationsResponse.ContactChat>;
235
+
236
+ /**
237
+ * Base64url-encoded pagination key. Pass as `pagination_key` query parameter to
238
+ * fetch the next page.
239
+ */
240
+ pagination_key?: string;
241
+ }
242
+
243
+ export namespace ContactListConversationsResponse {
244
+ export interface ContactCall {
245
+ call_id: string;
246
+
247
+ type: 'call';
248
+
249
+ /**
250
+ * Direction of the call.
251
+ */
252
+ direction?: 'inbound' | 'outbound';
253
+
254
+ /**
255
+ * Reason the call ended.
256
+ */
257
+ disconnection_reason?: string;
258
+
259
+ /**
260
+ * Duration of the call in milliseconds.
261
+ */
262
+ duration_ms?: number;
263
+
264
+ /**
265
+ * User sentiment from post-call analysis.
266
+ */
267
+ sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
268
+
269
+ /**
270
+ * Epoch milliseconds when the call started.
271
+ */
272
+ start_timestamp?: number;
273
+
274
+ /**
275
+ * Whether the call was deemed successful by post-call analysis.
276
+ */
277
+ successful?: boolean;
278
+
279
+ /**
280
+ * Post-call analysis summary.
281
+ */
282
+ summary?: string;
283
+ }
284
+
285
+ export interface ContactChat {
286
+ chat_id: string;
287
+
288
+ type: 'chat';
289
+
290
+ /**
291
+ * Direction of the chat.
292
+ */
293
+ direction?: 'inbound' | 'outbound';
294
+
295
+ /**
296
+ * Reason the chat ended.
297
+ */
298
+ disconnection_reason?: string;
299
+
300
+ /**
301
+ * Duration of the chat in milliseconds.
302
+ */
303
+ duration_ms?: number;
304
+
305
+ /**
306
+ * User sentiment from post-chat analysis.
307
+ */
308
+ sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
309
+
310
+ /**
311
+ * Epoch milliseconds when the chat started.
312
+ */
313
+ start_timestamp?: number;
314
+
315
+ /**
316
+ * Whether the chat was deemed successful by post-chat analysis.
317
+ */
318
+ successful?: boolean;
319
+
320
+ /**
321
+ * Post-chat analysis summary.
322
+ */
323
+ summary?: string;
324
+ }
325
+ }
326
+
327
+ export interface ContactCreateParams {
328
+ /**
329
+ * Phone number of the contact.
330
+ */
331
+ phone_number: string;
332
+
333
+ /**
334
+ * Values must match the types defined in CRM config custom fields. Set a value to
335
+ * null to clear it.
336
+ */
337
+ custom_fields?: unknown;
338
+
339
+ do_not_call?: boolean;
340
+
341
+ /**
342
+ * First name of the contact.
343
+ */
344
+ first_name?: string;
345
+
346
+ /**
347
+ * Last name of the contact.
348
+ */
349
+ last_name?: string;
350
+ }
351
+
352
+ export interface ContactUpdateParams {
353
+ /**
354
+ * Values must match the types defined in CRM config custom fields. Set a value to
355
+ * null to clear it.
356
+ */
357
+ custom_fields?: unknown;
358
+
359
+ do_not_call?: boolean;
360
+
361
+ /**
362
+ * First name of the contact.
363
+ */
364
+ first_name?: string;
365
+
366
+ /**
367
+ * Last name of the contact.
368
+ */
369
+ last_name?: string;
370
+ }
371
+
372
+ export interface ContactListParams {
373
+ /**
374
+ * Filter criteria for contacts. All conditions are implicitly connected with AND.
375
+ * first_name and last_name are not filterable here; use search_query to match on
376
+ * those.
377
+ */
378
+ filter_criteria?: ContactListParams.FilterCriteria;
379
+
380
+ /**
381
+ * Maximum number of contacts to return.
382
+ */
383
+ limit?: number;
384
+
385
+ /**
386
+ * Base64url-encoded pagination key from a previous response.
387
+ */
388
+ pagination_key?: string;
389
+
390
+ /**
391
+ * Case-insensitive substring match against phone number, first name, last name,
392
+ * external ID, and custom field values. This is the only way to match on a
393
+ * contact's name.
394
+ */
395
+ search_query?: string;
396
+
397
+ /**
398
+ * Number of records to skip for offset-based pagination.
399
+ */
400
+ skip?: number;
401
+
402
+ /**
403
+ * Sort contacts by `last_conversation_timestamp` in ascending or descending order.
404
+ * Contacts that have never been contacted sort as if their timestamp were 0.
405
+ */
406
+ sort_order?: 'asc' | 'desc';
407
+ }
408
+
409
+ export namespace ContactListParams {
410
+ /**
411
+ * Filter criteria for contacts. All conditions are implicitly connected with AND.
412
+ * first_name and last_name are not filterable here; use search_query to match on
413
+ * those.
414
+ */
415
+ export interface FilterCriteria {
416
+ contact_id?: FilterCriteria.ContactID;
417
+
418
+ /**
419
+ * Filter by custom contact fields defined in CRM config.
420
+ */
421
+ custom_fields?: Array<
422
+ | FilterCriteria.StringFilter
423
+ | FilterCriteria.NumberFilter
424
+ | FilterCriteria.BooleanFilter
425
+ | FilterCriteria.RangeFilter
426
+ | FilterCriteria.EnumFilter
427
+ | FilterCriteria.PresentFilter
428
+ >;
429
+
430
+ /**
431
+ * Filter by whether the contact is marked do-not-call.
432
+ */
433
+ do_not_call?: FilterCriteria.DoNotCall;
434
+
435
+ /**
436
+ * Filter by the record id in the connected CRM. Use a `present` filter to separate
437
+ * synced from unsynced contacts.
438
+ */
439
+ external_id?: FilterCriteria.StringFilter | FilterCriteria.PresentFilter;
440
+
441
+ /**
442
+ * Filter by when the contact was last spoken to, in epoch milliseconds.
443
+ */
444
+ last_conversation_timestamp?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter;
445
+
446
+ /**
447
+ * Filter by phone number. Stored in E.164, so an `eq` filter needs the full
448
+ * number.
449
+ */
450
+ phone_number?: FilterCriteria.PhoneNumber;
451
+ }
452
+
453
+ export namespace FilterCriteria {
454
+ export interface ContactID {
455
+ /**
456
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
457
+ */
458
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
459
+
460
+ type: 'string';
461
+
462
+ value: string;
463
+ }
464
+
465
+ export interface StringFilter {
466
+ /**
467
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
468
+ */
469
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
470
+
471
+ type: 'string';
472
+
473
+ value: string;
474
+
475
+ /**
476
+ * The field name to filter on.
477
+ */
478
+ key?: string;
479
+ }
480
+
481
+ export interface NumberFilter {
482
+ /**
483
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
484
+ * than, le: less than or equal
485
+ */
486
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
487
+
488
+ type: 'number';
489
+
490
+ value: number;
491
+
492
+ /**
493
+ * The field name to filter on.
494
+ */
495
+ key?: string;
496
+ }
497
+
498
+ export interface BooleanFilter {
499
+ op: 'eq';
500
+
501
+ type: 'boolean';
502
+
503
+ value: boolean;
504
+
505
+ /**
506
+ * The field name to filter on.
507
+ */
508
+ key?: string;
509
+ }
510
+
511
+ export interface RangeFilter {
512
+ /**
513
+ * bt: between
514
+ */
515
+ op: 'bt';
516
+
517
+ type: 'range';
518
+
519
+ /**
520
+ * [lower_bound, upper_bound]
521
+ */
522
+ value: Array<number>;
523
+
524
+ /**
525
+ * The field name to filter on.
526
+ */
527
+ key?: string;
528
+ }
529
+
530
+ export interface EnumFilter {
531
+ /**
532
+ * in: value is one of the listed values
533
+ */
534
+ op: 'in';
535
+
536
+ type: 'enum';
537
+
538
+ value: Array<string>;
539
+
540
+ /**
541
+ * The field name to filter on.
542
+ */
543
+ key?: string;
544
+ }
545
+
546
+ export interface PresentFilter {
547
+ /**
548
+ * pr: present (has value), np: not present
549
+ */
550
+ op: 'pr' | 'np';
551
+
552
+ type: 'present';
553
+
554
+ /**
555
+ * The field name to filter on.
556
+ */
557
+ key?: string;
558
+ }
559
+
560
+ /**
561
+ * Filter by whether the contact is marked do-not-call.
562
+ */
563
+ export interface DoNotCall {
564
+ op: 'eq';
565
+
566
+ type: 'boolean';
567
+
568
+ value: boolean;
569
+ }
570
+
571
+ export interface StringFilter {
572
+ /**
573
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
574
+ */
575
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
576
+
577
+ type: 'string';
578
+
579
+ value: string;
580
+ }
581
+
582
+ export interface PresentFilter {
583
+ /**
584
+ * pr: present (has value), np: not present
585
+ */
586
+ op: 'pr' | 'np';
587
+
588
+ type: 'present';
589
+ }
590
+
591
+ export interface NumberFilter {
592
+ /**
593
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
594
+ * than, le: less than or equal
595
+ */
596
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
597
+
598
+ type: 'number';
599
+
600
+ value: number;
601
+ }
602
+
603
+ export interface RangeFilter {
604
+ /**
605
+ * bt: between
606
+ */
607
+ op: 'bt';
608
+
609
+ type: 'range';
610
+
611
+ /**
612
+ * [lower_bound, upper_bound]
613
+ */
614
+ value: Array<number>;
615
+ }
616
+
617
+ /**
618
+ * Filter by phone number. Stored in E.164, so an `eq` filter needs the full
619
+ * number.
620
+ */
621
+ export interface PhoneNumber {
622
+ /**
623
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
624
+ */
625
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
626
+
627
+ type: 'string';
628
+
629
+ value: string;
630
+ }
631
+ }
632
+ }
633
+
634
+ export interface ContactBackfillAnalysisDataParams {
635
+ /**
636
+ * Contact fields to recompute. Each one must still exist as a contact field and
637
+ * have an analysis data mapping configured, otherwise the request is rejected
638
+ * rather than running a job that writes nothing.
639
+ */
640
+ backfill_attributes: Array<string>;
641
+
642
+ /**
643
+ * Optional call filter to scope which calls are processed. Supports agent and
644
+ * start_timestamp from the standard call filter.
645
+ */
646
+ backfill_call_filter?: ContactBackfillAnalysisDataParams.BackfillCallFilter;
647
+ }
648
+
649
+ export namespace ContactBackfillAnalysisDataParams {
650
+ /**
651
+ * Optional call filter to scope which calls are processed. Supports agent and
652
+ * start_timestamp from the standard call filter.
653
+ */
654
+ export interface BackfillCallFilter {
655
+ /**
656
+ * Filter calls by agent. Agents are OR-connected.
657
+ */
658
+ agent?: Array<BackfillCallFilter.Agent>;
659
+
660
+ /**
661
+ * Filter calls by start timestamp (epoch ms).
662
+ */
663
+ start_timestamp?: BackfillCallFilter.NumberFilter | BackfillCallFilter.RangeFilter;
664
+ }
665
+
666
+ export namespace BackfillCallFilter {
667
+ export interface Agent {
668
+ /**
669
+ * The agent ID to filter on.
670
+ */
671
+ agent_id: string;
672
+
673
+ /**
674
+ * Specific versions to filter on. If not provided, all versions are included.
675
+ */
676
+ version?: Array<number>;
677
+ }
678
+
679
+ export interface NumberFilter {
680
+ /**
681
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
682
+ * than, le: less than or equal
683
+ */
684
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
685
+
686
+ type: 'number';
687
+
688
+ value: number;
689
+ }
690
+
691
+ export interface RangeFilter {
692
+ /**
693
+ * bt: between
694
+ */
695
+ op: 'bt';
696
+
697
+ type: 'range';
698
+
699
+ /**
700
+ * [lower_bound, upper_bound]
701
+ */
702
+ value: Array<number>;
703
+ }
704
+ }
705
+ }
706
+
707
+ export interface ContactListConversationsParams {
708
+ /**
709
+ * Maximum number of items to return.
710
+ */
711
+ limit?: number;
712
+
713
+ /**
714
+ * Pagination key for fetching the next page.
715
+ */
716
+ pagination_key?: string;
717
+ }
718
+
719
+ export declare namespace Contact {
720
+ export {
721
+ type ContactResponse as ContactResponse,
722
+ type ContactListResponse as ContactListResponse,
723
+ type ContactBackfillAnalysisDataResponse as ContactBackfillAnalysisDataResponse,
724
+ type ContactGetBackfillJobStatusResponse as ContactGetBackfillJobStatusResponse,
725
+ type ContactListConversationsResponse as ContactListConversationsResponse,
726
+ type ContactCreateParams as ContactCreateParams,
727
+ type ContactUpdateParams as ContactUpdateParams,
728
+ type ContactListParams as ContactListParams,
729
+ type ContactBackfillAnalysisDataParams as ContactBackfillAnalysisDataParams,
730
+ type ContactListConversationsParams as ContactListConversationsParams,
731
+ };
732
+ }