retell-sdk 3.17.0 → 3.19.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 (53) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/core.d.ts +4 -2
  3. package/core.d.ts.map +1 -1
  4. package/core.js +17 -4
  5. package/core.js.map +1 -1
  6. package/core.mjs +18 -5
  7. package/core.mjs.map +1 -1
  8. package/index.d.mts +9 -6
  9. package/index.d.ts +9 -6
  10. package/index.d.ts.map +1 -1
  11. package/index.js +5 -3
  12. package/index.js.map +1 -1
  13. package/index.mjs +5 -3
  14. package/index.mjs.map +1 -1
  15. package/package.json +1 -1
  16. package/resources/agent.d.ts +1 -1
  17. package/resources/agent.d.ts.map +1 -1
  18. package/resources/agent.js.map +1 -1
  19. package/resources/agent.mjs.map +1 -1
  20. package/resources/call.d.ts +113 -430
  21. package/resources/call.d.ts.map +1 -1
  22. package/resources/call.js +11 -11
  23. package/resources/call.js.map +1 -1
  24. package/resources/call.mjs +11 -11
  25. package/resources/call.mjs.map +1 -1
  26. package/resources/index.d.ts +1 -1
  27. package/resources/index.d.ts.map +1 -1
  28. package/resources/index.js.map +1 -1
  29. package/resources/index.mjs.map +1 -1
  30. package/resources/llm.d.ts +4 -4
  31. package/resources/llm.d.ts.map +1 -1
  32. package/resources/llm.js.map +1 -1
  33. package/resources/llm.mjs.map +1 -1
  34. package/resources/phone-number.d.ts +35 -14
  35. package/resources/phone-number.d.ts.map +1 -1
  36. package/resources/phone-number.js.map +1 -1
  37. package/resources/phone-number.mjs.map +1 -1
  38. package/resources/voice.d.ts +1 -1
  39. package/resources/voice.d.ts.map +1 -1
  40. package/resources/voice.js.map +1 -1
  41. package/resources/voice.mjs.map +1 -1
  42. package/src/core.ts +27 -8
  43. package/src/index.ts +11 -7
  44. package/src/resources/agent.ts +1 -1
  45. package/src/resources/call.ts +127 -510
  46. package/src/resources/index.ts +4 -3
  47. package/src/resources/llm.ts +4 -4
  48. package/src/resources/phone-number.ts +40 -16
  49. package/src/resources/voice.ts +1 -1
  50. package/src/version.ts +1 -1
  51. package/version.d.ts +1 -1
  52. package/version.js +1 -1
  53. package/version.mjs +1 -1
@@ -1,23 +1,16 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import * as Core from '../core';
4
3
  import { APIResource } from '../resource';
5
4
  import { isRequestOptions } from '../core';
5
+ import * as Core from '../core';
6
6
  import * as CallAPI from './call';
7
7
 
8
8
  export class Call extends APIResource {
9
- /**
10
- * Create a new phone call
11
- */
12
- create(body: CallCreateParams, options?: Core.RequestOptions): Core.APIPromise<RegisterCallResponse> {
13
- return this._client.post('/create-phone-call', { body, ...options });
14
- }
15
-
16
9
  /**
17
10
  * Retrieve details of a specific call
18
11
  */
19
12
  retrieve(callId: string, options?: Core.RequestOptions): Core.APIPromise<CallResponse> {
20
- return this._client.get(`/get-call/${callId}`, options);
13
+ return this._client.get(`/v2/get-call/${callId}`, options);
21
14
  }
22
15
 
23
16
  /**
@@ -32,443 +25,97 @@ export class Call extends APIResource {
32
25
  if (isRequestOptions(query)) {
33
26
  return this.list({}, query);
34
27
  }
35
- return this._client.get('/list-calls', { query, ...options });
36
- }
37
-
38
- /**
39
- * Register Call To Get CallId To Establish Connection
40
- */
41
- register(body: CallRegisterParams, options?: Core.RequestOptions): Core.APIPromise<RegisterCallResponse> {
42
- return this._client.post('/register-call', { body, ...options });
28
+ return this._client.get('/v2/list-calls', { query, ...options });
43
29
  }
44
- }
45
-
46
- export interface CallResponse extends RegisterCallResponse {
47
- /**
48
- * - BETA feature, schema might change, might not always be populated. Please do
49
- * not rely on this object schema for post processing. Post conversation
50
- * evaluation of the call. Including information such as sentiment, intent, call
51
- * completion status and other metrics. Available after call ends. Subscribe to
52
- * `call_analyzed` webhook event type to receive it once ready.
53
- */
54
- call_analysis?: CallResponse.CallAnalysis;
55
30
 
56
31
  /**
57
- * The reason for the disconnection of the call. Read details desciption about
58
- * reasons listed here at
59
- * [Disconnection Reason Doc](/get-started/debug-guide#disconnection-reason).
32
+ * Create a new outbound phone call
60
33
  */
61
- disconnection_reason?:
62
- | 'user_hangup'
63
- | 'agent_hangup'
64
- | 'call_transfer'
65
- | 'inactivity'
66
- | 'machine_detected'
67
- | 'concurrency_limit_reached'
68
- | 'dial_busy'
69
- | 'dial_failed'
70
- | 'dial_no_answer'
71
- | 'error_llm_websocket_open'
72
- | 'error_llm_websocket_lost_connection'
73
- | 'error_llm_websocket_runtime'
74
- | 'error_llm_websocket_corrupt_payload'
75
- | 'error_frontend_corrupted_payload'
76
- | 'error_twilio'
77
- | 'error_no_audio_received'
78
- | 'error_asr'
79
- | 'error_retell'
80
- | 'error_unknown';
81
-
82
- /**
83
- * End to end latency (from user stops talking to agent start talking) tracking of
84
- * the call, available after call ends. This latency does not account for the
85
- * network trip time from Retell server to user frontend. The latency is tracked
86
- * every time turn change between user and agent.
87
- */
88
- e2e_latency?: CallResponse.E2ELatency;
89
-
90
- /**
91
- * End timestamp (milliseconds since epoch) of the call. Available after call ends.
92
- */
93
- end_timestamp?: number;
94
-
95
- /**
96
- * LLM latency (from issue of LLM call to first token received) tracking of the
97
- * call, available after call ends. When using custom LLM. this latency includes
98
- * LLM websocket roundtrip time between user server and Retell server.
99
- */
100
- llm_latency?: CallResponse.LlmLatency;
101
-
102
- /**
103
- * LLM websocket roundtrip latency (between user server and Retell server) tracking
104
- * of the call, available after call ends. Only populated for calls using custom
105
- * LLM.
106
- */
107
- llm_websocket_network_rtt_latency?: CallResponse.LlmWebsocketNetworkRttLatency;
108
-
109
- /**
110
- * Public log of the call, containing details about all the requests and responses
111
- * received in LLM WebSocket, latency tracking for each turntaking, helpful for
112
- * debugging and tracing. Available after call ends.
113
- */
114
- public_log_url?: string;
115
-
116
- /**
117
- * Recording of the call. Available after call ends.
118
- */
119
- recording_url?: string;
120
-
121
- /**
122
- * Begin timestamp (milliseconds since epoch) of the call. Available after call
123
- * starts.
124
- */
125
- start_timestamp?: number;
126
-
127
- /**
128
- * Transcription of the call. Available after call ends.
129
- */
130
- transcript?: string;
131
-
132
- /**
133
- * Transcript of the call in the format of a list of utterance, with timestamp.
134
- * Available after call ends.
135
- */
136
- transcript_object?: Array<CallResponse.TranscriptObject>;
137
-
138
- /**
139
- * Transcript of the call weaved with tool call invocation and results. It
140
- * precisely captures when (at what utterance, which word) the tool was invoked and
141
- * what was the result. Available after call ends.
142
- */
143
- transcript_with_tool_calls?: Array<
144
- CallResponse.Utterance | CallResponse.ToolCallInvocationUtterance | CallResponse.ToolCallResultUtterance
145
- >;
146
- }
147
-
148
- export namespace CallResponse {
149
- /**
150
- * - BETA feature, schema might change, might not always be populated. Please do
151
- * not rely on this object schema for post processing. Post conversation
152
- * evaluation of the call. Including information such as sentiment, intent, call
153
- * completion status and other metrics. Available after call ends. Subscribe to
154
- * `call_analyzed` webhook event type to receive it once ready.
155
- */
156
- export interface CallAnalysis {
157
- /**
158
- * Sentiment of the agent in the call.
159
- */
160
- agent_sentiment?: 'Negative' | 'Positive' | 'Neutral';
161
-
162
- /**
163
- * Evaluate agent task completion status, whether the agent has completed his task.
164
- */
165
- agent_task_completion_rating?: 'Complete' | 'Incomplete' | 'Partial';
166
-
167
- /**
168
- * Reason for the agent task completion status.
169
- */
170
- agent_task_completion_rating_reason?: string;
171
-
172
- /**
173
- * Evaluate whether the call ended normally or was cut off.
174
- */
175
- call_completion_rating?: 'Complete' | 'Incomplete' | 'Partial';
176
-
177
- /**
178
- * Reason for the call completion status.
179
- */
180
- call_completion_rating_reason?: string;
181
-
182
- /**
183
- * A high level summary of the call.
184
- */
185
- call_summary?: string;
186
-
187
- /**
188
- * Sentiment of the user in the call.
189
- */
190
- user_sentiment?: 'Negative' | 'Positive' | 'Neutral';
191
- }
192
-
193
- /**
194
- * End to end latency (from user stops talking to agent start talking) tracking of
195
- * the call, available after call ends. This latency does not account for the
196
- * network trip time from Retell server to user frontend. The latency is tracked
197
- * every time turn change between user and agent.
198
- */
199
- export interface E2ELatency {
200
- /**
201
- * Maximum latency in the call, measured in milliseconds.
202
- */
203
- max?: number;
204
-
205
- /**
206
- * Minimum latency in the call, measured in milliseconds.
207
- */
208
- min?: number;
209
-
210
- /**
211
- * Number of data points (number of times latency is tracked).
212
- */
213
- num?: number;
214
-
215
- /**
216
- * 50 percentile of latency, measured in milliseconds.
217
- */
218
- p50?: number;
219
-
220
- /**
221
- * 90 percentile of latency, measured in milliseconds.
222
- */
223
- p90?: number;
224
-
225
- /**
226
- * 95 percentile of latency, measured in milliseconds.
227
- */
228
- p95?: number;
229
-
230
- /**
231
- * 99 percentile of latency, measured in milliseconds.
232
- */
233
- p99?: number;
234
- }
235
-
236
- /**
237
- * LLM latency (from issue of LLM call to first token received) tracking of the
238
- * call, available after call ends. When using custom LLM. this latency includes
239
- * LLM websocket roundtrip time between user server and Retell server.
240
- */
241
- export interface LlmLatency {
242
- /**
243
- * Maximum latency in the call, measured in milliseconds.
244
- */
245
- max?: number;
246
-
247
- /**
248
- * Minimum latency in the call, measured in milliseconds.
249
- */
250
- min?: number;
251
-
252
- /**
253
- * Number of data points (number of times latency is tracked).
254
- */
255
- num?: number;
256
-
257
- /**
258
- * 50 percentile of latency, measured in milliseconds.
259
- */
260
- p50?: number;
261
-
262
- /**
263
- * 90 percentile of latency, measured in milliseconds.
264
- */
265
- p90?: number;
266
-
267
- /**
268
- * 95 percentile of latency, measured in milliseconds.
269
- */
270
- p95?: number;
271
-
272
- /**
273
- * 99 percentile of latency, measured in milliseconds.
274
- */
275
- p99?: number;
34
+ createPhoneCall(
35
+ body: CallCreatePhoneCallParams,
36
+ options?: Core.RequestOptions,
37
+ ): Core.APIPromise<PhoneCallResponse> {
38
+ return this._client.post('/v2/create-phone-call', { body, ...options });
276
39
  }
277
40
 
278
41
  /**
279
- * LLM websocket roundtrip latency (between user server and Retell server) tracking
280
- * of the call, available after call ends. Only populated for calls using custom
281
- * LLM.
42
+ * Create a new web call
282
43
  */
283
- export interface LlmWebsocketNetworkRttLatency {
284
- /**
285
- * Maximum latency in the call, measured in milliseconds.
286
- */
287
- max?: number;
288
-
289
- /**
290
- * Minimum latency in the call, measured in milliseconds.
291
- */
292
- min?: number;
293
-
294
- /**
295
- * Number of data points (number of times latency is tracked).
296
- */
297
- num?: number;
298
-
299
- /**
300
- * 50 percentile of latency, measured in milliseconds.
301
- */
302
- p50?: number;
303
-
304
- /**
305
- * 90 percentile of latency, measured in milliseconds.
306
- */
307
- p90?: number;
308
-
309
- /**
310
- * 95 percentile of latency, measured in milliseconds.
311
- */
312
- p95?: number;
313
-
314
- /**
315
- * 99 percentile of latency, measured in milliseconds.
316
- */
317
- p99?: number;
318
- }
319
-
320
- export interface TranscriptObject {
321
- /**
322
- * Transcript of the utterances.
323
- */
324
- content: string;
325
-
326
- /**
327
- * Documents whether this utterance is spoken by agent or user.
328
- */
329
- role: 'agent' | 'user';
330
-
331
- /**
332
- * Array of words in the utterance with the word timestamp. Useful for
333
- * understanding what word was spoken at what time. Note that the word timestamp is
334
- * not guaranteed to be accurate, it's more like an approximation.
335
- */
336
- words: Array<TranscriptObject.Word>;
337
- }
338
-
339
- export namespace TranscriptObject {
340
- export interface Word {
341
- /**
342
- * End time of the word in the call in second. This is relative audio time, not
343
- * wall time.
344
- */
345
- end?: number;
346
-
347
- /**
348
- * Start time of the word in the call in second. This is relative audio time, not
349
- * wall time.
350
- */
351
- start?: number;
352
-
353
- /**
354
- * Word transcript (with punctuation if applicable).
355
- */
356
- word?: string;
357
- }
44
+ createWebCall(
45
+ body: CallCreateWebCallParams,
46
+ options?: Core.RequestOptions,
47
+ ): Core.APIPromise<CallCreateWebCallResponse> {
48
+ return this._client.post('/v2/create-web-call', { body, ...options });
358
49
  }
50
+ }
359
51
 
360
- export interface Utterance {
361
- /**
362
- * Transcript of the utterances.
363
- */
364
- content: string;
52
+ export type CallResponse = CallResponse.V2WebCallResponse | PhoneCallResponse;
365
53
 
54
+ export namespace CallResponse {
55
+ export interface V2WebCallResponse {
366
56
  /**
367
- * Documents whether this utterance is spoken by agent or user.
57
+ * Access token to enter the web call room. This needs to be passed to your
58
+ * frontend to join the call.
368
59
  */
369
- role: 'agent' | 'user';
60
+ access_token: string;
370
61
 
371
62
  /**
372
- * Array of words in the utterance with the word timestamp. Useful for
373
- * understanding what word was spoken at what time. Note that the word timestamp is
374
- * not guaranteed to be accurate, it's more like an approximation.
63
+ * Corresponding agent id of this call.
375
64
  */
376
- words: Array<Utterance.Word>;
377
- }
378
-
379
- export namespace Utterance {
380
- export interface Word {
381
- /**
382
- * End time of the word in the call in second. This is relative audio time, not
383
- * wall time.
384
- */
385
- end?: number;
386
-
387
- /**
388
- * Start time of the word in the call in second. This is relative audio time, not
389
- * wall time.
390
- */
391
- start?: number;
392
-
393
- /**
394
- * Word transcript (with punctuation if applicable).
395
- */
396
- word?: string;
397
- }
398
- }
65
+ agent_id: string;
399
66
 
400
- export interface ToolCallInvocationUtterance {
401
67
  /**
402
- * Arguments for this tool call, it's a stringified JSON object.
68
+ * Unique id of the call. Used to identify in LLM websocket and used to
69
+ * authenticate in audio websocket.
403
70
  */
404
- arguments: string;
71
+ call_id: string;
405
72
 
406
73
  /**
407
- * Name of the function in this tool call.
74
+ * Status of call.
75
+ *
76
+ * - `registered`: Call id issued, starting to make a call using this id.
77
+ *
78
+ * - `ongoing`: Call connected and ongoing.
79
+ *
80
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
81
+ * hanged up, or call transferred.
82
+ *
83
+ * - `error`: Call encountered error.
408
84
  */
409
- name: string;
85
+ call_status: 'registered' | 'ongoing' | 'ended' | 'error';
410
86
 
411
87
  /**
412
- * This is a tool call invocation.
88
+ * Type of the call. Used to distinguish between web call and phone call.
413
89
  */
414
- role: 'tool_call_invocation';
90
+ call_type: 'web_call';
415
91
 
416
92
  /**
417
- * Tool call id, globally unique.
93
+ * An arbitrary object for storage purpose only. You can put anything here like
94
+ * your internal customer id associated with the call. Not used for processing. You
95
+ * can later get this field from the call object.
418
96
  */
419
- tool_call_id: string;
420
- }
421
-
422
- export interface ToolCallResultUtterance {
423
- /**
424
- * Result of the tool call, can be a string, a stringified json, etc.
425
- */
426
- content: string;
97
+ metadata?: unknown;
427
98
 
428
99
  /**
429
- * This is result of a tool call.
100
+ * Whether this call opts out of sensitive data storage like transcript, recording,
101
+ * logging.
430
102
  */
431
- role: 'tool_call_result';
103
+ opt_out_sensitive_data_storage?: boolean;
432
104
 
433
105
  /**
434
- * Tool call id, globally unique.
106
+ * Add optional dynamic variables in key value pairs of string that injects into
107
+ * your Retell LLM prompt and tool description. Only applicable for Retell LLM.
435
108
  */
436
- tool_call_id: string;
109
+ retell_llm_dynamic_variables?: Record<string, unknown>;
437
110
  }
438
111
  }
439
112
 
440
- export interface RegisterCallResponse {
113
+ export interface PhoneCallResponse {
441
114
  /**
442
115
  * Corresponding agent id of this call.
443
116
  */
444
117
  agent_id: string;
445
118
 
446
- /**
447
- * The audio encoding of the call. The following formats are supported:
448
- *
449
- * - `s16le` 16 bit linear PCM audio, the native format for web audio capture and
450
- * playback.
451
- *
452
- * - `mulaw` non-linear audio encoding technique used in telephony. Commonly used
453
- * by Twilio.
454
- */
455
- audio_encoding: 's16le' | 'mulaw';
456
-
457
- /**
458
- * Where the audio websocket would connect from would determine the format /
459
- * protocol of websocket messages, and would determine how our server read audio
460
- * bytes and send audio bytes.:
461
- *
462
- * - `web`: The protocol defined by Retell, commonly used for connecting from web
463
- * frontend. Also useful for those who want to manipulate audio bytes directly.
464
- *
465
- * - `twilio`: The
466
- * [websocket protocol](https://www.twilio.com/docs/voice/twiml/stream#message-media)
467
- * defined by Twilio, used when your system uses Twilio, and supplies Retell
468
- * audio websocket url to Twilio.
469
- */
470
- audio_websocket_protocol: 'web' | 'twilio';
471
-
472
119
  /**
473
120
  * Unique id of the call. Used to identify in LLM websocket and used to
474
121
  * authenticate in audio websocket.
@@ -478,7 +125,7 @@ export interface RegisterCallResponse {
478
125
  /**
479
126
  * Status of call.
480
127
  *
481
- * - `registered`: Call id issued, ready to make a call using this id.
128
+ * - `registered`: Call id issued, starting to make a call using this id.
482
129
  *
483
130
  * - `ongoing`: Call connected and ongoing.
484
131
  *
@@ -490,46 +137,29 @@ export interface RegisterCallResponse {
490
137
  call_status: 'registered' | 'ongoing' | 'ended' | 'error';
491
138
 
492
139
  /**
493
- * Sample rate of the conversation, the input and output audio bytes will all
494
- * conform to this rate. Check the audio source, audio format, and voice used for
495
- * the agent to select one that works. supports value ranging from [8000, 48000].
496
- * Note for Twilio `mulaw` encoding, the sample rate has to be 8000.
497
- *
498
- * - `s16le` sample rate recommendation (natively supported, lowest latency):
499
- *
500
- * - elevenlabs voices: 16000, 22050, 24000, 44100.
501
- * - openai voices: 24000.
502
- *
503
- * - deepgram voices: 8000, 16000, 24000, 32000, 48000.
140
+ * Type of the call. Used to distinguish between web call and phone call.
504
141
  */
505
- sample_rate: number;
142
+ call_type: 'phone_call';
506
143
 
507
144
  /**
508
- * If set, will drop the call if machine (voicemail, IVR) is detected. If not set,
509
- * default value of false will apply.
145
+ * Direction of the phone call.
510
146
  */
511
- drop_call_if_machine_detected?: boolean;
147
+ direction: 'inbound' | 'outbound';
512
148
 
513
149
  /**
514
- * If users stay silent for a period after agent speech, end the call. The minimum
515
- * value allowed is 10,000 ms (10 s). This value, if set, would overwrite the agent
516
- * level end_call_after_silence_ms parameter.
150
+ * The caller number.
517
151
  */
518
- end_call_after_silence_ms?: number;
152
+ from_number: string;
519
153
 
520
154
  /**
521
- * The caller number. This field is storage purpose only, set this if you want the
522
- * call object to contain it so that it's easier to reference it. Not used for
523
- * processing, when we connect to your LLM websocket server, you can then get it
524
- * from the call object.
155
+ * The callee number.
525
156
  */
526
- from_number?: string;
157
+ to_number: string;
527
158
 
528
159
  /**
529
- * An abtriary object for storage purpose only. You can put anything here like your
530
- * own id for the call, twilio SID, internal customer id. Not used for processing,
531
- * when we connect to your LLM websocket server, you can then get it from the call
532
- * object.
160
+ * An arbitrary object for storage purpose only. You can put anything here like
161
+ * your internal customer id associated with the call. Not used for processing. You
162
+ * can later get this field from the call object.
533
163
  */
534
164
  metadata?: unknown;
535
165
 
@@ -544,40 +174,59 @@ export interface RegisterCallResponse {
544
174
  * your Retell LLM prompt and tool description. Only applicable for Retell LLM.
545
175
  */
546
176
  retell_llm_dynamic_variables?: Record<string, unknown>;
177
+ }
547
178
 
179
+ export type CallListResponse = Array<CallResponse>;
180
+
181
+ export interface CallCreateWebCallResponse {
548
182
  /**
549
- * The callee number. This field is storage purpose only, set this if you want the
550
- * call object to contain it so that it's easier to reference it. Not used for
551
- * processing, when we connect to your LLM websocket server, you can then get it
552
- * from the call object.
183
+ * Access token to enter the web call room. This needs to be passed to your
184
+ * frontend to join the call.
553
185
  */
554
- to_number?: string;
555
- }
186
+ access_token: string;
556
187
 
557
- export type CallListResponse = Array<CallResponse>;
188
+ /**
189
+ * Corresponding agent id of this call.
190
+ */
191
+ agent_id: string;
558
192
 
559
- export interface CallCreateParams {
560
193
  /**
561
- * The number you own in E.164 format.
194
+ * Unique id of the call. Used to identify in LLM websocket and used to
195
+ * authenticate in audio websocket.
562
196
  */
563
- from_number: string;
197
+ call_id: string;
564
198
 
565
199
  /**
566
- * The number you want to call, in E.164 format.
200
+ * Status of call.
201
+ *
202
+ * - `registered`: Call id issued, starting to make a call using this id.
203
+ *
204
+ * - `ongoing`: Call connected and ongoing.
205
+ *
206
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
207
+ * hanged up, or call transferred.
208
+ *
209
+ * - `error`: Call encountered error.
567
210
  */
568
- to_number: string;
211
+ call_status: 'registered' | 'ongoing' | 'ended' | 'error';
569
212
 
570
213
  /**
571
- * If set, will drop the call if machine (voicemail, IVR) is detected. If not set,
572
- * default value of false will apply.
214
+ * Type of the call. Used to distinguish between web call and phone call.
573
215
  */
574
- drop_call_if_machine_detected?: boolean;
216
+ call_type: 'web_call';
575
217
 
576
218
  /**
577
- * For this particular call, override the agent used with this agent id. This does
578
- * not bind the agent to this number, this is for one time override.
219
+ * An arbitrary object for storage purpose only. You can put anything here like
220
+ * your internal customer id associated with the call. Not used for processing. You
221
+ * can later get this field from the call object.
579
222
  */
580
- override_agent_id?: string;
223
+ metadata?: unknown;
224
+
225
+ /**
226
+ * Whether this call opts out of sensitive data storage like transcript, recording,
227
+ * logging.
228
+ */
229
+ opt_out_sensitive_data_storage?: boolean;
581
230
 
582
231
  /**
583
232
  * Add optional dynamic variables in key value pairs of string that injects into
@@ -638,74 +287,49 @@ export namespace CallListParams {
638
287
  }
639
288
  }
640
289
 
641
- export interface CallRegisterParams {
290
+ export interface CallCreatePhoneCallParams {
642
291
  /**
643
- * Unique id of agent used for the call. Your agent would contain the LLM Websocket
644
- * url used for this call.
292
+ * The number you own in E.164 format. Must be a Retell managed number.
645
293
  */
646
- agent_id: string;
294
+ from_number: string;
647
295
 
648
296
  /**
649
- * The audio encoding of the call. The following formats are supported:
650
- *
651
- * - `s16le` 16 bit linear PCM audio, the native format for web audio capture and
652
- * playback.
653
- *
654
- * - `mulaw` non-linear audio encoding technique used in telephony. Commonly used
655
- * by Twilio.
297
+ * The number you want to call, in E.164 format. Right now only US numbers are
298
+ * officially supported.
656
299
  */
657
- audio_encoding: 's16le' | 'mulaw';
300
+ to_number: string;
658
301
 
659
302
  /**
660
- * Where the audio websocket would connect from would determine the format /
661
- * protocol of websocket messages, and would determine how our server read audio
662
- * bytes and send audio bytes.:
663
- *
664
- * - `web`: The protocol defined by Retell, commonly used for connecting from web
665
- * frontend. Also useful for those who want to manipulate audio bytes directly.
666
- *
667
- * - `twilio`: The
668
- * [websocket protocol](https://www.twilio.com/docs/voice/twiml/stream#message-media)
669
- * defined by Twilio, used when your system uses Twilio, and supplies Retell
670
- * audio websocket url to Twilio.
303
+ * An arbitrary object for storage purpose only. You can put anything here like
304
+ * your internal customer id associated with the call. Not used for processing. You
305
+ * can later get this field from the call object.
671
306
  */
672
- audio_websocket_protocol: 'web' | 'twilio';
307
+ metadata?: unknown;
673
308
 
674
309
  /**
675
- * Sample rate of the conversation, the input and output audio bytes will all
676
- * conform to this rate. Check the audio source, audio format, and voice used for
677
- * the agent to select one that works. supports value ranging from [8000, 48000].
678
- * Note for Twilio `mulaw` encoding, the sample rate has to be 8000.
679
- *
680
- * - `s16le` sample rate recommendation (natively supported, lowest latency):
681
- *
682
- * - elevenlabs voices: 16000, 22050, 24000, 44100.
683
- * - openai voices: 24000.
684
- *
685
- * - deepgram voices: 8000, 16000, 24000, 32000, 48000.
310
+ * For this particular call, override the agent used with this agent id. This does
311
+ * not bind the agent to this number, this is for one time override.
686
312
  */
687
- sample_rate: number;
313
+ override_agent_id?: string;
688
314
 
689
315
  /**
690
- * If users stay silent for a period after agent speech, end the call. The minimum
691
- * value allowed is 10,000 ms (10 s). This value, if set, would overwrite the agent
692
- * level end_call_after_silence_ms parameter.
316
+ * Add optional dynamic variables in key value pairs of string that injects into
317
+ * your Retell LLM prompt and tool description. Only applicable for Retell LLM.
693
318
  */
694
- end_call_after_silence_ms?: number;
319
+ retell_llm_dynamic_variables?: Record<string, unknown>;
320
+ }
695
321
 
322
+ export interface CallCreateWebCallParams {
696
323
  /**
697
- * The caller number. This field is storage purpose only, set this if you want the
698
- * call object to contain it so that it's easier to reference it. Not used for
699
- * processing, when we connect to your LLM websocket server, you can then get it
700
- * from the call object.
324
+ * Unique id of agent used for the call. Your agent would contain the LLM Websocket
325
+ * url used for this call.
701
326
  */
702
- from_number?: string;
327
+ agent_id: string;
703
328
 
704
329
  /**
705
330
  * An arbitrary object for storage purpose only. You can put anything here like
706
- * your own id for the call, twilio SID, internal customer id. Not used for
707
- * processing, when we connect to your LLM websocket server, you can then get it
708
- * from the call object.
331
+ * your internal customer id associated with the call. Not used for processing. You
332
+ * can later get this field from the call object.
709
333
  */
710
334
  metadata?: unknown;
711
335
 
@@ -714,21 +338,14 @@ export interface CallRegisterParams {
714
338
  * your Retell LLM prompt and tool description. Only applicable for Retell LLM.
715
339
  */
716
340
  retell_llm_dynamic_variables?: Record<string, unknown>;
717
-
718
- /**
719
- * The callee number. This field is storage purpose only, set this if you want the
720
- * call object to contain it so that it's easier to reference it. Not used for
721
- * processing, when we connect to your LLM websocket server, you can then get it
722
- * from the call object.
723
- */
724
- to_number?: string;
725
341
  }
726
342
 
727
343
  export namespace Call {
728
344
  export import CallResponse = CallAPI.CallResponse;
729
- export import RegisterCallResponse = CallAPI.RegisterCallResponse;
345
+ export import PhoneCallResponse = CallAPI.PhoneCallResponse;
730
346
  export import CallListResponse = CallAPI.CallListResponse;
731
- export import CallCreateParams = CallAPI.CallCreateParams;
347
+ export import CallCreateWebCallResponse = CallAPI.CallCreateWebCallResponse;
732
348
  export import CallListParams = CallAPI.CallListParams;
733
- export import CallRegisterParams = CallAPI.CallRegisterParams;
349
+ export import CallCreatePhoneCallParams = CallAPI.CallCreatePhoneCallParams;
350
+ export import CallCreateWebCallParams = CallAPI.CallCreateWebCallParams;
734
351
  }