@roarkanalytics/sdk 2.13.1 → 2.15.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 +35 -0
- package/LICENSE +1 -1
- package/README.md +11 -9
- package/index.d.mts +10 -10
- package/index.d.ts +10 -10
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/call.d.ts +741 -16
- package/resources/call.d.ts.map +1 -1
- package/resources/call.js +16 -4
- package/resources/call.js.map +1 -1
- package/resources/call.mjs +16 -4
- package/resources/call.mjs.map +1 -1
- package/resources/evaluation.d.ts +85 -81
- package/resources/evaluation.d.ts.map +1 -1
- package/resources/evaluation.js +8 -8
- package/resources/evaluation.js.map +1 -1
- package/resources/evaluation.mjs +8 -8
- package/resources/evaluation.mjs.map +1 -1
- package/resources/index.d.ts +5 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/metric.d.ts +5 -5
- package/resources/metric.d.ts.map +1 -1
- package/resources/metric.js +1 -1
- package/resources/metric.js.map +1 -1
- package/resources/metric.mjs +1 -1
- package/resources/metric.mjs.map +1 -1
- package/resources/persona.d.ts +21 -21
- package/resources/persona.d.ts.map +1 -1
- package/resources/persona.js +2 -2
- package/resources/persona.js.map +1 -1
- package/resources/persona.mjs +2 -2
- package/resources/persona.mjs.map +1 -1
- package/resources/simulation.d.ts +273 -28
- package/resources/simulation.d.ts.map +1 -1
- package/resources/simulation.js +37 -8
- package/resources/simulation.js.map +1 -1
- package/resources/simulation.mjs +37 -8
- package/resources/simulation.mjs.map +1 -1
- package/src/index.ts +40 -28
- package/src/resources/call.ts +964 -27
- package/src/resources/evaluation.ts +113 -108
- package/src/resources/index.ts +20 -14
- package/src/resources/metric.ts +5 -5
- package/src/resources/persona.ts +110 -29
- package/src/resources/simulation.ts +390 -34
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/call.ts
CHANGED
|
@@ -5,6 +5,28 @@ import { isRequestOptions } from '../core';
|
|
|
5
5
|
import * as Core from '../core';
|
|
6
6
|
|
|
7
7
|
export class Call extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new call with recording, transcript, agents, and customers
|
|
10
|
+
*/
|
|
11
|
+
create(body: CallCreateParams, options?: Core.RequestOptions): Core.APIPromise<CallCreateResponse> {
|
|
12
|
+
return this._client.post('/v1/call', { body, ...options });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Returns a paginated list of calls for the authenticated project.
|
|
17
|
+
*/
|
|
18
|
+
list(query?: CallListParams, options?: Core.RequestOptions): Core.APIPromise<CallListResponse>;
|
|
19
|
+
list(options?: Core.RequestOptions): Core.APIPromise<CallListResponse>;
|
|
20
|
+
list(
|
|
21
|
+
query: CallListParams | Core.RequestOptions = {},
|
|
22
|
+
options?: Core.RequestOptions,
|
|
23
|
+
): Core.APIPromise<CallListResponse> {
|
|
24
|
+
if (isRequestOptions(query)) {
|
|
25
|
+
return this.list({}, query);
|
|
26
|
+
}
|
|
27
|
+
return this._client.get('/v1/call', { query, ...options });
|
|
28
|
+
}
|
|
29
|
+
|
|
8
30
|
/**
|
|
9
31
|
* Retrieve an existing call by its unique identifier
|
|
10
32
|
*/
|
|
@@ -15,10 +37,10 @@ export class Call extends APIResource {
|
|
|
15
37
|
/**
|
|
16
38
|
* Fetch all evaluation run results for a specific call.
|
|
17
39
|
*/
|
|
18
|
-
|
|
40
|
+
listEvaluationRuns(
|
|
19
41
|
callId: string,
|
|
20
42
|
options?: Core.RequestOptions,
|
|
21
|
-
): Core.APIPromise<
|
|
43
|
+
): Core.APIPromise<CallListEvaluationRunsResponse> {
|
|
22
44
|
return this._client.get(`/v1/call/${callId}/evaluation-run`, options);
|
|
23
45
|
}
|
|
24
46
|
|
|
@@ -26,19 +48,19 @@ export class Call extends APIResource {
|
|
|
26
48
|
* Fetch all call-level metrics for a specific call, including both
|
|
27
49
|
* system-generated and custom metrics. Only returns successfully computed metrics.
|
|
28
50
|
*/
|
|
29
|
-
|
|
51
|
+
listMetrics(
|
|
30
52
|
callId: string,
|
|
31
|
-
query?:
|
|
53
|
+
query?: CallListMetricsParams,
|
|
32
54
|
options?: Core.RequestOptions,
|
|
33
|
-
): Core.APIPromise<
|
|
34
|
-
|
|
35
|
-
|
|
55
|
+
): Core.APIPromise<CallListMetricsResponse>;
|
|
56
|
+
listMetrics(callId: string, options?: Core.RequestOptions): Core.APIPromise<CallListMetricsResponse>;
|
|
57
|
+
listMetrics(
|
|
36
58
|
callId: string,
|
|
37
|
-
query:
|
|
59
|
+
query: CallListMetricsParams | Core.RequestOptions = {},
|
|
38
60
|
options?: Core.RequestOptions,
|
|
39
|
-
): Core.APIPromise<
|
|
61
|
+
): Core.APIPromise<CallListMetricsResponse> {
|
|
40
62
|
if (isRequestOptions(query)) {
|
|
41
|
-
return this.
|
|
63
|
+
return this.listMetrics(callId, {}, query);
|
|
42
64
|
}
|
|
43
65
|
return this._client.get(`/v1/call/${callId}/metrics`, { query, ...options });
|
|
44
66
|
}
|
|
@@ -47,14 +69,244 @@ export class Call extends APIResource {
|
|
|
47
69
|
* Fetch detailed sentiment analysis results for a specific call, including
|
|
48
70
|
* emotional tone, key phrases, and sentiment scores.
|
|
49
71
|
*/
|
|
50
|
-
|
|
72
|
+
listSentimentRuns(
|
|
51
73
|
callId: string,
|
|
52
74
|
options?: Core.RequestOptions,
|
|
53
|
-
): Core.APIPromise<
|
|
75
|
+
): Core.APIPromise<CallListSentimentRunsResponse> {
|
|
54
76
|
return this._client.get(`/v1/call/${callId}/sentiment-run`, options);
|
|
55
77
|
}
|
|
56
78
|
}
|
|
57
79
|
|
|
80
|
+
export interface CallCreateResponse {
|
|
81
|
+
/**
|
|
82
|
+
* Response after creating a call
|
|
83
|
+
*/
|
|
84
|
+
data: CallCreateResponse.Data;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export namespace CallCreateResponse {
|
|
88
|
+
/**
|
|
89
|
+
* Response after creating a call
|
|
90
|
+
*/
|
|
91
|
+
export interface Data {
|
|
92
|
+
/**
|
|
93
|
+
* Unique identifier for the call
|
|
94
|
+
*/
|
|
95
|
+
id: string;
|
|
96
|
+
|
|
97
|
+
agents: Array<Data.Agent> | null;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Direction of the call (inbound or outbound)
|
|
101
|
+
*/
|
|
102
|
+
callDirection: 'INBOUND' | 'OUTBOUND';
|
|
103
|
+
|
|
104
|
+
createdAt: string | null;
|
|
105
|
+
|
|
106
|
+
customers: Array<Data.Customer> | null;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* ID of the project this call belongs to
|
|
110
|
+
*/
|
|
111
|
+
projectId: string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Timestamp when the call started
|
|
115
|
+
*/
|
|
116
|
+
startedAt: string;
|
|
117
|
+
|
|
118
|
+
status: 'RINGING' | 'IN_PROGRESS' | 'ENDED' | null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export namespace Data {
|
|
122
|
+
export interface Agent {
|
|
123
|
+
id: string;
|
|
124
|
+
|
|
125
|
+
endpoint?: Agent.Endpoint | null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export namespace Agent {
|
|
129
|
+
export interface Endpoint {
|
|
130
|
+
id: string;
|
|
131
|
+
|
|
132
|
+
environment: string;
|
|
133
|
+
|
|
134
|
+
phoneNumberE164?: string | null;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface Customer {
|
|
139
|
+
label?: string | null;
|
|
140
|
+
|
|
141
|
+
phoneNumberE164?: string | null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface CallListResponse {
|
|
147
|
+
data: Array<CallListResponse.Data>;
|
|
148
|
+
|
|
149
|
+
pagination: CallListResponse.Pagination;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export namespace CallListResponse {
|
|
153
|
+
/**
|
|
154
|
+
* Response containing call information
|
|
155
|
+
*/
|
|
156
|
+
export interface Data {
|
|
157
|
+
/**
|
|
158
|
+
* Unique identifier for the call
|
|
159
|
+
*/
|
|
160
|
+
id: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Direction of the call (inbound or outbound)
|
|
164
|
+
*/
|
|
165
|
+
callDirection: 'INBOUND' | 'OUTBOUND';
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* ID of the project this call belongs to
|
|
169
|
+
*/
|
|
170
|
+
projectId: string;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Timestamp when the call started
|
|
174
|
+
*/
|
|
175
|
+
startedAt: string;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Agent information
|
|
179
|
+
*/
|
|
180
|
+
agents?: Array<Data.Agent> | null;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Timestamp when the call record was created
|
|
184
|
+
*/
|
|
185
|
+
createdAt?: string | null;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Customer information
|
|
189
|
+
*/
|
|
190
|
+
customers?: Array<Data.Customer> | null;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Duration of the call in milliseconds
|
|
194
|
+
*/
|
|
195
|
+
durationMs?: number | null;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Timestamp when the call ended
|
|
199
|
+
*/
|
|
200
|
+
endedAt?: string | null;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Status indicating how the call ended
|
|
204
|
+
*/
|
|
205
|
+
endedStatus?:
|
|
206
|
+
| 'PARTICIPANTS_DID_NOT_SPEAK'
|
|
207
|
+
| 'AGENT_DID_NOT_ANSWER'
|
|
208
|
+
| 'AGENT_DID_NOT_SPEAK'
|
|
209
|
+
| 'AGENT_STOPPED_SPEAKING'
|
|
210
|
+
| 'AGENT_ENDED_CALL'
|
|
211
|
+
| 'AGENT_TRANSFERRED_CALL'
|
|
212
|
+
| 'AGENT_BUSY'
|
|
213
|
+
| 'AGENT_ERROR'
|
|
214
|
+
| 'CUSTOMER_ENDED_CALL'
|
|
215
|
+
| 'VOICE_MAIL_REACHED'
|
|
216
|
+
| 'SILENCE_TIME_OUT'
|
|
217
|
+
| 'PHONE_CALL_PROVIDER_CONNECTION_ERROR'
|
|
218
|
+
| 'CUSTOMER_DID_NOT_ANSWER'
|
|
219
|
+
| 'CUSTOMER_DID_NOT_SPEAK'
|
|
220
|
+
| 'CUSTOMER_STOPPED_SPEAKING'
|
|
221
|
+
| 'CUSTOMER_BUSY'
|
|
222
|
+
| 'DIAL_ERROR'
|
|
223
|
+
| 'MAX_DURATION_REACHED'
|
|
224
|
+
| 'UNKNOWN'
|
|
225
|
+
| null;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Custom properties associated with the call
|
|
229
|
+
*/
|
|
230
|
+
properties?: { [key: string]: unknown } | null;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Pre-signed URL to the call recording (expires in 1 hour)
|
|
234
|
+
*/
|
|
235
|
+
recordingUrl?: string | null;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* ID of the simulation job if this call was generated by a simulation
|
|
239
|
+
*/
|
|
240
|
+
simulationJobId?: string | null;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Current status of the call
|
|
244
|
+
*/
|
|
245
|
+
status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED' | null;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Auto-generated summary of the call conversation
|
|
249
|
+
*/
|
|
250
|
+
summary?: string | null;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* ID of the call that superseded this one (if applicable)
|
|
254
|
+
*/
|
|
255
|
+
supersededByCallId?: string | null;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Auto-generated title for the call based on content
|
|
259
|
+
*/
|
|
260
|
+
title?: string | null;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Timestamp when the call record was last updated
|
|
264
|
+
*/
|
|
265
|
+
updatedAt?: string | null;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export namespace Data {
|
|
269
|
+
export interface Agent {
|
|
270
|
+
id: string;
|
|
271
|
+
|
|
272
|
+
endpoint?: Agent.Endpoint | null;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export namespace Agent {
|
|
276
|
+
export interface Endpoint {
|
|
277
|
+
id: string;
|
|
278
|
+
|
|
279
|
+
environment: string;
|
|
280
|
+
|
|
281
|
+
phoneNumberE164?: string | null;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export interface Customer {
|
|
286
|
+
label?: string | null;
|
|
287
|
+
|
|
288
|
+
phoneNumberE164?: string | null;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export interface Pagination {
|
|
293
|
+
/**
|
|
294
|
+
* Whether there are more items to fetch
|
|
295
|
+
*/
|
|
296
|
+
hasMore: boolean;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Cursor for the next page of items
|
|
300
|
+
*/
|
|
301
|
+
nextCursor: string | null;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Total number of items
|
|
305
|
+
*/
|
|
306
|
+
total: number;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
58
310
|
export interface CallGetByIDResponse {
|
|
59
311
|
/**
|
|
60
312
|
* Response containing call information
|
|
@@ -137,6 +389,11 @@ export namespace CallGetByIDResponse {
|
|
|
137
389
|
| 'UNKNOWN'
|
|
138
390
|
| null;
|
|
139
391
|
|
|
392
|
+
/**
|
|
393
|
+
* Custom properties associated with the call
|
|
394
|
+
*/
|
|
395
|
+
properties?: { [key: string]: unknown } | null;
|
|
396
|
+
|
|
140
397
|
/**
|
|
141
398
|
* Pre-signed URL to the call recording (expires in 1 hour)
|
|
142
399
|
*/
|
|
@@ -177,7 +434,7 @@ export namespace CallGetByIDResponse {
|
|
|
177
434
|
export interface Agent {
|
|
178
435
|
id: string;
|
|
179
436
|
|
|
180
|
-
endpoint
|
|
437
|
+
endpoint?: Agent.Endpoint | null;
|
|
181
438
|
}
|
|
182
439
|
|
|
183
440
|
export namespace Agent {
|
|
@@ -191,19 +448,21 @@ export namespace CallGetByIDResponse {
|
|
|
191
448
|
}
|
|
192
449
|
|
|
193
450
|
export interface Customer {
|
|
451
|
+
label?: string | null;
|
|
452
|
+
|
|
194
453
|
phoneNumberE164?: string | null;
|
|
195
454
|
}
|
|
196
455
|
}
|
|
197
456
|
}
|
|
198
457
|
|
|
199
|
-
export interface
|
|
458
|
+
export interface CallListEvaluationRunsResponse {
|
|
200
459
|
/**
|
|
201
460
|
* Evaluation run response payload
|
|
202
461
|
*/
|
|
203
|
-
data: Array<
|
|
462
|
+
data: Array<CallListEvaluationRunsResponse.Data>;
|
|
204
463
|
}
|
|
205
464
|
|
|
206
|
-
export namespace
|
|
465
|
+
export namespace CallListEvaluationRunsResponse {
|
|
207
466
|
export interface Data {
|
|
208
467
|
/**
|
|
209
468
|
* All block runs for this evaluator, including skipped ones
|
|
@@ -384,14 +643,14 @@ export namespace CallGetEvaluationRunsResponse {
|
|
|
384
643
|
}
|
|
385
644
|
}
|
|
386
645
|
|
|
387
|
-
export interface
|
|
646
|
+
export interface CallListMetricsResponse {
|
|
388
647
|
/**
|
|
389
648
|
* Call metrics response payload grouped by metric definition
|
|
390
649
|
*/
|
|
391
|
-
data: Array<
|
|
650
|
+
data: Array<CallListMetricsResponse.Data>;
|
|
392
651
|
}
|
|
393
652
|
|
|
394
|
-
export namespace
|
|
653
|
+
export namespace CallListMetricsResponse {
|
|
395
654
|
/**
|
|
396
655
|
* Call metric data grouped by metric definition
|
|
397
656
|
*/
|
|
@@ -582,14 +841,14 @@ export namespace CallGetMetricsResponse {
|
|
|
582
841
|
}
|
|
583
842
|
}
|
|
584
843
|
|
|
585
|
-
export interface
|
|
844
|
+
export interface CallListSentimentRunsResponse {
|
|
586
845
|
/**
|
|
587
846
|
* Sentiment run response payload
|
|
588
847
|
*/
|
|
589
|
-
data:
|
|
848
|
+
data: CallListSentimentRunsResponse.Data;
|
|
590
849
|
}
|
|
591
850
|
|
|
592
|
-
export namespace
|
|
851
|
+
export namespace CallListSentimentRunsResponse {
|
|
593
852
|
/**
|
|
594
853
|
* Sentiment run response payload
|
|
595
854
|
*/
|
|
@@ -616,7 +875,681 @@ export namespace CallGetSentimentRunsResponse {
|
|
|
616
875
|
}
|
|
617
876
|
}
|
|
618
877
|
|
|
619
|
-
export interface
|
|
878
|
+
export interface CallCreateParams {
|
|
879
|
+
/**
|
|
880
|
+
* Direction of the call (INBOUND or OUTBOUND)
|
|
881
|
+
*/
|
|
882
|
+
callDirection: 'INBOUND' | 'OUTBOUND';
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Interface type of the call (PHONE or WEB)
|
|
886
|
+
*/
|
|
887
|
+
interfaceType: 'PHONE' | 'WEB';
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* URL of source recording (must be an accessible WAV, MP3, or MP4 file). Can be a
|
|
891
|
+
* signed URL.
|
|
892
|
+
*/
|
|
893
|
+
recordingUrl: string;
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* When the call started (ISO 8601 format)
|
|
897
|
+
*/
|
|
898
|
+
startedAt: string;
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Single agent participating in the call. Use this for simpler API when you have
|
|
902
|
+
* only one agent.
|
|
903
|
+
*/
|
|
904
|
+
agent?:
|
|
905
|
+
| CallCreateParams.AgentIdentificationByRoarkID
|
|
906
|
+
| CallCreateParams.AgentIdentificationByName
|
|
907
|
+
| CallCreateParams.AgentIdentificationByCustomID;
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Agents participating in the call. Each agent requires identification and prompt
|
|
911
|
+
* information.
|
|
912
|
+
*/
|
|
913
|
+
agents?: Array<
|
|
914
|
+
| CallCreateParams.AgentIdentificationByRoarkID
|
|
915
|
+
| CallCreateParams.AgentIdentificationByName
|
|
916
|
+
| CallCreateParams.AgentIdentificationByCustomID
|
|
917
|
+
>;
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Single customer participating in the call. Use this for simpler API when you
|
|
921
|
+
* have only one customer.
|
|
922
|
+
*/
|
|
923
|
+
customer?: CallCreateParams.Customer;
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Customers participating in the call.
|
|
927
|
+
*/
|
|
928
|
+
customers?: Array<CallCreateParams.Customer>;
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* High-level call end status, indicating how the call terminated
|
|
932
|
+
*/
|
|
933
|
+
endedStatus?:
|
|
934
|
+
| 'PARTICIPANTS_DID_NOT_SPEAK'
|
|
935
|
+
| 'AGENT_DID_NOT_ANSWER'
|
|
936
|
+
| 'AGENT_DID_NOT_SPEAK'
|
|
937
|
+
| 'AGENT_STOPPED_SPEAKING'
|
|
938
|
+
| 'AGENT_ENDED_CALL'
|
|
939
|
+
| 'AGENT_TRANSFERRED_CALL'
|
|
940
|
+
| 'AGENT_BUSY'
|
|
941
|
+
| 'AGENT_ERROR'
|
|
942
|
+
| 'CUSTOMER_ENDED_CALL'
|
|
943
|
+
| 'VOICE_MAIL_REACHED'
|
|
944
|
+
| 'SILENCE_TIME_OUT'
|
|
945
|
+
| 'PHONE_CALL_PROVIDER_CONNECTION_ERROR'
|
|
946
|
+
| 'CUSTOMER_DID_NOT_ANSWER'
|
|
947
|
+
| 'CUSTOMER_DID_NOT_SPEAK'
|
|
948
|
+
| 'CUSTOMER_STOPPED_SPEAKING'
|
|
949
|
+
| 'CUSTOMER_BUSY'
|
|
950
|
+
| 'DIAL_ERROR'
|
|
951
|
+
| 'MAX_DURATION_REACHED'
|
|
952
|
+
| 'UNKNOWN';
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* Custom properties to include with the call. These can be used for filtering and
|
|
956
|
+
* will show in the call details page
|
|
957
|
+
*/
|
|
958
|
+
properties?: { [key: string]: unknown };
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* URL of source stereo recording. Must be accessible. Can be a signed URL.
|
|
962
|
+
* Supported formats: WAV, MP3, MP4.
|
|
963
|
+
*/
|
|
964
|
+
stereoRecordingUrl?: string;
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* List of tool invocations made during the call
|
|
968
|
+
*/
|
|
969
|
+
toolInvocations?: Array<CallCreateParams.ToolInvocation>;
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* List of transcript entries made during the call
|
|
973
|
+
*/
|
|
974
|
+
transcript?: Array<CallCreateParams.TranscriptEntryAgent | CallCreateParams.TranscriptEntryCustomer>;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
export namespace CallCreateParams {
|
|
978
|
+
export interface AgentIdentificationByRoarkID {
|
|
979
|
+
/**
|
|
980
|
+
* Existing Roark agent ID
|
|
981
|
+
*/
|
|
982
|
+
roarkId: string;
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* Endpoint configuration for this agent (optional)
|
|
986
|
+
*/
|
|
987
|
+
endpoint?:
|
|
988
|
+
| AgentIdentificationByRoarkID.AgentEndpointByID
|
|
989
|
+
| AgentIdentificationByRoarkID.AgentEndpointByValue;
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Agent's prompt configuration (optional)
|
|
993
|
+
*/
|
|
994
|
+
prompt?: AgentIdentificationByRoarkID.Prompt;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
export namespace AgentIdentificationByRoarkID {
|
|
998
|
+
export interface AgentEndpointByID {
|
|
999
|
+
/**
|
|
1000
|
+
* Existing Roark endpoint ID
|
|
1001
|
+
*/
|
|
1002
|
+
id: string;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* Lookup or create endpoint if one with these values does not exist
|
|
1007
|
+
*/
|
|
1008
|
+
export interface AgentEndpointByValue {
|
|
1009
|
+
/**
|
|
1010
|
+
* Type of endpoint (phone or websocket)
|
|
1011
|
+
*/
|
|
1012
|
+
type: string;
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* Endpoint value (phone number in E.164 format or websocket URL)
|
|
1016
|
+
*/
|
|
1017
|
+
value: string;
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Call direction for this endpoint
|
|
1021
|
+
*/
|
|
1022
|
+
direction?: string;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Agent's prompt configuration (optional)
|
|
1027
|
+
*/
|
|
1028
|
+
export interface Prompt {
|
|
1029
|
+
/**
|
|
1030
|
+
* The agent's system prompt used during this call
|
|
1031
|
+
*/
|
|
1032
|
+
resolvedPrompt: string;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* Create a new agent or find existing by customId if provided
|
|
1038
|
+
*/
|
|
1039
|
+
export interface AgentIdentificationByName {
|
|
1040
|
+
/**
|
|
1041
|
+
* Agent name
|
|
1042
|
+
*/
|
|
1043
|
+
name: string;
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* Agent custom ID
|
|
1047
|
+
*/
|
|
1048
|
+
customId?: string;
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* Agent description
|
|
1052
|
+
*/
|
|
1053
|
+
description?: string;
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* Endpoint configuration for this agent (optional)
|
|
1057
|
+
*/
|
|
1058
|
+
endpoint?: AgentIdentificationByName.AgentEndpointByID | AgentIdentificationByName.AgentEndpointByValue;
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* Agent's prompt configuration (optional)
|
|
1062
|
+
*/
|
|
1063
|
+
prompt?: AgentIdentificationByName.Prompt;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
export namespace AgentIdentificationByName {
|
|
1067
|
+
export interface AgentEndpointByID {
|
|
1068
|
+
/**
|
|
1069
|
+
* Existing Roark endpoint ID
|
|
1070
|
+
*/
|
|
1071
|
+
id: string;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Lookup or create endpoint if one with these values does not exist
|
|
1076
|
+
*/
|
|
1077
|
+
export interface AgentEndpointByValue {
|
|
1078
|
+
/**
|
|
1079
|
+
* Type of endpoint (phone or websocket)
|
|
1080
|
+
*/
|
|
1081
|
+
type: string;
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Endpoint value (phone number in E.164 format or websocket URL)
|
|
1085
|
+
*/
|
|
1086
|
+
value: string;
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* Call direction for this endpoint
|
|
1090
|
+
*/
|
|
1091
|
+
direction?: string;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* Agent's prompt configuration (optional)
|
|
1096
|
+
*/
|
|
1097
|
+
export interface Prompt {
|
|
1098
|
+
/**
|
|
1099
|
+
* The agent's system prompt used during this call
|
|
1100
|
+
*/
|
|
1101
|
+
resolvedPrompt: string;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
export interface AgentIdentificationByCustomID {
|
|
1106
|
+
/**
|
|
1107
|
+
* Existing custom ID for a Roark agent
|
|
1108
|
+
*/
|
|
1109
|
+
customId: string;
|
|
1110
|
+
|
|
1111
|
+
/**
|
|
1112
|
+
* Endpoint configuration for this agent (optional)
|
|
1113
|
+
*/
|
|
1114
|
+
endpoint?:
|
|
1115
|
+
| AgentIdentificationByCustomID.AgentEndpointByID
|
|
1116
|
+
| AgentIdentificationByCustomID.AgentEndpointByValue;
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* Agent's prompt configuration (optional)
|
|
1120
|
+
*/
|
|
1121
|
+
prompt?: AgentIdentificationByCustomID.Prompt;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
export namespace AgentIdentificationByCustomID {
|
|
1125
|
+
export interface AgentEndpointByID {
|
|
1126
|
+
/**
|
|
1127
|
+
* Existing Roark endpoint ID
|
|
1128
|
+
*/
|
|
1129
|
+
id: string;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
/**
|
|
1133
|
+
* Lookup or create endpoint if one with these values does not exist
|
|
1134
|
+
*/
|
|
1135
|
+
export interface AgentEndpointByValue {
|
|
1136
|
+
/**
|
|
1137
|
+
* Type of endpoint (phone or websocket)
|
|
1138
|
+
*/
|
|
1139
|
+
type: string;
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* Endpoint value (phone number in E.164 format or websocket URL)
|
|
1143
|
+
*/
|
|
1144
|
+
value: string;
|
|
1145
|
+
|
|
1146
|
+
/**
|
|
1147
|
+
* Call direction for this endpoint
|
|
1148
|
+
*/
|
|
1149
|
+
direction?: string;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* Agent's prompt configuration (optional)
|
|
1154
|
+
*/
|
|
1155
|
+
export interface Prompt {
|
|
1156
|
+
/**
|
|
1157
|
+
* The agent's system prompt used during this call
|
|
1158
|
+
*/
|
|
1159
|
+
resolvedPrompt: string;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
export interface AgentIdentificationByRoarkID {
|
|
1164
|
+
/**
|
|
1165
|
+
* Existing Roark agent ID
|
|
1166
|
+
*/
|
|
1167
|
+
roarkId: string;
|
|
1168
|
+
|
|
1169
|
+
/**
|
|
1170
|
+
* Endpoint configuration for this agent (optional)
|
|
1171
|
+
*/
|
|
1172
|
+
endpoint?:
|
|
1173
|
+
| AgentIdentificationByRoarkID.AgentEndpointByID
|
|
1174
|
+
| AgentIdentificationByRoarkID.AgentEndpointByValue;
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Agent's prompt configuration (optional)
|
|
1178
|
+
*/
|
|
1179
|
+
prompt?: AgentIdentificationByRoarkID.Prompt;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
export namespace AgentIdentificationByRoarkID {
|
|
1183
|
+
export interface AgentEndpointByID {
|
|
1184
|
+
/**
|
|
1185
|
+
* Existing Roark endpoint ID
|
|
1186
|
+
*/
|
|
1187
|
+
id: string;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* Lookup or create endpoint if one with these values does not exist
|
|
1192
|
+
*/
|
|
1193
|
+
export interface AgentEndpointByValue {
|
|
1194
|
+
/**
|
|
1195
|
+
* Type of endpoint (phone or websocket)
|
|
1196
|
+
*/
|
|
1197
|
+
type: string;
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* Endpoint value (phone number in E.164 format or websocket URL)
|
|
1201
|
+
*/
|
|
1202
|
+
value: string;
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* Call direction for this endpoint
|
|
1206
|
+
*/
|
|
1207
|
+
direction?: string;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* Agent's prompt configuration (optional)
|
|
1212
|
+
*/
|
|
1213
|
+
export interface Prompt {
|
|
1214
|
+
/**
|
|
1215
|
+
* The agent's system prompt used during this call
|
|
1216
|
+
*/
|
|
1217
|
+
resolvedPrompt: string;
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* Create a new agent or find existing by customId if provided
|
|
1223
|
+
*/
|
|
1224
|
+
export interface AgentIdentificationByName {
|
|
1225
|
+
/**
|
|
1226
|
+
* Agent name
|
|
1227
|
+
*/
|
|
1228
|
+
name: string;
|
|
1229
|
+
|
|
1230
|
+
/**
|
|
1231
|
+
* Agent custom ID
|
|
1232
|
+
*/
|
|
1233
|
+
customId?: string;
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* Agent description
|
|
1237
|
+
*/
|
|
1238
|
+
description?: string;
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* Endpoint configuration for this agent (optional)
|
|
1242
|
+
*/
|
|
1243
|
+
endpoint?: AgentIdentificationByName.AgentEndpointByID | AgentIdentificationByName.AgentEndpointByValue;
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Agent's prompt configuration (optional)
|
|
1247
|
+
*/
|
|
1248
|
+
prompt?: AgentIdentificationByName.Prompt;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
export namespace AgentIdentificationByName {
|
|
1252
|
+
export interface AgentEndpointByID {
|
|
1253
|
+
/**
|
|
1254
|
+
* Existing Roark endpoint ID
|
|
1255
|
+
*/
|
|
1256
|
+
id: string;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* Lookup or create endpoint if one with these values does not exist
|
|
1261
|
+
*/
|
|
1262
|
+
export interface AgentEndpointByValue {
|
|
1263
|
+
/**
|
|
1264
|
+
* Type of endpoint (phone or websocket)
|
|
1265
|
+
*/
|
|
1266
|
+
type: string;
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Endpoint value (phone number in E.164 format or websocket URL)
|
|
1270
|
+
*/
|
|
1271
|
+
value: string;
|
|
1272
|
+
|
|
1273
|
+
/**
|
|
1274
|
+
* Call direction for this endpoint
|
|
1275
|
+
*/
|
|
1276
|
+
direction?: string;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* Agent's prompt configuration (optional)
|
|
1281
|
+
*/
|
|
1282
|
+
export interface Prompt {
|
|
1283
|
+
/**
|
|
1284
|
+
* The agent's system prompt used during this call
|
|
1285
|
+
*/
|
|
1286
|
+
resolvedPrompt: string;
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
export interface AgentIdentificationByCustomID {
|
|
1291
|
+
/**
|
|
1292
|
+
* Existing custom ID for a Roark agent
|
|
1293
|
+
*/
|
|
1294
|
+
customId: string;
|
|
1295
|
+
|
|
1296
|
+
/**
|
|
1297
|
+
* Endpoint configuration for this agent (optional)
|
|
1298
|
+
*/
|
|
1299
|
+
endpoint?:
|
|
1300
|
+
| AgentIdentificationByCustomID.AgentEndpointByID
|
|
1301
|
+
| AgentIdentificationByCustomID.AgentEndpointByValue;
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* Agent's prompt configuration (optional)
|
|
1305
|
+
*/
|
|
1306
|
+
prompt?: AgentIdentificationByCustomID.Prompt;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
export namespace AgentIdentificationByCustomID {
|
|
1310
|
+
export interface AgentEndpointByID {
|
|
1311
|
+
/**
|
|
1312
|
+
* Existing Roark endpoint ID
|
|
1313
|
+
*/
|
|
1314
|
+
id: string;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* Lookup or create endpoint if one with these values does not exist
|
|
1319
|
+
*/
|
|
1320
|
+
export interface AgentEndpointByValue {
|
|
1321
|
+
/**
|
|
1322
|
+
* Type of endpoint (phone or websocket)
|
|
1323
|
+
*/
|
|
1324
|
+
type: string;
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Endpoint value (phone number in E.164 format or websocket URL)
|
|
1328
|
+
*/
|
|
1329
|
+
value: string;
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* Call direction for this endpoint
|
|
1333
|
+
*/
|
|
1334
|
+
direction?: string;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* Agent's prompt configuration (optional)
|
|
1339
|
+
*/
|
|
1340
|
+
export interface Prompt {
|
|
1341
|
+
/**
|
|
1342
|
+
* The agent's system prompt used during this call
|
|
1343
|
+
*/
|
|
1344
|
+
resolvedPrompt: string;
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* Single customer participating in the call. Use this for simpler API when you
|
|
1350
|
+
* have only one customer.
|
|
1351
|
+
*/
|
|
1352
|
+
export interface Customer {
|
|
1353
|
+
/**
|
|
1354
|
+
* Customer phone number in E.164 format (e.g., +14155551234)
|
|
1355
|
+
*/
|
|
1356
|
+
phoneNumberE164: string | null;
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* Label to identify this customer in the transcript (e.g., "speaker-01",
|
|
1360
|
+
* "speaker-02")
|
|
1361
|
+
*/
|
|
1362
|
+
label?: string | null;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* Customer participating in the call
|
|
1367
|
+
*/
|
|
1368
|
+
export interface Customer {
|
|
1369
|
+
/**
|
|
1370
|
+
* Customer phone number in E.164 format (e.g., +14155551234)
|
|
1371
|
+
*/
|
|
1372
|
+
phoneNumberE164: string | null;
|
|
1373
|
+
|
|
1374
|
+
/**
|
|
1375
|
+
* Label to identify this customer in the transcript (e.g., "speaker-01",
|
|
1376
|
+
* "speaker-02")
|
|
1377
|
+
*/
|
|
1378
|
+
label?: string | null;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
export interface ToolInvocation {
|
|
1382
|
+
/**
|
|
1383
|
+
* Name of the tool that was invoked
|
|
1384
|
+
*/
|
|
1385
|
+
name: string;
|
|
1386
|
+
|
|
1387
|
+
/**
|
|
1388
|
+
* Parameters provided to the tool during invocation
|
|
1389
|
+
*/
|
|
1390
|
+
parameters: { [key: string]: ToolInvocation.UnionMember0 | unknown };
|
|
1391
|
+
|
|
1392
|
+
/**
|
|
1393
|
+
* Result returned by the tool after execution. Can be a string or a JSON object
|
|
1394
|
+
*/
|
|
1395
|
+
result: string | { [key: string]: unknown };
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* Offset in milliseconds from the start of the call when the tool was invoked
|
|
1399
|
+
*/
|
|
1400
|
+
startOffsetMs: number;
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* Metadata about the agent that invoked this tool - used to match which agent from
|
|
1404
|
+
* the agents array this tool invocation belongs to
|
|
1405
|
+
*/
|
|
1406
|
+
agent?: ToolInvocation.Agent;
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Description of when the tool should be invoked
|
|
1410
|
+
*/
|
|
1411
|
+
description?: string;
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* Offset in milliseconds from the start of the call when the tool execution
|
|
1415
|
+
* completed. Used to calculate duration of the tool execution
|
|
1416
|
+
*/
|
|
1417
|
+
endOffsetMs?: number;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
export namespace ToolInvocation {
|
|
1421
|
+
export interface UnionMember0 {
|
|
1422
|
+
description?: string;
|
|
1423
|
+
|
|
1424
|
+
type?: 'string' | 'number' | 'boolean';
|
|
1425
|
+
|
|
1426
|
+
value?: unknown;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* Metadata about the agent that invoked this tool - used to match which agent from
|
|
1431
|
+
* the agents array this tool invocation belongs to
|
|
1432
|
+
*/
|
|
1433
|
+
export interface Agent {
|
|
1434
|
+
/**
|
|
1435
|
+
* The custom ID set on the agent
|
|
1436
|
+
*/
|
|
1437
|
+
customId?: string;
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* The Roark ID of the agent
|
|
1441
|
+
*/
|
|
1442
|
+
roarkId?: string;
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
export interface TranscriptEntryAgent {
|
|
1447
|
+
endOffsetMs: number;
|
|
1448
|
+
|
|
1449
|
+
role: 'AGENT';
|
|
1450
|
+
|
|
1451
|
+
startOffsetMs: number;
|
|
1452
|
+
|
|
1453
|
+
text: string;
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* Metadata about the agent that spoke this turn - used to match which agent from
|
|
1457
|
+
* the `agents` array this transcript entry belongs to
|
|
1458
|
+
*/
|
|
1459
|
+
agent?: TranscriptEntryAgent.Agent;
|
|
1460
|
+
|
|
1461
|
+
languageCode?: string;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
export namespace TranscriptEntryAgent {
|
|
1465
|
+
/**
|
|
1466
|
+
* Metadata about the agent that spoke this turn - used to match which agent from
|
|
1467
|
+
* the `agents` array this transcript entry belongs to
|
|
1468
|
+
*/
|
|
1469
|
+
export interface Agent {
|
|
1470
|
+
/**
|
|
1471
|
+
* The custom ID set on the agent
|
|
1472
|
+
*/
|
|
1473
|
+
customId?: string;
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* The Roark ID of the agent
|
|
1477
|
+
*/
|
|
1478
|
+
roarkId?: string;
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
export interface TranscriptEntryCustomer {
|
|
1483
|
+
endOffsetMs: number;
|
|
1484
|
+
|
|
1485
|
+
role: 'CUSTOMER';
|
|
1486
|
+
|
|
1487
|
+
startOffsetMs: number;
|
|
1488
|
+
|
|
1489
|
+
text: string;
|
|
1490
|
+
|
|
1491
|
+
/**
|
|
1492
|
+
* Metadata about the customer that spoke this turn - used to match which customer
|
|
1493
|
+
* from the `customers` array this transcript entry belongs to
|
|
1494
|
+
*/
|
|
1495
|
+
customer?: TranscriptEntryCustomer.Customer;
|
|
1496
|
+
|
|
1497
|
+
languageCode?: string;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
export namespace TranscriptEntryCustomer {
|
|
1501
|
+
/**
|
|
1502
|
+
* Metadata about the customer that spoke this turn - used to match which customer
|
|
1503
|
+
* from the `customers` array this transcript entry belongs to
|
|
1504
|
+
*/
|
|
1505
|
+
export interface Customer {
|
|
1506
|
+
/**
|
|
1507
|
+
* Label matching the `label` field on the `customers` array when creating the call
|
|
1508
|
+
*/
|
|
1509
|
+
label?: string;
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* The phone number of the customer in E.164 format, matching the `phoneNumberE164`
|
|
1513
|
+
* field on the `customers` array when creating the call
|
|
1514
|
+
*/
|
|
1515
|
+
phoneNumberE164?: string;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
export interface CallListParams {
|
|
1521
|
+
/**
|
|
1522
|
+
* Cursor for pagination - use the nextCursor value from a previous response
|
|
1523
|
+
*/
|
|
1524
|
+
after?: string;
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* Maximum number of calls to return (default: 20, max: 100)
|
|
1528
|
+
*/
|
|
1529
|
+
limit?: number;
|
|
1530
|
+
|
|
1531
|
+
/**
|
|
1532
|
+
* Search text to filter calls by title, summary, or transcript
|
|
1533
|
+
*/
|
|
1534
|
+
searchText?: string;
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* Field to sort by (default: createdAt)
|
|
1538
|
+
*/
|
|
1539
|
+
sortBy?: 'createdAt' | 'startedAt' | 'endedAt' | 'duration' | 'title' | 'status';
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* Sort direction (default: desc)
|
|
1543
|
+
*/
|
|
1544
|
+
sortDirection?: 'asc' | 'desc';
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* Filter by call status
|
|
1548
|
+
*/
|
|
1549
|
+
status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED';
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
export interface CallListMetricsParams {
|
|
620
1553
|
/**
|
|
621
1554
|
* Whether to return a flat list instead of grouped by metric definition (default:
|
|
622
1555
|
* false)
|
|
@@ -626,10 +1559,14 @@ export interface CallGetMetricsParams {
|
|
|
626
1559
|
|
|
627
1560
|
export declare namespace Call {
|
|
628
1561
|
export {
|
|
1562
|
+
type CallCreateResponse as CallCreateResponse,
|
|
1563
|
+
type CallListResponse as CallListResponse,
|
|
629
1564
|
type CallGetByIDResponse as CallGetByIDResponse,
|
|
630
|
-
type
|
|
631
|
-
type
|
|
632
|
-
type
|
|
633
|
-
type
|
|
1565
|
+
type CallListEvaluationRunsResponse as CallListEvaluationRunsResponse,
|
|
1566
|
+
type CallListMetricsResponse as CallListMetricsResponse,
|
|
1567
|
+
type CallListSentimentRunsResponse as CallListSentimentRunsResponse,
|
|
1568
|
+
type CallCreateParams as CallCreateParams,
|
|
1569
|
+
type CallListParams as CallListParams,
|
|
1570
|
+
type CallListMetricsParams as CallListMetricsParams,
|
|
634
1571
|
};
|
|
635
1572
|
}
|