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.
- package/CHANGELOG.md +42 -0
- package/README.md +29 -0
- package/client.d.mts +20 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +20 -8
- package/client.d.ts.map +1 -1
- package/client.js +12 -0
- package/client.js.map +1 -1
- package/client.mjs +12 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent.d.mts +102 -12
- package/resources/agent.d.mts.map +1 -1
- package/resources/agent.d.ts +102 -12
- package/resources/agent.d.ts.map +1 -1
- package/resources/agent.js +32 -4
- package/resources/agent.js.map +1 -1
- package/resources/agent.mjs +32 -4
- package/resources/agent.mjs.map +1 -1
- package/resources/app.d.mts +439 -0
- package/resources/app.d.mts.map +1 -0
- package/resources/app.d.ts +439 -0
- package/resources/app.d.ts.map +1 -0
- package/resources/app.js +69 -0
- package/resources/app.js.map +1 -0
- package/resources/app.mjs +65 -0
- package/resources/app.mjs.map +1 -0
- package/resources/asset.d.mts +53 -0
- package/resources/asset.d.mts.map +1 -0
- package/resources/asset.d.ts +53 -0
- package/resources/asset.d.ts.map +1 -0
- package/resources/asset.js +20 -0
- package/resources/asset.js.map +1 -0
- package/resources/asset.mjs +16 -0
- package/resources/asset.mjs.map +1 -0
- package/resources/batch-call.d.mts +4 -2
- package/resources/batch-call.d.mts.map +1 -1
- package/resources/batch-call.d.ts +4 -2
- package/resources/batch-call.d.ts.map +1 -1
- package/resources/call.d.mts +221 -27
- package/resources/call.d.mts.map +1 -1
- package/resources/call.d.ts +221 -27
- package/resources/call.d.ts.map +1 -1
- package/resources/call.js +37 -5
- package/resources/call.js.map +1 -1
- package/resources/call.mjs +37 -5
- package/resources/call.mjs.map +1 -1
- package/resources/chat-agent.d.mts +4 -10
- package/resources/chat-agent.d.mts.map +1 -1
- package/resources/chat-agent.d.ts +4 -10
- package/resources/chat-agent.d.ts.map +1 -1
- package/resources/chat-agent.js +2 -8
- package/resources/chat-agent.js.map +1 -1
- package/resources/chat-agent.mjs +2 -8
- package/resources/chat-agent.mjs.map +1 -1
- package/resources/chat.d.mts +24 -11
- package/resources/chat.d.mts.map +1 -1
- package/resources/chat.d.ts +24 -11
- package/resources/chat.d.ts.map +1 -1
- package/resources/contact.d.mts +669 -0
- package/resources/contact.d.mts.map +1 -0
- package/resources/contact.d.ts +669 -0
- package/resources/contact.d.ts.map +1 -0
- package/resources/contact.js +100 -0
- package/resources/contact.js.map +1 -0
- package/resources/contact.mjs +96 -0
- package/resources/contact.mjs.map +1 -0
- package/resources/conversation-flow-component.d.mts +56 -8
- package/resources/conversation-flow-component.d.mts.map +1 -1
- package/resources/conversation-flow-component.d.ts +56 -8
- package/resources/conversation-flow-component.d.ts.map +1 -1
- package/resources/conversation-flow.d.mts +120 -16
- package/resources/conversation-flow.d.mts.map +1 -1
- package/resources/conversation-flow.d.ts +120 -16
- package/resources/conversation-flow.d.ts.map +1 -1
- package/resources/conversation-flow.js +3 -1
- package/resources/conversation-flow.js.map +1 -1
- package/resources/conversation-flow.mjs +3 -1
- package/resources/conversation-flow.mjs.map +1 -1
- package/resources/crm.d.mts +226 -0
- package/resources/crm.d.mts.map +1 -0
- package/resources/crm.d.ts +226 -0
- package/resources/crm.d.ts.map +1 -0
- package/resources/crm.js +46 -0
- package/resources/crm.js.map +1 -0
- package/resources/crm.mjs +42 -0
- package/resources/crm.mjs.map +1 -0
- package/resources/export-request.d.mts +2 -2
- package/resources/export-request.d.mts.map +1 -1
- package/resources/export-request.d.ts +2 -2
- package/resources/export-request.d.ts.map +1 -1
- package/resources/index.d.mts +8 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -1
- package/resources/knowledge-base.d.mts +16 -8
- package/resources/knowledge-base.d.mts.map +1 -1
- package/resources/knowledge-base.d.ts +16 -8
- package/resources/knowledge-base.d.ts.map +1 -1
- package/resources/llm.d.mts +66 -10
- package/resources/llm.d.mts.map +1 -1
- package/resources/llm.d.ts +66 -10
- package/resources/llm.d.ts.map +1 -1
- package/resources/llm.js +3 -1
- package/resources/llm.js.map +1 -1
- package/resources/llm.mjs +3 -1
- package/resources/llm.mjs.map +1 -1
- package/resources/phone-number.d.mts +14 -8
- package/resources/phone-number.d.mts.map +1 -1
- package/resources/phone-number.d.ts +14 -8
- package/resources/phone-number.d.ts.map +1 -1
- package/resources/tests.d.mts +6 -6
- package/resources/tests.d.mts.map +1 -1
- package/resources/tests.d.ts +6 -6
- package/resources/tests.d.ts.map +1 -1
- package/resources/voice.d.mts +4 -4
- package/resources/voice.d.mts.map +1 -1
- package/resources/voice.d.ts +4 -4
- package/resources/voice.d.ts.map +1 -1
- package/src/client.ts +116 -0
- package/src/resources/agent.ts +141 -9
- package/src/resources/app.ts +593 -0
- package/src/resources/asset.ts +69 -0
- package/src/resources/batch-call.ts +6 -1
- package/src/resources/call.ts +289 -25
- package/src/resources/chat-agent.ts +4 -10
- package/src/resources/chat.ts +28 -11
- package/src/resources/contact.ts +910 -0
- package/src/resources/conversation-flow-component.ts +56 -8
- package/src/resources/conversation-flow.ts +127 -15
- package/src/resources/crm.ts +298 -0
- package/src/resources/export-request.ts +2 -2
- package/src/resources/index.ts +50 -0
- package/src/resources/knowledge-base.ts +16 -8
- package/src/resources/llm.ts +73 -9
- package/src/resources/phone-number.ts +14 -8
- package/src/resources/tests.ts +6 -6
- package/src/resources/voice.ts +4 -4
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- 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
|
|