@roarkanalytics/sdk 2.30.0 → 2.33.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 (245) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/client.d.mts +17 -5
  9. package/client.d.mts.map +1 -1
  10. package/client.d.ts +17 -5
  11. package/client.d.ts.map +1 -1
  12. package/client.js +35 -4
  13. package/client.js.map +1 -1
  14. package/client.mjs +35 -4
  15. package/client.mjs.map +1 -1
  16. package/core/api-promise.d.mts.map +1 -1
  17. package/core/api-promise.d.ts.map +1 -1
  18. package/core/api-promise.mjs.map +1 -1
  19. package/core/error.mjs.map +1 -1
  20. package/core/resource.d.mts.map +1 -1
  21. package/core/resource.d.ts.map +1 -1
  22. package/core/uploads.d.mts.map +1 -1
  23. package/core/uploads.d.ts.map +1 -1
  24. package/core/uploads.mjs.map +1 -1
  25. package/error.d.mts +1 -0
  26. package/error.d.mts.map +1 -1
  27. package/error.d.ts +1 -0
  28. package/error.d.ts.map +1 -1
  29. package/error.mjs +1 -0
  30. package/error.mjs.map +1 -1
  31. package/index.d.mts.map +1 -1
  32. package/index.d.ts.map +1 -1
  33. package/index.mjs.map +1 -1
  34. package/internal/detect-platform.mjs.map +1 -1
  35. package/internal/headers.mjs.map +1 -1
  36. package/internal/parse.d.mts.map +1 -1
  37. package/internal/parse.d.ts.map +1 -1
  38. package/internal/parse.mjs.map +1 -1
  39. package/internal/qs/formats.d.mts.map +1 -1
  40. package/internal/qs/formats.d.ts.map +1 -1
  41. package/internal/qs/index.d.mts +2 -2
  42. package/internal/qs/index.d.mts.map +1 -1
  43. package/internal/qs/index.d.ts +2 -2
  44. package/internal/qs/index.d.ts.map +1 -1
  45. package/internal/qs/index.mjs.map +1 -1
  46. package/internal/qs/stringify.d.mts.map +1 -1
  47. package/internal/qs/stringify.d.ts.map +1 -1
  48. package/internal/qs/stringify.mjs.map +1 -1
  49. package/internal/qs/utils.d.mts.map +1 -1
  50. package/internal/qs/utils.d.ts.map +1 -1
  51. package/internal/qs/utils.mjs.map +1 -1
  52. package/internal/request-options.d.mts.map +1 -1
  53. package/internal/request-options.d.ts.map +1 -1
  54. package/internal/shims.d.mts +6 -0
  55. package/internal/shims.d.mts.map +1 -1
  56. package/internal/shims.d.ts +6 -0
  57. package/internal/shims.d.ts.map +1 -1
  58. package/internal/to-file.d.mts.map +1 -1
  59. package/internal/to-file.d.ts.map +1 -1
  60. package/internal/to-file.mjs.map +1 -1
  61. package/internal/types.d.mts +10 -10
  62. package/internal/types.d.mts.map +1 -1
  63. package/internal/types.d.ts +10 -10
  64. package/internal/types.d.ts.map +1 -1
  65. package/internal/uploads.d.mts.map +1 -1
  66. package/internal/uploads.d.ts.map +1 -1
  67. package/internal/uploads.mjs.map +1 -1
  68. package/internal/utils/base64.mjs.map +1 -1
  69. package/internal/utils/log.d.mts.map +1 -1
  70. package/internal/utils/log.d.ts.map +1 -1
  71. package/internal/utils/log.js +2 -0
  72. package/internal/utils/log.js.map +1 -1
  73. package/internal/utils/log.mjs +2 -0
  74. package/internal/utils/log.mjs.map +1 -1
  75. package/internal/utils/path.mjs.map +1 -1
  76. package/internal/utils/query.mjs.map +1 -1
  77. package/internal/utils/values.mjs.map +1 -1
  78. package/internal/utils.d.mts.map +1 -1
  79. package/internal/utils.d.ts.map +1 -1
  80. package/internal/utils.mjs.map +1 -1
  81. package/package.json +1 -1
  82. package/resource.d.mts +1 -0
  83. package/resource.d.mts.map +1 -1
  84. package/resource.d.ts +1 -0
  85. package/resource.d.ts.map +1 -1
  86. package/resource.mjs +1 -0
  87. package/resource.mjs.map +1 -1
  88. package/resources/agent-endpoint.d.mts +4 -4
  89. package/resources/agent-endpoint.d.mts.map +1 -1
  90. package/resources/agent-endpoint.d.ts +4 -4
  91. package/resources/agent-endpoint.d.ts.map +1 -1
  92. package/resources/agent-endpoint.mjs.map +1 -1
  93. package/resources/agent.d.mts.map +1 -1
  94. package/resources/agent.d.ts.map +1 -1
  95. package/resources/agent.mjs.map +1 -1
  96. package/resources/call.d.mts +310 -162
  97. package/resources/call.d.mts.map +1 -1
  98. package/resources/call.d.ts +310 -162
  99. package/resources/call.d.ts.map +1 -1
  100. package/resources/call.js +6 -7
  101. package/resources/call.js.map +1 -1
  102. package/resources/call.mjs +6 -7
  103. package/resources/call.mjs.map +1 -1
  104. package/resources/config.d.mts +535 -0
  105. package/resources/config.d.mts.map +1 -0
  106. package/resources/config.d.ts +535 -0
  107. package/resources/config.d.ts.map +1 -0
  108. package/resources/config.js +28 -0
  109. package/resources/config.js.map +1 -0
  110. package/resources/config.mjs +24 -0
  111. package/resources/config.mjs.map +1 -0
  112. package/resources/customer-flow-edge-case.d.mts +1742 -0
  113. package/resources/customer-flow-edge-case.d.mts.map +1 -0
  114. package/resources/customer-flow-edge-case.d.ts +1742 -0
  115. package/resources/customer-flow-edge-case.d.ts.map +1 -0
  116. package/resources/customer-flow-edge-case.js +50 -0
  117. package/resources/customer-flow-edge-case.js.map +1 -0
  118. package/resources/customer-flow-edge-case.mjs +46 -0
  119. package/resources/customer-flow-edge-case.mjs.map +1 -0
  120. package/resources/customer-flow.d.mts +7163 -0
  121. package/resources/customer-flow.d.mts.map +1 -0
  122. package/resources/customer-flow.d.ts +7163 -0
  123. package/resources/customer-flow.d.ts.map +1 -0
  124. package/resources/customer-flow.js +87 -0
  125. package/resources/customer-flow.js.map +1 -0
  126. package/resources/customer-flow.mjs +83 -0
  127. package/resources/customer-flow.mjs.map +1 -0
  128. package/resources/health.d.mts.map +1 -1
  129. package/resources/health.d.ts.map +1 -1
  130. package/resources/health.mjs.map +1 -1
  131. package/resources/http-request-definition.d.mts.map +1 -1
  132. package/resources/http-request-definition.d.ts.map +1 -1
  133. package/resources/http-request-definition.mjs.map +1 -1
  134. package/resources/index.d.mts +6 -2
  135. package/resources/index.d.mts.map +1 -1
  136. package/resources/index.d.ts +6 -2
  137. package/resources/index.d.ts.map +1 -1
  138. package/resources/index.js +11 -3
  139. package/resources/index.js.map +1 -1
  140. package/resources/index.mjs +5 -1
  141. package/resources/index.mjs.map +1 -1
  142. package/resources/metric-collection-job.d.mts +5 -3
  143. package/resources/metric-collection-job.d.mts.map +1 -1
  144. package/resources/metric-collection-job.d.ts +5 -3
  145. package/resources/metric-collection-job.d.ts.map +1 -1
  146. package/resources/metric-collection-job.mjs.map +1 -1
  147. package/resources/metric-policy.d.mts.map +1 -1
  148. package/resources/metric-policy.d.ts.map +1 -1
  149. package/resources/metric-policy.mjs.map +1 -1
  150. package/resources/metric.d.mts +804 -109
  151. package/resources/metric.d.mts.map +1 -1
  152. package/resources/metric.d.ts +804 -109
  153. package/resources/metric.d.ts.map +1 -1
  154. package/resources/metric.js +6 -7
  155. package/resources/metric.js.map +1 -1
  156. package/resources/metric.mjs +6 -7
  157. package/resources/metric.mjs.map +1 -1
  158. package/resources/simulation-environment.d.mts +95 -0
  159. package/resources/simulation-environment.d.mts.map +1 -0
  160. package/resources/simulation-environment.d.ts +95 -0
  161. package/resources/simulation-environment.d.ts.map +1 -0
  162. package/resources/simulation-environment.js +24 -0
  163. package/resources/simulation-environment.js.map +1 -0
  164. package/resources/simulation-environment.mjs +20 -0
  165. package/resources/simulation-environment.mjs.map +1 -0
  166. package/resources/simulation-job.d.mts +58 -10
  167. package/resources/simulation-job.d.mts.map +1 -1
  168. package/resources/simulation-job.d.ts +58 -10
  169. package/resources/simulation-job.d.ts.map +1 -1
  170. package/resources/simulation-job.mjs.map +1 -1
  171. package/resources/simulation-persona.d.mts +60 -24
  172. package/resources/simulation-persona.d.mts.map +1 -1
  173. package/resources/simulation-persona.d.ts +60 -24
  174. package/resources/simulation-persona.d.ts.map +1 -1
  175. package/resources/simulation-persona.mjs.map +1 -1
  176. package/resources/simulation-run-plan-job.d.mts +73 -32
  177. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  178. package/resources/simulation-run-plan-job.d.ts +73 -32
  179. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  180. package/resources/simulation-run-plan-job.js +7 -8
  181. package/resources/simulation-run-plan-job.js.map +1 -1
  182. package/resources/simulation-run-plan-job.mjs +7 -8
  183. package/resources/simulation-run-plan-job.mjs.map +1 -1
  184. package/resources/simulation-run-plan.d.mts +408 -39
  185. package/resources/simulation-run-plan.d.mts.map +1 -1
  186. package/resources/simulation-run-plan.d.ts +408 -39
  187. package/resources/simulation-run-plan.d.ts.map +1 -1
  188. package/resources/simulation-run-plan.js +6 -11
  189. package/resources/simulation-run-plan.js.map +1 -1
  190. package/resources/simulation-run-plan.mjs +6 -11
  191. package/resources/simulation-run-plan.mjs.map +1 -1
  192. package/resources/simulation.d.mts +379 -0
  193. package/resources/simulation.d.mts.map +1 -0
  194. package/resources/simulation.d.ts +379 -0
  195. package/resources/simulation.d.ts.map +1 -0
  196. package/resources/simulation.js +33 -0
  197. package/resources/simulation.js.map +1 -0
  198. package/resources/simulation.mjs +29 -0
  199. package/resources/simulation.mjs.map +1 -0
  200. package/resources/webhook.d.mts +4 -4
  201. package/resources/webhook.d.mts.map +1 -1
  202. package/resources/webhook.d.ts +4 -4
  203. package/resources/webhook.d.ts.map +1 -1
  204. package/resources/webhook.mjs.map +1 -1
  205. package/resources.d.mts.map +1 -1
  206. package/resources.d.ts.map +1 -1
  207. package/resources.mjs.map +1 -1
  208. package/src/client.ts +124 -28
  209. package/src/internal/types.ts +6 -8
  210. package/src/internal/utils/log.ts +2 -0
  211. package/src/resources/agent-endpoint.ts +36 -4
  212. package/src/resources/call.ts +333 -176
  213. package/src/resources/config.ts +1162 -0
  214. package/src/resources/customer-flow-edge-case.ts +2884 -0
  215. package/src/resources/customer-flow.ts +11713 -0
  216. package/src/resources/index.ts +42 -12
  217. package/src/resources/metric-collection-job.ts +5 -3
  218. package/src/resources/metric.ts +1057 -115
  219. package/src/resources/simulation-environment.ts +147 -0
  220. package/src/resources/simulation-job.ts +122 -10
  221. package/src/resources/simulation-persona.ts +192 -24
  222. package/src/resources/simulation-run-plan-job.ts +109 -27
  223. package/src/resources/simulation-run-plan.ts +445 -40
  224. package/src/resources/simulation.ts +444 -0
  225. package/src/resources/webhook.ts +8 -0
  226. package/src/version.ts +1 -1
  227. package/uploads.d.mts +1 -0
  228. package/uploads.d.mts.map +1 -1
  229. package/uploads.d.ts +1 -0
  230. package/uploads.d.ts.map +1 -1
  231. package/uploads.mjs +1 -0
  232. package/uploads.mjs.map +1 -1
  233. package/version.d.mts +1 -1
  234. package/version.d.ts +1 -1
  235. package/version.js +1 -1
  236. package/version.mjs +1 -1
  237. package/resources/simulation-scenario.d.mts +0 -424
  238. package/resources/simulation-scenario.d.mts.map +0 -1
  239. package/resources/simulation-scenario.d.ts +0 -424
  240. package/resources/simulation-scenario.d.ts.map +0 -1
  241. package/resources/simulation-scenario.js +0 -40
  242. package/resources/simulation-scenario.js.map +0 -1
  243. package/resources/simulation-scenario.mjs +0 -36
  244. package/resources/simulation-scenario.mjs.map +0 -1
  245. package/src/resources/simulation-scenario.ts +0 -602
@@ -19,13 +19,14 @@ export declare class Call extends APIResource {
19
19
  * transcription source; otherwise the best available source is used automatically.
20
20
  */
21
21
  getTranscript(callID: string, query?: CallGetTranscriptParams | null | undefined, options?: RequestOptions): APIPromise<CallGetTranscriptResponse>;
22
- /**
23
- * Fetch all evaluation run results for a specific call.
24
- */
25
- listEvaluationRuns(callID: string, options?: RequestOptions): APIPromise<CallListEvaluationRunsResponse>;
26
22
  /**
27
23
  * Fetch all call-level metrics for a specific call, including both
28
- * system-generated and custom metrics. Only returns successfully computed metrics.
24
+ * system-generated and custom metrics. Only returns rows from the **latest**
25
+ * metric-collection job per metric — if the same metric has been recomputed, prior
26
+ * runs are excluded and remain in the metric history. By default returns only
27
+ * successfully computed metrics; pass `?status=all` to also include rows that
28
+ * resolved as NOT_APPLICABLE / DATA_MISSING / ERROR (the `value` field is omitted
29
+ * on those entries — check `captureStatus`).
29
30
  */
30
31
  listMetrics(callID: string, query?: CallListMetricsParams | null | undefined, options?: RequestOptions): APIPromise<CallListMetricsResponse>;
31
32
  /**
@@ -56,6 +57,7 @@ export declare namespace CallCreateResponse {
56
57
  callDirection: 'INBOUND' | 'OUTBOUND';
57
58
  createdAt: string | null;
58
59
  customers: Array<Data.Customer> | null;
60
+ externalId: string | null;
59
61
  /**
60
62
  * ID of the project this call belongs to
61
63
  */
@@ -105,6 +107,13 @@ export declare namespace CallListResponse {
105
107
  * ID of the project this call belongs to
106
108
  */
107
109
  projectId: string;
110
+ /**
111
+ * Indicates the status of `recordingUrl`. `AVAILABLE`: signed URL returned.
112
+ * `NOT_AVAILABLE`: no recording on file yet (e.g. still processing). `RESTRICTED`:
113
+ * the calling API key does not have the `recording:read` permission and the URL
114
+ * has been withheld.
115
+ */
116
+ recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED';
108
117
  /**
109
118
  * Timestamp when the call started
110
119
  */
@@ -133,6 +142,11 @@ export declare namespace CallListResponse {
133
142
  * Status indicating how the call ended
134
143
  */
135
144
  endedStatus?: 'PARTICIPANTS_DID_NOT_SPEAK' | 'AGENT_DID_NOT_ANSWER' | 'AGENT_DID_NOT_SPEAK' | 'AGENT_STOPPED_SPEAKING' | 'AGENT_ENDED_CALL' | 'AGENT_TRANSFERRED_CALL' | 'AGENT_BUSY' | 'AGENT_ERROR' | 'CUSTOMER_ENDED_CALL' | 'VOICE_MAIL_REACHED' | 'SILENCE_TIME_OUT' | 'PHONE_CALL_PROVIDER_CONNECTION_ERROR' | 'CUSTOMER_DID_NOT_ANSWER' | 'CUSTOMER_DID_NOT_SPEAK' | 'CUSTOMER_STOPPED_SPEAKING' | 'CUSTOMER_BUSY' | 'DIAL_ERROR' | 'MAX_DURATION_REACHED' | 'UNKNOWN' | null;
145
+ /**
146
+ * Caller-supplied correlation ID echoed back from the create request, if any was
147
+ * provided
148
+ */
149
+ externalId?: string | null;
136
150
  /**
137
151
  * IDs of metric policies that have been applied to this call
138
152
  */
@@ -227,6 +241,13 @@ export declare namespace CallGetByIDResponse {
227
241
  * ID of the project this call belongs to
228
242
  */
229
243
  projectId: string;
244
+ /**
245
+ * Indicates the status of `recordingUrl`. `AVAILABLE`: signed URL returned.
246
+ * `NOT_AVAILABLE`: no recording on file yet (e.g. still processing). `RESTRICTED`:
247
+ * the calling API key does not have the `recording:read` permission and the URL
248
+ * has been withheld.
249
+ */
250
+ recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED';
230
251
  /**
231
252
  * Timestamp when the call started
232
253
  */
@@ -255,6 +276,11 @@ export declare namespace CallGetByIDResponse {
255
276
  * Status indicating how the call ended
256
277
  */
257
278
  endedStatus?: 'PARTICIPANTS_DID_NOT_SPEAK' | 'AGENT_DID_NOT_ANSWER' | 'AGENT_DID_NOT_SPEAK' | 'AGENT_STOPPED_SPEAKING' | 'AGENT_ENDED_CALL' | 'AGENT_TRANSFERRED_CALL' | 'AGENT_BUSY' | 'AGENT_ERROR' | 'CUSTOMER_ENDED_CALL' | 'VOICE_MAIL_REACHED' | 'SILENCE_TIME_OUT' | 'PHONE_CALL_PROVIDER_CONNECTION_ERROR' | 'CUSTOMER_DID_NOT_ANSWER' | 'CUSTOMER_DID_NOT_SPEAK' | 'CUSTOMER_STOPPED_SPEAKING' | 'CUSTOMER_BUSY' | 'DIAL_ERROR' | 'MAX_DURATION_REACHED' | 'UNKNOWN' | null;
279
+ /**
280
+ * Caller-supplied correlation ID echoed back from the create request, if any was
281
+ * provided
282
+ */
283
+ externalId?: string | null;
258
284
  /**
259
285
  * IDs of metric policies that have been applied to this call
260
286
  */
@@ -343,11 +369,11 @@ export declare namespace CallGetTranscriptResponse {
343
369
  */
344
370
  interface Entry {
345
371
  /**
346
- * End time offset in milliseconds from the start of the call
372
+ * End time offset in milliseconds from the start of the conversation
347
373
  */
348
374
  endOffsetMs: number;
349
375
  /**
350
- * ID of the conversation participant who spoke this entry. References
376
+ * ID of the conversation participant who produced this entry. References
351
377
  * participants[].id.
352
378
  */
353
379
  participantId: string | null;
@@ -356,7 +382,7 @@ export declare namespace CallGetTranscriptResponse {
356
382
  */
357
383
  role: 'AGENT' | 'CUSTOMER' | null;
358
384
  /**
359
- * Start time offset in milliseconds from the start of the call
385
+ * Start time offset in milliseconds from the start of the conversation
360
386
  */
361
387
  startOffsetMs: number;
362
388
  /**
@@ -418,227 +444,234 @@ export declare namespace CallGetTranscriptResponse {
418
444
  }
419
445
  }
420
446
  }
421
- export interface CallListEvaluationRunsResponse {
447
+ export interface CallListMetricsResponse {
422
448
  /**
423
- * Evaluation run response payload
449
+ * Conversation metrics response payload grouped by metric definition
424
450
  */
425
- data: Array<CallListEvaluationRunsResponse.Data>;
451
+ data: Array<CallListMetricsResponse.Data>;
426
452
  }
427
- export declare namespace CallListEvaluationRunsResponse {
453
+ export declare namespace CallListMetricsResponse {
454
+ /**
455
+ * Metric data grouped by metric definition
456
+ */
428
457
  interface Data {
429
458
  /**
430
- * All block runs for this evaluator, including skipped ones
459
+ * Description of what the metric measures
431
460
  */
432
- blockRuns: Array<Data.BlockRun>;
433
- evaluator: Data.Evaluator;
434
- evidence: Array<Data.Evidence>;
435
- metrics: Array<Data.Metric>;
461
+ description: string;
436
462
  /**
437
- * Status of the evaluator run
463
+ * Unique identifier for the metric definition
438
464
  */
439
- status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
465
+ metricDefinitionId: string;
440
466
  /**
441
- * ID of the evaluator run
467
+ * Alias of `slug` retained for backwards compatibility. Same value as `slug`.
442
468
  */
443
- id?: string;
469
+ metricId: string;
444
470
  /**
445
- * When the evaluator run completed
471
+ * Name of the metric
446
472
  */
447
- completedAt?: string | null;
473
+ name: string;
448
474
  /**
449
- * Result of the evaluator run based on score threshold (IRRELEVANT is mapped to
450
- * SKIPPED)
475
+ * Whether metric is global or per-participant
451
476
  */
452
- result?: 'SUCCESS' | 'FAILURE' | 'SKIPPED' | null;
477
+ scope: 'GLOBAL' | 'PER_PARTICIPANT';
453
478
  /**
454
- * Score of the evaluation run (0-1)
479
+ * Stable metric slug
455
480
  */
456
- score?: number | null;
481
+ slug: string;
457
482
  /**
458
- * When the evaluator run started
483
+ * Type of value this metric produces
459
484
  */
460
- startedAt?: string | null;
485
+ type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET';
461
486
  /**
462
- * Summary of the evaluation run
487
+ * Array of metric values (multiple for PER_PARTICIPANT metrics, or multiple
488
+ * segments/turns)
463
489
  */
464
- summary?: string | null;
490
+ values: Array<Data.StandardMetricValue | Data.PropertyVerificationMetricValue>;
491
+ /**
492
+ * Unit information if applicable
493
+ */
494
+ unit?: Data.Unit;
465
495
  }
466
496
  namespace Data {
467
- interface BlockRun {
468
- /**
469
- * ID of the block definition
470
- */
471
- blockDefinitionId: string;
497
+ /**
498
+ * A metric value entry. Applies to every metric.
499
+ */
500
+ interface StandardMetricValue {
472
501
  /**
473
- * Name of the evaluation block
502
+ * Result state of this metric computation. SUCCESS carries a real `value`;
503
+ * NOT_APPLICABLE / DATA_MISSING / ERROR do not (the `value` field is omitted).
504
+ * Non-SUCCESS rows only appear when the request includes ?status=all.
474
505
  */
475
- blockName: string;
506
+ captureStatus: 'SUCCESS' | 'NOT_APPLICABLE' | 'DATA_MISSING' | 'ERROR';
476
507
  /**
477
- * ID of the block run instance
508
+ * ISO 8601 timestamp when the metric was computed
478
509
  */
479
- blockRunId: string;
510
+ computedAt: string;
480
511
  /**
481
- * When the block run was created
512
+ * Context level: CALL (entire conversation), SEGMENT (single segment),
513
+ * SEGMENT_RANGE (between/across segments)
482
514
  */
483
- createdAt: string;
515
+ context: 'CALL' | 'SEGMENT' | 'SEGMENT_RANGE';
484
516
  /**
485
- * Reason for the outcome (pass/fail explanation or skip reason)
517
+ * ID of the call this value was computed on. Only set when the response spans
518
+ * multiple conversations (e.g. job-scoped metric values).
486
519
  */
487
- reason: string | null;
520
+ callId?: string;
488
521
  /**
489
- * Result of the block run
522
+ * ID of the chat this value was computed on. Only set when the response spans
523
+ * multiple conversations (e.g. job-scoped metric values).
490
524
  */
491
- result: 'PASSED' | 'FAILED' | 'SKIPPED' | null;
525
+ chatId?: string;
492
526
  /**
493
- * Score of the block run (0-1)
527
+ * Confidence score (0-1) for the computed value. Defaults to 1.0 for deterministic
528
+ * metrics. Omitted on non-SUCCESS rows.
494
529
  */
495
- score: number | null;
530
+ confidence?: number;
496
531
  /**
497
- * Status of the block run
532
+ * Error detail when captureStatus is ERROR — e.g. provider down, LLM timeout.
533
+ * Undefined for other statuses.
498
534
  */
499
- status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';
500
- }
501
- interface Evaluator {
535
+ errorMessage?: string;
502
536
  /**
503
- * ID of the evaluator
537
+ * Starting segment information (for SEGMENT_RANGE context metrics)
504
538
  */
505
- id: string;
539
+ fromSegment?: StandardMetricValue.FromSegment;
506
540
  /**
507
- * Name of the evaluator
541
+ * Role of participant (only for PER_PARTICIPANT metrics)
508
542
  */
509
- name: string;
543
+ participantRole?: 'agent' | 'customer';
510
544
  /**
511
- * Weight of the evaluator
545
+ * IDs of metric policies that triggered this metric computation
512
546
  */
513
- weight?: number;
514
- }
515
- interface Evidence {
547
+ policyIds?: Array<string>;
516
548
  /**
517
- * Comment text of the evidence
549
+ * Segment information (for SEGMENT context metrics)
518
550
  */
519
- commentText: string | null;
551
+ segment?: StandardMetricValue.Segment;
520
552
  /**
521
- * Created at of the evidence
553
+ * Ending segment information (for SEGMENT_RANGE context metrics)
522
554
  */
523
- createdAt: string;
555
+ toSegment?: StandardMetricValue.ToSegment;
524
556
  /**
525
- * Is positive of the evidence
557
+ * The metric value (type depends on outputType). Present only on SUCCESS rows;
558
+ * omitted for NOT_APPLICABLE / DATA_MISSING / ERROR.
526
559
  */
527
- isPositive: boolean;
560
+ value?: number | boolean | string;
528
561
  /**
529
- * Snippet text of the evidence
562
+ * Explanation for the metric value (especially useful for AI-computed metrics)
530
563
  */
531
- snippetText: string;
564
+ valueReasoning?: string;
532
565
  }
533
- interface Metric {
534
- /**
535
- * Boolean value of the metric
536
- */
537
- booleanValue: boolean | null;
538
- /**
539
- * Confidence level of the metric (0-1)
540
- */
541
- confidence: number | null;
566
+ namespace StandardMetricValue {
542
567
  /**
543
- * Created at of the metric
568
+ * Starting segment information (for SEGMENT_RANGE context metrics)
544
569
  */
545
- createdAt: string;
570
+ interface FromSegment {
571
+ /**
572
+ * Segment ID
573
+ */
574
+ id: string;
575
+ /**
576
+ * End time offset in milliseconds
577
+ */
578
+ endOffsetMs: number;
579
+ /**
580
+ * Start time offset in milliseconds
581
+ */
582
+ startOffsetMs: number;
583
+ /**
584
+ * Segment text content
585
+ */
586
+ text: string;
587
+ }
546
588
  /**
547
- * Name of the metric
589
+ * Segment information (for SEGMENT context metrics)
548
590
  */
549
- name: string;
591
+ interface Segment {
592
+ /**
593
+ * Segment ID
594
+ */
595
+ id: string;
596
+ /**
597
+ * End time offset in milliseconds
598
+ */
599
+ endOffsetMs: number;
600
+ /**
601
+ * Start time offset in milliseconds
602
+ */
603
+ startOffsetMs: number;
604
+ /**
605
+ * Segment text content
606
+ */
607
+ text: string;
608
+ }
550
609
  /**
551
- * Numeric value of the metric
610
+ * Ending segment information (for SEGMENT_RANGE context metrics)
552
611
  */
553
- numericValue: number | null;
612
+ interface ToSegment {
613
+ /**
614
+ * Segment ID
615
+ */
616
+ id: string;
617
+ /**
618
+ * End time offset in milliseconds
619
+ */
620
+ endOffsetMs: number;
621
+ /**
622
+ * Start time offset in milliseconds
623
+ */
624
+ startOffsetMs: number;
625
+ /**
626
+ * Segment text content
627
+ */
628
+ text: string;
629
+ }
630
+ }
631
+ /**
632
+ * Returned for the Property Mismatch metric (`property_transcript_mismatch`): the
633
+ * standard entry plus the per-property verdict breakdown.
634
+ */
635
+ interface PropertyVerificationMetricValue {
554
636
  /**
555
- * Reasoning of the metric
637
+ * Result state of this metric computation. SUCCESS carries a real `value`;
638
+ * NOT_APPLICABLE / DATA_MISSING / ERROR do not (the `value` field is omitted).
639
+ * Non-SUCCESS rows only appear when the request includes ?status=all.
556
640
  */
557
- reasoning: string | null;
641
+ captureStatus: 'SUCCESS' | 'NOT_APPLICABLE' | 'DATA_MISSING' | 'ERROR';
558
642
  /**
559
- * Role of the metric
643
+ * ISO 8601 timestamp when the metric was computed
560
644
  */
561
- role: string;
645
+ computedAt: string;
562
646
  /**
563
- * Text value of the metric
647
+ * Context level: CALL (entire conversation), SEGMENT (single segment),
648
+ * SEGMENT_RANGE (between/across segments)
564
649
  */
565
- textValue: string | null;
650
+ context: 'CALL' | 'SEGMENT' | 'SEGMENT_RANGE';
566
651
  /**
567
- * Value type of the metric
652
+ * ID of the call this value was computed on. Only set when the response spans
653
+ * multiple conversations (e.g. job-scoped metric values).
568
654
  */
569
- valueType: string;
570
- }
571
- }
572
- }
573
- export interface CallListMetricsResponse {
574
- /**
575
- * Call metrics response payload grouped by metric definition
576
- */
577
- data: Array<CallListMetricsResponse.Data>;
578
- }
579
- export declare namespace CallListMetricsResponse {
580
- /**
581
- * Call metric data grouped by metric definition
582
- */
583
- interface Data {
584
- /**
585
- * Description of what the metric measures
586
- */
587
- description: string;
588
- /**
589
- * Unique identifier for the metric definition
590
- */
591
- metricDefinitionId: string;
592
- /**
593
- * Stable metric identifier
594
- */
595
- metricId: string;
596
- /**
597
- * Name of the metric
598
- */
599
- name: string;
600
- /**
601
- * Whether metric is global or per-participant
602
- */
603
- scope: 'GLOBAL' | 'PER_PARTICIPANT';
604
- /**
605
- * Type of value this metric produces
606
- */
607
- type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET';
608
- /**
609
- * Array of metric values (multiple for PER_PARTICIPANT metrics, or multiple
610
- * segments/turns)
611
- */
612
- values: Array<Data.Value>;
613
- /**
614
- * Unit information if applicable
615
- */
616
- unit?: Data.Unit;
617
- }
618
- namespace Data {
619
- interface Value {
655
+ callId?: string;
620
656
  /**
621
- * ISO 8601 timestamp when the metric was computed
657
+ * ID of the chat this value was computed on. Only set when the response spans
658
+ * multiple conversations (e.g. job-scoped metric values).
622
659
  */
623
- computedAt: string;
660
+ chatId?: string;
624
661
  /**
625
662
  * Confidence score (0-1) for the computed value. Defaults to 1.0 for deterministic
626
- * metrics.
663
+ * metrics. Omitted on non-SUCCESS rows.
627
664
  */
628
- confidence: number;
629
- /**
630
- * Context level: CALL (entire call), SEGMENT (single segment), SEGMENT_RANGE
631
- * (between/across segments)
632
- */
633
- context: 'CALL' | 'SEGMENT' | 'SEGMENT_RANGE';
665
+ confidence?: number;
634
666
  /**
635
- * The metric value (type depends on outputType)
667
+ * Error detail when captureStatus is ERROR — e.g. provider down, LLM timeout.
668
+ * Undefined for other statuses.
636
669
  */
637
- value: number | boolean | string;
670
+ errorMessage?: string;
638
671
  /**
639
672
  * Starting segment information (for SEGMENT_RANGE context metrics)
640
673
  */
641
- fromSegment?: Value.FromSegment;
674
+ fromSegment?: PropertyVerificationMetricValue.FromSegment;
642
675
  /**
643
676
  * Role of participant (only for PER_PARTICIPANT metrics)
644
677
  */
@@ -647,26 +680,36 @@ export declare namespace CallListMetricsResponse {
647
680
  * IDs of metric policies that triggered this metric computation
648
681
  */
649
682
  policyIds?: Array<string>;
683
+ /**
684
+ * Per-property verdicts for the Property Mismatch metric, in the order the
685
+ * properties were checked. Omitted for every other metric.
686
+ */
687
+ propertyVerdicts?: Array<PropertyVerificationMetricValue.PropertyVerdict>;
650
688
  /**
651
689
  * Segment information (for SEGMENT context metrics)
652
690
  */
653
- segment?: Value.Segment;
691
+ segment?: PropertyVerificationMetricValue.Segment;
654
692
  /**
655
693
  * Ending segment information (for SEGMENT_RANGE context metrics)
656
694
  */
657
- toSegment?: Value.ToSegment;
695
+ toSegment?: PropertyVerificationMetricValue.ToSegment;
696
+ /**
697
+ * The metric value (type depends on outputType). Present only on SUCCESS rows;
698
+ * omitted for NOT_APPLICABLE / DATA_MISSING / ERROR.
699
+ */
700
+ value?: number | boolean | string;
658
701
  /**
659
702
  * Explanation for the metric value (especially useful for AI-computed metrics)
660
703
  */
661
704
  valueReasoning?: string;
662
705
  }
663
- namespace Value {
706
+ namespace PropertyVerificationMetricValue {
664
707
  /**
665
708
  * Starting segment information (for SEGMENT_RANGE context metrics)
666
709
  */
667
710
  interface FromSegment {
668
711
  /**
669
- * Starting segment ID
712
+ * Segment ID
670
713
  */
671
714
  id: string;
672
715
  /**
@@ -678,10 +721,64 @@ export declare namespace CallListMetricsResponse {
678
721
  */
679
722
  startOffsetMs: number;
680
723
  /**
681
- * Starting segment text content
724
+ * Segment text content
682
725
  */
683
726
  text: string;
684
727
  }
728
+ interface PropertyVerdict {
729
+ /**
730
+ * The value supplied at ingest, frozen at scoring time
731
+ */
732
+ expectedValue: string;
733
+ /**
734
+ * The call property checked, as sent at ingest
735
+ */
736
+ propertyName: string;
737
+ /**
738
+ * How this property resolved against the transcript. NOT_MENTIONED means the
739
+ * subject never came up and is not a mismatch.
740
+ */
741
+ verdict: 'MATCH' | 'MISMATCH' | 'NOT_MENTIONED';
742
+ /**
743
+ * What the transcript said instead. Only present when verdict is MISMATCH.
744
+ */
745
+ observedValue?: string;
746
+ /**
747
+ * Judge reasoning for this verdict
748
+ */
749
+ reasoning?: string;
750
+ /**
751
+ * The transcript segment this property was referred to in: the conflicting value
752
+ * for MISMATCH, the confirming reference for MATCH. Omitted for NOT_MENTIONED and
753
+ * when the verdict could not be anchored.
754
+ */
755
+ segment?: PropertyVerdict.Segment;
756
+ }
757
+ namespace PropertyVerdict {
758
+ /**
759
+ * The transcript segment this property was referred to in: the conflicting value
760
+ * for MISMATCH, the confirming reference for MATCH. Omitted for NOT_MENTIONED and
761
+ * when the verdict could not be anchored.
762
+ */
763
+ interface Segment {
764
+ /**
765
+ * Segment ID
766
+ */
767
+ id: string;
768
+ /**
769
+ * End time offset in milliseconds
770
+ */
771
+ endOffsetMs: number;
772
+ /**
773
+ * Start time offset in milliseconds
774
+ */
775
+ startOffsetMs: number;
776
+ /**
777
+ * Segment text content
778
+ */
779
+ text: string;
780
+ }
781
+ }
685
782
  /**
686
783
  * Segment information (for SEGMENT context metrics)
687
784
  */
@@ -708,7 +805,7 @@ export declare namespace CallListMetricsResponse {
708
805
  */
709
806
  interface ToSegment {
710
807
  /**
711
- * Ending segment ID
808
+ * Segment ID
712
809
  */
713
810
  id: string;
714
811
  /**
@@ -720,7 +817,7 @@ export declare namespace CallListMetricsResponse {
720
817
  */
721
818
  startOffsetMs: number;
722
819
  /**
723
- * Ending segment text content
820
+ * Segment text content
724
821
  */
725
822
  text: string;
726
823
  }
@@ -810,6 +907,18 @@ export interface CallCreateParams {
810
907
  * High-level call end status, indicating how the call terminated
811
908
  */
812
909
  endedStatus?: 'PARTICIPANTS_DID_NOT_SPEAK' | 'AGENT_DID_NOT_ANSWER' | 'AGENT_DID_NOT_SPEAK' | 'AGENT_STOPPED_SPEAKING' | 'AGENT_ENDED_CALL' | 'AGENT_TRANSFERRED_CALL' | 'AGENT_BUSY' | 'AGENT_ERROR' | 'CUSTOMER_ENDED_CALL' | 'VOICE_MAIL_REACHED' | 'SILENCE_TIME_OUT' | 'PHONE_CALL_PROVIDER_CONNECTION_ERROR' | 'CUSTOMER_DID_NOT_ANSWER' | 'CUSTOMER_DID_NOT_SPEAK' | 'CUSTOMER_STOPPED_SPEAKING' | 'CUSTOMER_BUSY' | 'DIAL_ERROR' | 'MAX_DURATION_REACHED' | 'UNKNOWN';
910
+ /**
911
+ * A stable identifier from your own system (e.g. session ID, conversation ID) used
912
+ * to correlate this call with OpenTelemetry traces. Set the same value as a
913
+ * `roark.external_id` span or resource attribute on your traces and the matching
914
+ * trace will be linked automatically. Must be unique within a project.
915
+ */
916
+ externalId?: string;
917
+ /**
918
+ * The LiveKit Cloud room ID to link this call with OpenTelemetry trace data from
919
+ * LiveKit. Used for matching calls with OTEL traces.
920
+ */
921
+ livekitRoomId?: string;
813
922
  /**
814
923
  * Custom properties to include with the call. These can be used for filtering and
815
924
  * will show in the call details page
@@ -830,6 +939,11 @@ export interface CallCreateParams {
830
939
  * List of transcript entries made during the call
831
940
  */
832
941
  transcript?: Array<CallCreateParams.TranscriptEntryAgent | CallCreateParams.TranscriptEntryCustomer>;
942
+ /**
943
+ * The Vapi call ID (UUID) to link this call with OpenTelemetry trace data from
944
+ * Vapi. Used for matching calls with OTEL traces.
945
+ */
946
+ vapiCallId?: string;
833
947
  }
834
948
  export declare namespace CallCreateParams {
835
949
  interface AgentIdentificationByRoarkID {
@@ -1220,7 +1334,13 @@ export declare namespace CallCreateParams {
1220
1334
  * the agents array this tool invocation belongs to
1221
1335
  */
1222
1336
  interface Agent {
1337
+ /**
1338
+ * The custom ID set on the agent
1339
+ */
1223
1340
  customId?: string;
1341
+ /**
1342
+ * The Roark ID of the agent
1343
+ */
1224
1344
  roarkId?: string;
1225
1345
  }
1226
1346
  }
@@ -1229,12 +1349,29 @@ export declare namespace CallCreateParams {
1229
1349
  role: 'AGENT';
1230
1350
  startOffsetMs: number;
1231
1351
  text: string;
1352
+ /**
1353
+ * Metadata about the agent that spoke this turn - used to match which agent from
1354
+ * the `agents` array this transcript entry belongs to
1355
+ */
1232
1356
  agent?: TranscriptEntryAgent.Agent;
1233
1357
  languageCode?: string;
1358
+ payload?: {
1359
+ [key: string]: unknown;
1360
+ } | null;
1234
1361
  }
1235
1362
  namespace TranscriptEntryAgent {
1363
+ /**
1364
+ * Metadata about the agent that spoke this turn - used to match which agent from
1365
+ * the `agents` array this transcript entry belongs to
1366
+ */
1236
1367
  interface Agent {
1368
+ /**
1369
+ * The custom ID set on the agent
1370
+ */
1237
1371
  customId?: string;
1372
+ /**
1373
+ * The Roark ID of the agent
1374
+ */
1238
1375
  roarkId?: string;
1239
1376
  }
1240
1377
  }
@@ -1249,6 +1386,9 @@ export declare namespace CallCreateParams {
1249
1386
  */
1250
1387
  customer?: TranscriptEntryCustomer.Customer;
1251
1388
  languageCode?: string;
1389
+ payload?: {
1390
+ [key: string]: unknown;
1391
+ } | null;
1252
1392
  }
1253
1393
  namespace TranscriptEntryCustomer {
1254
1394
  /**
@@ -1313,8 +1453,16 @@ export interface CallListMetricsParams {
1313
1453
  * false)
1314
1454
  */
1315
1455
  flatten?: string;
1456
+ /**
1457
+ * Filter metrics by capture status. `success` (default) returns only successfully
1458
+ * computed metrics — backwards-compatible with the historical behavior. `all` also
1459
+ * returns NOT_APPLICABLE / DATA_MISSING / ERROR rows (with `value` omitted), so
1460
+ * clients can distinguish "still computing" from "computed but no value" and exit
1461
+ * retry loops correctly.
1462
+ */
1463
+ status?: 'success' | 'all';
1316
1464
  }
1317
1465
  export declare namespace Call {
1318
- export { type CallCreateResponse as CallCreateResponse, type CallListResponse as CallListResponse, type CallGetByIDResponse as CallGetByIDResponse, type CallGetTranscriptResponse as CallGetTranscriptResponse, type CallListEvaluationRunsResponse as CallListEvaluationRunsResponse, type CallListMetricsResponse as CallListMetricsResponse, type CallListSentimentRunsResponse as CallListSentimentRunsResponse, type CallCreateParams as CallCreateParams, type CallListParams as CallListParams, type CallGetTranscriptParams as CallGetTranscriptParams, type CallListMetricsParams as CallListMetricsParams, };
1466
+ export { type CallCreateResponse as CallCreateResponse, type CallListResponse as CallListResponse, type CallGetByIDResponse as CallGetByIDResponse, type CallGetTranscriptResponse as CallGetTranscriptResponse, type CallListMetricsResponse as CallListMetricsResponse, type CallListSentimentRunsResponse as CallListSentimentRunsResponse, type CallCreateParams as CallCreateParams, type CallListParams as CallListParams, type CallGetTranscriptParams as CallGetTranscriptParams, type CallListMetricsParams as CallListMetricsParams, };
1319
1467
  }
1320
1468
  //# sourceMappingURL=call.d.ts.map