retell-sdk 5.63.0 → 5.65.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 (147) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +29 -0
  3. package/client.d.mts +20 -8
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +20 -8
  6. package/client.d.ts.map +1 -1
  7. package/client.js +12 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +12 -0
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/agent.d.mts +102 -12
  13. package/resources/agent.d.mts.map +1 -1
  14. package/resources/agent.d.ts +102 -12
  15. package/resources/agent.d.ts.map +1 -1
  16. package/resources/agent.js +32 -4
  17. package/resources/agent.js.map +1 -1
  18. package/resources/agent.mjs +32 -4
  19. package/resources/agent.mjs.map +1 -1
  20. package/resources/app.d.mts +439 -0
  21. package/resources/app.d.mts.map +1 -0
  22. package/resources/app.d.ts +439 -0
  23. package/resources/app.d.ts.map +1 -0
  24. package/resources/app.js +69 -0
  25. package/resources/app.js.map +1 -0
  26. package/resources/app.mjs +65 -0
  27. package/resources/app.mjs.map +1 -0
  28. package/resources/asset.d.mts +53 -0
  29. package/resources/asset.d.mts.map +1 -0
  30. package/resources/asset.d.ts +53 -0
  31. package/resources/asset.d.ts.map +1 -0
  32. package/resources/asset.js +20 -0
  33. package/resources/asset.js.map +1 -0
  34. package/resources/asset.mjs +16 -0
  35. package/resources/asset.mjs.map +1 -0
  36. package/resources/batch-call.d.mts +4 -2
  37. package/resources/batch-call.d.mts.map +1 -1
  38. package/resources/batch-call.d.ts +4 -2
  39. package/resources/batch-call.d.ts.map +1 -1
  40. package/resources/call.d.mts +221 -27
  41. package/resources/call.d.mts.map +1 -1
  42. package/resources/call.d.ts +221 -27
  43. package/resources/call.d.ts.map +1 -1
  44. package/resources/call.js +37 -5
  45. package/resources/call.js.map +1 -1
  46. package/resources/call.mjs +37 -5
  47. package/resources/call.mjs.map +1 -1
  48. package/resources/chat-agent.d.mts +4 -10
  49. package/resources/chat-agent.d.mts.map +1 -1
  50. package/resources/chat-agent.d.ts +4 -10
  51. package/resources/chat-agent.d.ts.map +1 -1
  52. package/resources/chat-agent.js +2 -8
  53. package/resources/chat-agent.js.map +1 -1
  54. package/resources/chat-agent.mjs +2 -8
  55. package/resources/chat-agent.mjs.map +1 -1
  56. package/resources/chat.d.mts +24 -11
  57. package/resources/chat.d.mts.map +1 -1
  58. package/resources/chat.d.ts +24 -11
  59. package/resources/chat.d.ts.map +1 -1
  60. package/resources/contact.d.mts +669 -0
  61. package/resources/contact.d.mts.map +1 -0
  62. package/resources/contact.d.ts +669 -0
  63. package/resources/contact.d.ts.map +1 -0
  64. package/resources/contact.js +100 -0
  65. package/resources/contact.js.map +1 -0
  66. package/resources/contact.mjs +96 -0
  67. package/resources/contact.mjs.map +1 -0
  68. package/resources/conversation-flow-component.d.mts +56 -8
  69. package/resources/conversation-flow-component.d.mts.map +1 -1
  70. package/resources/conversation-flow-component.d.ts +56 -8
  71. package/resources/conversation-flow-component.d.ts.map +1 -1
  72. package/resources/conversation-flow.d.mts +120 -16
  73. package/resources/conversation-flow.d.mts.map +1 -1
  74. package/resources/conversation-flow.d.ts +120 -16
  75. package/resources/conversation-flow.d.ts.map +1 -1
  76. package/resources/conversation-flow.js +3 -1
  77. package/resources/conversation-flow.js.map +1 -1
  78. package/resources/conversation-flow.mjs +3 -1
  79. package/resources/conversation-flow.mjs.map +1 -1
  80. package/resources/crm.d.mts +226 -0
  81. package/resources/crm.d.mts.map +1 -0
  82. package/resources/crm.d.ts +226 -0
  83. package/resources/crm.d.ts.map +1 -0
  84. package/resources/crm.js +46 -0
  85. package/resources/crm.js.map +1 -0
  86. package/resources/crm.mjs +42 -0
  87. package/resources/crm.mjs.map +1 -0
  88. package/resources/export-request.d.mts +2 -2
  89. package/resources/export-request.d.mts.map +1 -1
  90. package/resources/export-request.d.ts +2 -2
  91. package/resources/export-request.d.ts.map +1 -1
  92. package/resources/index.d.mts +8 -4
  93. package/resources/index.d.mts.map +1 -1
  94. package/resources/index.d.ts +8 -4
  95. package/resources/index.d.ts.map +1 -1
  96. package/resources/index.js +9 -1
  97. package/resources/index.js.map +1 -1
  98. package/resources/index.mjs +4 -0
  99. package/resources/index.mjs.map +1 -1
  100. package/resources/knowledge-base.d.mts +16 -8
  101. package/resources/knowledge-base.d.mts.map +1 -1
  102. package/resources/knowledge-base.d.ts +16 -8
  103. package/resources/knowledge-base.d.ts.map +1 -1
  104. package/resources/llm.d.mts +66 -10
  105. package/resources/llm.d.mts.map +1 -1
  106. package/resources/llm.d.ts +66 -10
  107. package/resources/llm.d.ts.map +1 -1
  108. package/resources/llm.js +3 -1
  109. package/resources/llm.js.map +1 -1
  110. package/resources/llm.mjs +3 -1
  111. package/resources/llm.mjs.map +1 -1
  112. package/resources/phone-number.d.mts +14 -8
  113. package/resources/phone-number.d.mts.map +1 -1
  114. package/resources/phone-number.d.ts +14 -8
  115. package/resources/phone-number.d.ts.map +1 -1
  116. package/resources/tests.d.mts +6 -6
  117. package/resources/tests.d.mts.map +1 -1
  118. package/resources/tests.d.ts +6 -6
  119. package/resources/tests.d.ts.map +1 -1
  120. package/resources/voice.d.mts +4 -4
  121. package/resources/voice.d.mts.map +1 -1
  122. package/resources/voice.d.ts +4 -4
  123. package/resources/voice.d.ts.map +1 -1
  124. package/src/client.ts +116 -0
  125. package/src/resources/agent.ts +141 -9
  126. package/src/resources/app.ts +593 -0
  127. package/src/resources/asset.ts +69 -0
  128. package/src/resources/batch-call.ts +6 -1
  129. package/src/resources/call.ts +289 -25
  130. package/src/resources/chat-agent.ts +4 -10
  131. package/src/resources/chat.ts +28 -11
  132. package/src/resources/contact.ts +910 -0
  133. package/src/resources/conversation-flow-component.ts +56 -8
  134. package/src/resources/conversation-flow.ts +127 -15
  135. package/src/resources/crm.ts +298 -0
  136. package/src/resources/export-request.ts +2 -2
  137. package/src/resources/index.ts +50 -0
  138. package/src/resources/knowledge-base.ts +16 -8
  139. package/src/resources/llm.ts +73 -9
  140. package/src/resources/phone-number.ts +14 -8
  141. package/src/resources/tests.ts +6 -6
  142. package/src/resources/voice.ts +4 -4
  143. package/src/version.ts +1 -1
  144. package/version.d.mts +1 -1
  145. package/version.d.ts +1 -1
  146. package/version.js +1 -1
  147. package/version.mjs +1 -1
@@ -0,0 +1,593 @@
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 App extends APIResource {
10
+ /**
11
+ * Create an App: the connection to one external system (a CRM, calendar, support
12
+ * desk, and so on), holding its credentials and settings. Providers with
13
+ * caller-managed credentials accept auth_config. Providers using the OAuth
14
+ * callback must omit auth_config and be authorized through connect-app.
15
+ * Credentials are stored encrypted and never returned. Up to 20 apps per provider.
16
+ */
17
+ create(body: AppCreateParams, options?: RequestOptions): APIPromise<AppResponse> {
18
+ return this._client.post('/create-app', { body, ...options });
19
+ }
20
+
21
+ /**
22
+ * Partially update an App. Omitted fields remain unchanged. Updating auth_config
23
+ * or tenant metadata invalidates the cached provider token immediately. Providers
24
+ * using the OAuth callback reject auth_config and must be reauthorized through
25
+ * connect-app.
26
+ */
27
+ update(appID: string, body: AppUpdateParams, options?: RequestOptions): APIPromise<AppResponse> {
28
+ return this._client.patch(path`/update-app/${appID}`, { body, ...options });
29
+ }
30
+
31
+ /**
32
+ * List Apps in the organization (paginated).
33
+ */
34
+ list(query: AppListParams | null | undefined = {}, options?: RequestOptions): APIPromise<AppListResponse> {
35
+ return this._client.get('/list-apps', { query, ...options });
36
+ }
37
+
38
+ /**
39
+ * Delete an App. Fails when agents or knowledge bases still reference it, unless
40
+ * force_delete is set. If a CRM config is linked to this App, the link is cleared.
41
+ */
42
+ delete(
43
+ appID: string,
44
+ params: AppDeleteParams | null | undefined = {},
45
+ options?: RequestOptions,
46
+ ): APIPromise<void> {
47
+ const { force_delete } = params ?? {};
48
+ return this._client.delete(path`/delete-app/${appID}`, {
49
+ query: { force_delete },
50
+ ...options,
51
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
52
+ });
53
+ }
54
+
55
+ /**
56
+ * Get an App by id.
57
+ */
58
+ get(appID: string, options?: RequestOptions): APIPromise<AppResponse> {
59
+ return this._client.get(path`/get-app/${appID}`, options);
60
+ }
61
+
62
+ /**
63
+ * List the agents and knowledge bases referencing an App, most recently configured
64
+ * first by default.
65
+ */
66
+ listUsages(
67
+ appID: string,
68
+ query: AppListUsagesParams | null | undefined = {},
69
+ options?: RequestOptions,
70
+ ): APIPromise<AppListUsagesResponse> {
71
+ return this._client.get(path`/list-app-usages/${appID}`, { query, ...options });
72
+ }
73
+
74
+ /**
75
+ * Probe the App's stored credentials by making a minimal authenticated call to the
76
+ * provider. Returns success=true on a successful round-trip, and records the
77
+ * outcome on the App's connection_status either way.
78
+ */
79
+ testAuth(appID: string, options?: RequestOptions): APIPromise<AppTestAuthResponse> {
80
+ return this._client.post(path`/test-app-auth/${appID}`, options);
81
+ }
82
+ }
83
+
84
+ export interface AppResponse {
85
+ app_id: string;
86
+
87
+ created_timestamp: number;
88
+
89
+ org_id: string;
90
+
91
+ /**
92
+ * Provider name. Must be valid for the App's type; the supported providers per
93
+ * type are listed by list-app-templates.
94
+ */
95
+ provider: string;
96
+
97
+ /**
98
+ * App integration category.
99
+ */
100
+ type: 'crm' | 'calendar' | 'knowledge_base' | 'support' | 'communication';
101
+
102
+ user_modified_timestamp: number;
103
+
104
+ /**
105
+ * Non-secret auth metadata. Encrypted secret fields are never returned by the API.
106
+ */
107
+ auth_config?:
108
+ | AppResponse.OAuthConfigResponse
109
+ | AppResponse.APIKeyAuthConfigResponse
110
+ | AppResponse.AccessTokenAuthConfigResponse
111
+ | AppResponse.BasicAuthConfigResponse
112
+ | AppResponse.RefreshTokenAuthConfigResponse;
113
+
114
+ /**
115
+ * Connection health of the App, server-managed. `not_connected` after create or a
116
+ * credential / tenant URL change; `connected` once verified via OAuth connect, an
117
+ * auth test, or a successful live tool call; `error` when the provider rejects the
118
+ * credentials (on connect, an auth test, or a live tool call).
119
+ */
120
+ connection_status?: 'not_connected' | 'connected' | 'error';
121
+
122
+ crm_config?: AppResponse.CRMConfig;
123
+
124
+ name?: string;
125
+
126
+ /**
127
+ * Sub-account id, for providers that scope requests by a sub-account id on a
128
+ * shared host. Omitted by every other provider.
129
+ */
130
+ tenant_id?: string;
131
+
132
+ /**
133
+ * Microsoft OneDrive account type discovered during OAuth.
134
+ */
135
+ tenant_type?: 'business' | 'personal';
136
+
137
+ /**
138
+ * Per-tenant API base URL. Set by providers with per-org hosts; omitted by
139
+ * providers on a single global host. For OneDrive for Business, this is the
140
+ * tenant's -my.sharepoint.com origin used by File Picker v8; personal OneDrive
141
+ * omits it.
142
+ */
143
+ tenant_url?: string;
144
+ }
145
+
146
+ export namespace AppResponse {
147
+ export interface OAuthConfigResponse {
148
+ client_id: string;
149
+
150
+ type: 'oauth2';
151
+ }
152
+
153
+ export interface APIKeyAuthConfigResponse {
154
+ type: 'api_key';
155
+ }
156
+
157
+ export interface AccessTokenAuthConfigResponse {
158
+ type: 'access_token';
159
+ }
160
+
161
+ export interface BasicAuthConfigResponse {
162
+ type: 'basic';
163
+
164
+ username: string;
165
+ }
166
+
167
+ export interface RefreshTokenAuthConfigResponse {
168
+ type: 'refresh_token';
169
+ }
170
+
171
+ export interface CRMConfig {
172
+ /**
173
+ * Field mappings applied when syncing CRM records into Retell contacts. Must
174
+ * include phone_number, which is the field the two systems are matched on.
175
+ */
176
+ inbound_sync_mappings?: Array<CRMConfig.InboundSyncMapping>;
177
+
178
+ /**
179
+ * Field mappings applied when writing Retell contact changes back to the CRM.
180
+ */
181
+ outbound_sync_mappings?: Array<CRMConfig.OutboundSyncMapping>;
182
+
183
+ /**
184
+ * Whether to push call/chat activity to the external CRM. Opt-in — defaults to
185
+ * false when unset.
186
+ */
187
+ sync_conversation_activity?: boolean;
188
+
189
+ /**
190
+ * Whether to create a CRM record after a conversation when the contact is not yet
191
+ * linked to one.
192
+ */
193
+ sync_new_contacts?: boolean;
194
+ }
195
+
196
+ export namespace CRMConfig {
197
+ export interface InboundSyncMapping {
198
+ /**
199
+ * Field on the CRM's contact object to map to. A name that does not exist there
200
+ * surfaces as an error on the sync job rather than at configuration time.
201
+ */
202
+ external_field_name: string;
203
+
204
+ /**
205
+ * Retell contact field, built-in or custom, to map. Types must be compatible with
206
+ * the CRM field on both sides of the sync.
207
+ */
208
+ field_name: string;
209
+ }
210
+
211
+ export interface OutboundSyncMapping {
212
+ /**
213
+ * Field on the CRM's contact object to map to. A name that does not exist there
214
+ * surfaces as an error on the sync job rather than at configuration time.
215
+ */
216
+ external_field_name: string;
217
+
218
+ /**
219
+ * Retell contact field, built-in or custom, to map. Types must be compatible with
220
+ * the CRM field on both sides of the sync.
221
+ */
222
+ field_name: string;
223
+ }
224
+ }
225
+ }
226
+
227
+ export interface AppListResponse {
228
+ /**
229
+ * Whether more results are available.
230
+ */
231
+ has_more: boolean;
232
+
233
+ items: Array<AppResponse>;
234
+
235
+ /**
236
+ * Pagination key for the next page.
237
+ */
238
+ pagination_key?: string;
239
+ }
240
+
241
+ export interface AppListUsagesResponse {
242
+ /**
243
+ * Whether more results are available.
244
+ */
245
+ has_more: boolean;
246
+
247
+ items: Array<AppListUsagesResponse.AgentAppUsage | AppListUsagesResponse.KnowledgeBaseAppUsage>;
248
+
249
+ /**
250
+ * Pagination key for the next page.
251
+ */
252
+ pagination_key?: string;
253
+ }
254
+
255
+ export namespace AppListUsagesResponse {
256
+ export interface AgentAppUsage {
257
+ agent_id: string;
258
+
259
+ /**
260
+ * Agent versions referencing this app, largest first.
261
+ */
262
+ agent_versions: Array<number>;
263
+
264
+ /**
265
+ * When this reference was last recorded, in milliseconds.
266
+ */
267
+ configured_timestamp: number;
268
+
269
+ type: 'agent';
270
+
271
+ /**
272
+ * Current agent name; omitted if the agent was deleted.
273
+ */
274
+ agent_name?: string;
275
+ }
276
+
277
+ export interface KnowledgeBaseAppUsage {
278
+ /**
279
+ * When this reference was last recorded, in milliseconds.
280
+ */
281
+ configured_timestamp: number;
282
+
283
+ knowledge_base_id: string;
284
+
285
+ type: 'knowledge_base';
286
+
287
+ /**
288
+ * Current knowledge base name; omitted if it was deleted.
289
+ */
290
+ knowledge_base_name?: string;
291
+ }
292
+ }
293
+
294
+ export interface AppTestAuthResponse {
295
+ success: boolean;
296
+ }
297
+
298
+ export interface AppCreateParams {
299
+ /**
300
+ * Provider name. Must be valid for the App's type; the supported providers per
301
+ * type are listed by list-app-templates.
302
+ */
303
+ provider: string;
304
+
305
+ /**
306
+ * App integration category.
307
+ */
308
+ type: 'crm' | 'calendar' | 'knowledge_base' | 'support' | 'communication';
309
+
310
+ /**
311
+ * Caller-managed credentials. Providers using the OAuth callback reject
312
+ * auth_config and must be authorized through connect-app.
313
+ */
314
+ auth_config?:
315
+ | AppCreateParams.OAuthConfigRequest
316
+ | AppCreateParams.APIKeyAuthConfigRequest
317
+ | AppCreateParams.BasicAuthConfigRequest;
318
+
319
+ crm_config?: AppCreateParams.CRMConfig;
320
+
321
+ /**
322
+ * Display name.
323
+ */
324
+ name?: string;
325
+
326
+ /**
327
+ * Sub-account id, for providers that scope requests by a sub-account id on a
328
+ * shared host.
329
+ */
330
+ tenant_id?: string;
331
+
332
+ /**
333
+ * Per-tenant API base URL.
334
+ */
335
+ tenant_url?: string;
336
+ }
337
+
338
+ export namespace AppCreateParams {
339
+ export interface OAuthConfigRequest {
340
+ client_id: string;
341
+
342
+ /**
343
+ * Secret credential; stored encrypted at rest.
344
+ */
345
+ client_secret: string;
346
+
347
+ type: 'oauth2';
348
+ }
349
+
350
+ export interface APIKeyAuthConfigRequest {
351
+ /**
352
+ * API key credential; stored encrypted at rest.
353
+ */
354
+ api_key: string;
355
+
356
+ type: 'api_key';
357
+ }
358
+
359
+ export interface BasicAuthConfigRequest {
360
+ /**
361
+ * Password credential; stored encrypted at rest.
362
+ */
363
+ password: string;
364
+
365
+ type: 'basic';
366
+
367
+ username: string;
368
+ }
369
+
370
+ export interface CRMConfig {
371
+ /**
372
+ * Field mappings applied when syncing CRM records into Retell contacts. Must
373
+ * include phone_number, which is the field the two systems are matched on.
374
+ */
375
+ inbound_sync_mappings?: Array<CRMConfig.InboundSyncMapping>;
376
+
377
+ /**
378
+ * Field mappings applied when writing Retell contact changes back to the CRM.
379
+ */
380
+ outbound_sync_mappings?: Array<CRMConfig.OutboundSyncMapping>;
381
+
382
+ /**
383
+ * Whether to push call/chat activity to the external CRM. Opt-in — defaults to
384
+ * false when unset.
385
+ */
386
+ sync_conversation_activity?: boolean;
387
+
388
+ /**
389
+ * Whether to create a CRM record after a conversation when the contact is not yet
390
+ * linked to one.
391
+ */
392
+ sync_new_contacts?: boolean;
393
+ }
394
+
395
+ export namespace CRMConfig {
396
+ export interface InboundSyncMapping {
397
+ /**
398
+ * Field on the CRM's contact object to map to. A name that does not exist there
399
+ * surfaces as an error on the sync job rather than at configuration time.
400
+ */
401
+ external_field_name: string;
402
+
403
+ /**
404
+ * Retell contact field, built-in or custom, to map. Types must be compatible with
405
+ * the CRM field on both sides of the sync.
406
+ */
407
+ field_name: string;
408
+ }
409
+
410
+ export interface OutboundSyncMapping {
411
+ /**
412
+ * Field on the CRM's contact object to map to. A name that does not exist there
413
+ * surfaces as an error on the sync job rather than at configuration time.
414
+ */
415
+ external_field_name: string;
416
+
417
+ /**
418
+ * Retell contact field, built-in or custom, to map. Types must be compatible with
419
+ * the CRM field on both sides of the sync.
420
+ */
421
+ field_name: string;
422
+ }
423
+ }
424
+ }
425
+
426
+ export interface AppUpdateParams {
427
+ /**
428
+ * Caller-managed credentials. Providers using the OAuth callback reject
429
+ * auth_config and must be authorized through connect-app.
430
+ */
431
+ auth_config?:
432
+ | AppUpdateParams.OAuthConfigRequest
433
+ | AppUpdateParams.APIKeyAuthConfigRequest
434
+ | AppUpdateParams.BasicAuthConfigRequest;
435
+
436
+ crm_config?: AppUpdateParams.CRMConfig;
437
+
438
+ name?: string;
439
+
440
+ /**
441
+ * Sub-account id, for providers that scope requests by a sub-account id on a
442
+ * shared host.
443
+ */
444
+ tenant_id?: string;
445
+
446
+ /**
447
+ * Per-tenant API base URL.
448
+ */
449
+ tenant_url?: string;
450
+ }
451
+
452
+ export namespace AppUpdateParams {
453
+ export interface OAuthConfigRequest {
454
+ client_id: string;
455
+
456
+ /**
457
+ * Secret credential; stored encrypted at rest.
458
+ */
459
+ client_secret: string;
460
+
461
+ type: 'oauth2';
462
+ }
463
+
464
+ export interface APIKeyAuthConfigRequest {
465
+ /**
466
+ * API key credential; stored encrypted at rest.
467
+ */
468
+ api_key: string;
469
+
470
+ type: 'api_key';
471
+ }
472
+
473
+ export interface BasicAuthConfigRequest {
474
+ /**
475
+ * Password credential; stored encrypted at rest.
476
+ */
477
+ password: string;
478
+
479
+ type: 'basic';
480
+
481
+ username: string;
482
+ }
483
+
484
+ export interface CRMConfig {
485
+ /**
486
+ * Field mappings applied when syncing CRM records into Retell contacts. Must
487
+ * include phone_number, which is the field the two systems are matched on.
488
+ */
489
+ inbound_sync_mappings?: Array<CRMConfig.InboundSyncMapping>;
490
+
491
+ /**
492
+ * Field mappings applied when writing Retell contact changes back to the CRM.
493
+ */
494
+ outbound_sync_mappings?: Array<CRMConfig.OutboundSyncMapping>;
495
+
496
+ /**
497
+ * Whether to push call/chat activity to the external CRM. Opt-in — defaults to
498
+ * false when unset.
499
+ */
500
+ sync_conversation_activity?: boolean;
501
+
502
+ /**
503
+ * Whether to create a CRM record after a conversation when the contact is not yet
504
+ * linked to one.
505
+ */
506
+ sync_new_contacts?: boolean;
507
+ }
508
+
509
+ export namespace CRMConfig {
510
+ export interface InboundSyncMapping {
511
+ /**
512
+ * Field on the CRM's contact object to map to. A name that does not exist there
513
+ * surfaces as an error on the sync job rather than at configuration time.
514
+ */
515
+ external_field_name: string;
516
+
517
+ /**
518
+ * Retell contact field, built-in or custom, to map. Types must be compatible with
519
+ * the CRM field on both sides of the sync.
520
+ */
521
+ field_name: string;
522
+ }
523
+
524
+ export interface OutboundSyncMapping {
525
+ /**
526
+ * Field on the CRM's contact object to map to. A name that does not exist there
527
+ * surfaces as an error on the sync job rather than at configuration time.
528
+ */
529
+ external_field_name: string;
530
+
531
+ /**
532
+ * Retell contact field, built-in or custom, to map. Types must be compatible with
533
+ * the CRM field on both sides of the sync.
534
+ */
535
+ field_name: string;
536
+ }
537
+ }
538
+ }
539
+
540
+ export interface AppListParams {
541
+ /**
542
+ * Maximum number of items to return.
543
+ */
544
+ limit?: number;
545
+
546
+ /**
547
+ * Pagination key for fetching the next page.
548
+ */
549
+ pagination_key?: string;
550
+
551
+ /**
552
+ * Sort order for results.
553
+ */
554
+ sort_order?: 'ascending' | 'descending';
555
+ }
556
+
557
+ export interface AppDeleteParams {
558
+ /**
559
+ * Delete even when the App is still referenced.
560
+ */
561
+ force_delete?: boolean;
562
+ }
563
+
564
+ export interface AppListUsagesParams {
565
+ /**
566
+ * Maximum number of items to return.
567
+ */
568
+ limit?: number;
569
+
570
+ /**
571
+ * Pagination key for fetching the next page.
572
+ */
573
+ pagination_key?: string;
574
+
575
+ /**
576
+ * Sort order for results.
577
+ */
578
+ sort_order?: 'ascending' | 'descending';
579
+ }
580
+
581
+ export declare namespace App {
582
+ export {
583
+ type AppResponse as AppResponse,
584
+ type AppListResponse as AppListResponse,
585
+ type AppListUsagesResponse as AppListUsagesResponse,
586
+ type AppTestAuthResponse as AppTestAuthResponse,
587
+ type AppCreateParams as AppCreateParams,
588
+ type AppUpdateParams as AppUpdateParams,
589
+ type AppListParams as AppListParams,
590
+ type AppDeleteParams as AppDeleteParams,
591
+ type AppListUsagesParams as AppListUsagesParams,
592
+ };
593
+ }
@@ -0,0 +1,69 @@
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 { type Uploadable } from '../core/uploads';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { multipartFormRequestOptions } from '../internal/uploads';
8
+
9
+ export class Asset extends APIResource {
10
+ /**
11
+ * Upload an image or audio asset. Audio is normalized to headerless mono PCM16 at
12
+ * 24 kHz and can be referenced by `custom_on_hold_music_asset_id` on warm and
13
+ * agentic-warm transfer options. Accepted audio formats are MP3, WAV, WebM, OGG,
14
+ * M4A, AAC, and FLAC. The maximum upload size is 10 MB and audio duration is
15
+ * limited to 210 seconds.
16
+ */
17
+ create(body: AssetCreateParams, options?: RequestOptions): APIPromise<AssetCreateResponse> {
18
+ return this._client.post(
19
+ '/create-asset',
20
+ multipartFormRequestOptions({ body, ...options }, this._client),
21
+ );
22
+ }
23
+ }
24
+
25
+ export interface AssetCreateResponse {
26
+ /**
27
+ * Unique identifier for the asset.
28
+ */
29
+ asset_id?: string;
30
+
31
+ /**
32
+ * MIME type of the asset.
33
+ */
34
+ content_type?: string;
35
+
36
+ /**
37
+ * Unix timestamp of when the asset was created.
38
+ */
39
+ created_timestamp?: number;
40
+
41
+ /**
42
+ * Stored file name. Uploaded audio is normalized to headerless PCM and uses a
43
+ * `.pcm` extension.
44
+ */
45
+ file_name?: string;
46
+
47
+ /**
48
+ * File size in bytes.
49
+ */
50
+ file_size?: number;
51
+
52
+ /**
53
+ * CDN URL to access the asset.
54
+ */
55
+ url?: string;
56
+ }
57
+
58
+ export interface AssetCreateParams {
59
+ /**
60
+ * Image or audio file to upload. Images support PNG, JPEG, GIF, WebP, and SVG.
61
+ * Audio supports MP3, WAV, WebM, OGG, M4A, AAC, and FLAC. Maximum size is 10 MB;
62
+ * audio is limited to 210 seconds.
63
+ */
64
+ file: Uploadable;
65
+ }
66
+
67
+ export declare namespace Asset {
68
+ export { type AssetCreateResponse as AssetCreateResponse, type AssetCreateParams as AssetCreateParams };
69
+ }
@@ -758,6 +758,7 @@ export namespace BatchCallCreateBatchCallParams {
758
758
  | 'sonic-3'
759
759
  | 'sonic-3-latest'
760
760
  | 'sonic-3.5'
761
+ | 'sonic-3.6'
761
762
  | 'tts-1'
762
763
  | 'gpt-4o-mini-tts'
763
764
  | 'speech-02-turbo'
@@ -765,6 +766,8 @@ export namespace BatchCallCreateBatchCallParams {
765
766
  | 's1'
766
767
  | 's2-pro'
767
768
  | 's2.1-pro'
769
+ | 'inworld-tts-2'
770
+ | 'inworld-tts-2-flash'
768
771
  | null;
769
772
 
770
773
  /**
@@ -853,7 +856,9 @@ export namespace BatchCallCreateBatchCallParams {
853
856
  export interface CustomSttConfig {
854
857
  /**
855
858
  * Endpointing timeout in milliseconds. Minimum is 100 for Azure, 10 for Deepgram,
856
- * 500 for Soniox, 100 for AssemblyAI.
859
+ * 500 for Soniox, 100 for AssemblyAI. For AssemblyAI, this sets min_turn_silence
860
+ * (100-3000 ms). max_turn_silence adds half of this value, rounded to the nearest
861
+ * millisecond and bounded to 500-1000 ms, with a total cap of 3000 ms.
857
862
  */
858
863
  endpointing_ms: number;
859
864