retell-sdk 4.66.0 → 5.1.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 (550) hide show
  1. package/CHANGELOG.md +7 -1341
  2. package/LICENSE +1 -1
  3. package/README.md +120 -44
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +217 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +217 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +513 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +509 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +1 -46
  55. package/error.d.ts.map +1 -1
  56. package/error.js +3 -110
  57. package/error.js.map +1 -1
  58. package/error.mjs +1 -96
  59. package/error.mjs.map +1 -1
  60. package/index.d.mts +6 -151
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +5 -150
  63. package/index.d.ts.map +1 -1
  64. package/index.js +12 -150
  65. package/index.js.map +1 -1
  66. package/index.mjs +5 -123
  67. package/index.mjs.map +1 -1
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/request-options.d.mts +75 -0
  109. package/internal/request-options.d.mts.map +1 -0
  110. package/internal/request-options.d.ts +75 -0
  111. package/internal/request-options.d.ts.map +1 -0
  112. package/internal/request-options.js +14 -0
  113. package/internal/request-options.js.map +1 -0
  114. package/internal/request-options.mjs +10 -0
  115. package/internal/request-options.mjs.map +1 -0
  116. package/internal/shim-types.d.mts +17 -0
  117. package/internal/shim-types.d.mts.map +1 -0
  118. package/internal/shim-types.d.ts +17 -0
  119. package/internal/shim-types.d.ts.map +1 -0
  120. package/internal/shim-types.js +4 -0
  121. package/internal/shim-types.js.map +1 -0
  122. package/internal/shim-types.mjs +3 -0
  123. package/internal/shim-types.mjs.map +1 -0
  124. package/internal/shims.d.mts +20 -0
  125. package/internal/shims.d.mts.map +1 -0
  126. package/internal/shims.d.ts +20 -0
  127. package/internal/shims.d.ts.map +1 -0
  128. package/internal/shims.js +92 -0
  129. package/internal/shims.js.map +1 -0
  130. package/internal/shims.mjs +85 -0
  131. package/internal/shims.mjs.map +1 -0
  132. package/internal/to-file.d.mts +45 -0
  133. package/internal/to-file.d.mts.map +1 -0
  134. package/internal/to-file.d.ts +45 -0
  135. package/internal/to-file.d.ts.map +1 -0
  136. package/internal/to-file.js +91 -0
  137. package/internal/to-file.js.map +1 -0
  138. package/internal/to-file.mjs +88 -0
  139. package/internal/to-file.mjs.map +1 -0
  140. package/internal/tslib.js +81 -0
  141. package/internal/tslib.mjs +17 -0
  142. package/internal/types.d.mts +69 -0
  143. package/internal/types.d.mts.map +1 -0
  144. package/internal/types.d.ts +69 -0
  145. package/internal/types.d.ts.map +1 -0
  146. package/internal/types.js +4 -0
  147. package/internal/types.js.map +1 -0
  148. package/internal/types.mjs +3 -0
  149. package/internal/types.mjs.map +1 -0
  150. package/internal/uploads.d.mts +42 -0
  151. package/internal/uploads.d.mts.map +1 -0
  152. package/internal/uploads.d.ts +42 -0
  153. package/internal/uploads.d.ts.map +1 -0
  154. package/internal/uploads.js +141 -0
  155. package/internal/uploads.js.map +1 -0
  156. package/internal/uploads.mjs +131 -0
  157. package/internal/uploads.mjs.map +1 -0
  158. package/internal/utils/base64.d.mts +3 -0
  159. package/internal/utils/base64.d.mts.map +1 -0
  160. package/internal/utils/base64.d.ts +3 -0
  161. package/internal/utils/base64.d.ts.map +1 -0
  162. package/internal/utils/base64.js +38 -0
  163. package/internal/utils/base64.js.map +1 -0
  164. package/internal/utils/base64.mjs +33 -0
  165. package/internal/utils/base64.mjs.map +1 -0
  166. package/internal/utils/bytes.d.mts +4 -0
  167. package/internal/utils/bytes.d.mts.map +1 -0
  168. package/internal/utils/bytes.d.ts +4 -0
  169. package/internal/utils/bytes.d.ts.map +1 -0
  170. package/internal/utils/bytes.js +31 -0
  171. package/internal/utils/bytes.js.map +1 -0
  172. package/internal/utils/bytes.mjs +26 -0
  173. package/internal/utils/bytes.mjs.map +1 -0
  174. package/internal/utils/env.d.mts +9 -0
  175. package/internal/utils/env.d.mts.map +1 -0
  176. package/internal/utils/env.d.ts +9 -0
  177. package/internal/utils/env.d.ts.map +1 -0
  178. package/internal/utils/env.js +22 -0
  179. package/internal/utils/env.js.map +1 -0
  180. package/internal/utils/env.mjs +18 -0
  181. package/internal/utils/env.mjs.map +1 -0
  182. package/internal/utils/log.d.mts +37 -0
  183. package/internal/utils/log.d.mts.map +1 -0
  184. package/internal/utils/log.d.ts +37 -0
  185. package/internal/utils/log.d.ts.map +1 -0
  186. package/internal/utils/log.js +85 -0
  187. package/internal/utils/log.js.map +1 -0
  188. package/internal/utils/log.mjs +79 -0
  189. package/internal/utils/log.mjs.map +1 -0
  190. package/internal/utils/path.d.mts +15 -0
  191. package/internal/utils/path.d.mts.map +1 -0
  192. package/internal/utils/path.d.ts +15 -0
  193. package/internal/utils/path.d.ts.map +1 -0
  194. package/internal/utils/path.js +79 -0
  195. package/internal/utils/path.js.map +1 -0
  196. package/internal/utils/path.mjs +74 -0
  197. package/internal/utils/path.mjs.map +1 -0
  198. package/internal/utils/sleep.d.mts +2 -0
  199. package/internal/utils/sleep.d.mts.map +1 -0
  200. package/internal/utils/sleep.d.ts +2 -0
  201. package/internal/utils/sleep.d.ts.map +1 -0
  202. package/internal/utils/sleep.js +7 -0
  203. package/internal/utils/sleep.js.map +1 -0
  204. package/internal/utils/sleep.mjs +3 -0
  205. package/internal/utils/sleep.mjs.map +1 -0
  206. package/internal/utils/uuid.d.mts +5 -0
  207. package/internal/utils/uuid.d.mts.map +1 -0
  208. package/internal/utils/uuid.d.ts +5 -0
  209. package/internal/utils/uuid.d.ts.map +1 -0
  210. package/internal/utils/uuid.js +19 -0
  211. package/internal/utils/uuid.js.map +1 -0
  212. package/internal/utils/uuid.mjs +15 -0
  213. package/internal/utils/uuid.mjs.map +1 -0
  214. package/internal/utils/values.d.mts +18 -0
  215. package/internal/utils/values.d.mts.map +1 -0
  216. package/internal/utils/values.d.ts +18 -0
  217. package/internal/utils/values.d.ts.map +1 -0
  218. package/internal/utils/values.js +112 -0
  219. package/internal/utils/values.js.map +1 -0
  220. package/internal/utils/values.mjs +94 -0
  221. package/internal/utils/values.mjs.map +1 -0
  222. package/internal/utils.d.mts +7 -0
  223. package/internal/utils.d.mts.map +1 -0
  224. package/internal/utils.d.ts +7 -0
  225. package/internal/utils.d.ts.map +1 -0
  226. package/internal/utils.js +11 -0
  227. package/internal/utils.js.map +1 -0
  228. package/internal/utils.mjs +8 -0
  229. package/internal/utils.mjs.map +1 -0
  230. package/package.json +101 -65
  231. package/resource.d.mts +2 -0
  232. package/resource.d.mts.map +1 -0
  233. package/resource.d.ts +1 -5
  234. package/resource.d.ts.map +1 -1
  235. package/resource.js +3 -8
  236. package/resource.js.map +1 -1
  237. package/resource.mjs +1 -6
  238. package/resource.mjs.map +1 -1
  239. package/resources/agent.d.mts +1803 -0
  240. package/resources/agent.d.mts.map +1 -0
  241. package/resources/agent.d.ts +374 -78
  242. package/resources/agent.d.ts.map +1 -1
  243. package/resources/agent.js +33 -20
  244. package/resources/agent.js.map +1 -1
  245. package/resources/agent.mjs +33 -20
  246. package/resources/agent.mjs.map +1 -1
  247. package/resources/batch-call.d.mts +926 -0
  248. package/resources/batch-call.d.mts.map +1 -0
  249. package/resources/batch-call.d.ts +219 -27
  250. package/resources/batch-call.d.ts.map +1 -1
  251. package/resources/batch-call.js +6 -2
  252. package/resources/batch-call.js.map +1 -1
  253. package/resources/batch-call.mjs +6 -2
  254. package/resources/batch-call.mjs.map +1 -1
  255. package/resources/call.d.mts +4280 -0
  256. package/resources/call.d.mts.map +1 -0
  257. package/resources/call.d.ts +556 -110
  258. package/resources/call.d.ts.map +1 -1
  259. package/resources/call.js +20 -10
  260. package/resources/call.js.map +1 -1
  261. package/resources/call.mjs +20 -10
  262. package/resources/call.mjs.map +1 -1
  263. package/resources/chat-agent.d.mts +836 -0
  264. package/resources/chat-agent.d.mts.map +1 -0
  265. package/resources/chat-agent.d.ts +118 -23
  266. package/resources/chat-agent.d.ts.map +1 -1
  267. package/resources/chat-agent.js +33 -20
  268. package/resources/chat-agent.js.map +1 -1
  269. package/resources/chat-agent.mjs +33 -20
  270. package/resources/chat-agent.mjs.map +1 -1
  271. package/resources/chat.d.mts +607 -0
  272. package/resources/chat.d.mts.map +1 -0
  273. package/resources/chat.d.ts +82 -30
  274. package/resources/chat.d.ts.map +1 -1
  275. package/resources/chat.js +21 -11
  276. package/resources/chat.js.map +1 -1
  277. package/resources/chat.mjs +21 -11
  278. package/resources/chat.mjs.map +1 -1
  279. package/resources/concurrency.d.mts +51 -0
  280. package/resources/concurrency.d.mts.map +1 -0
  281. package/resources/concurrency.d.ts +14 -3
  282. package/resources/concurrency.d.ts.map +1 -1
  283. package/resources/concurrency.js +1 -1
  284. package/resources/concurrency.js.map +1 -1
  285. package/resources/concurrency.mjs +1 -1
  286. package/resources/concurrency.mjs.map +1 -1
  287. package/resources/conversation-flow-component.d.mts +11838 -0
  288. package/resources/conversation-flow-component.d.mts.map +1 -0
  289. package/resources/conversation-flow-component.d.ts +6600 -2597
  290. package/resources/conversation-flow-component.d.ts.map +1 -1
  291. package/resources/conversation-flow-component.js +10 -8
  292. package/resources/conversation-flow-component.js.map +1 -1
  293. package/resources/conversation-flow-component.mjs +10 -8
  294. package/resources/conversation-flow-component.mjs.map +1 -1
  295. package/resources/conversation-flow.d.mts +23851 -0
  296. package/resources/conversation-flow.d.mts.map +1 -0
  297. package/resources/conversation-flow.d.ts +15877 -7958
  298. package/resources/conversation-flow.d.ts.map +1 -1
  299. package/resources/conversation-flow.js +30 -15
  300. package/resources/conversation-flow.js.map +1 -1
  301. package/resources/conversation-flow.mjs +30 -15
  302. package/resources/conversation-flow.mjs.map +1 -1
  303. package/resources/index.d.mts +15 -0
  304. package/resources/index.d.mts.map +1 -0
  305. package/resources/index.d.ts +4 -4
  306. package/resources/index.d.ts.map +1 -1
  307. package/resources/index.js.map +1 -1
  308. package/resources/index.mjs +2 -2
  309. package/resources/index.mjs.map +1 -1
  310. package/resources/knowledge-base.d.mts +228 -0
  311. package/resources/knowledge-base.d.mts.map +1 -0
  312. package/resources/knowledge-base.d.ts +23 -14
  313. package/resources/knowledge-base.d.ts.map +1 -1
  314. package/resources/knowledge-base.js +16 -36
  315. package/resources/knowledge-base.js.map +1 -1
  316. package/resources/knowledge-base.mjs +16 -13
  317. package/resources/knowledge-base.mjs.map +1 -1
  318. package/resources/llm.d.mts +5306 -0
  319. package/resources/llm.d.mts.map +1 -0
  320. package/resources/llm.d.ts +1189 -477
  321. package/resources/llm.d.ts.map +1 -1
  322. package/resources/llm.js +28 -15
  323. package/resources/llm.js.map +1 -1
  324. package/resources/llm.mjs +28 -15
  325. package/resources/llm.mjs.map +1 -1
  326. package/resources/mcp-tool.d.mts +45 -0
  327. package/resources/mcp-tool.d.mts.map +1 -0
  328. package/resources/mcp-tool.d.ts +8 -3
  329. package/resources/mcp-tool.d.ts.map +1 -1
  330. package/resources/mcp-tool.js +4 -3
  331. package/resources/mcp-tool.js.map +1 -1
  332. package/resources/mcp-tool.mjs +4 -3
  333. package/resources/mcp-tool.mjs.map +1 -1
  334. package/resources/phone-number.d.mts +595 -0
  335. package/resources/phone-number.d.mts.map +1 -0
  336. package/resources/phone-number.d.ts +332 -13
  337. package/resources/phone-number.d.ts.map +1 -1
  338. package/resources/phone-number.js +7 -5
  339. package/resources/phone-number.js.map +1 -1
  340. package/resources/phone-number.mjs +7 -5
  341. package/resources/phone-number.mjs.map +1 -1
  342. package/resources/tests.d.mts +561 -0
  343. package/resources/tests.d.mts.map +1 -0
  344. package/resources/tests.d.ts +437 -7
  345. package/resources/tests.d.ts.map +1 -1
  346. package/resources/tests.js +60 -1
  347. package/resources/tests.js.map +1 -1
  348. package/resources/tests.mjs +60 -1
  349. package/resources/tests.mjs.map +1 -1
  350. package/resources/voice.d.mts +130 -0
  351. package/resources/voice.d.mts.map +1 -0
  352. package/resources/voice.d.ts +89 -6
  353. package/resources/voice.d.ts.map +1 -1
  354. package/resources/voice.js +23 -3
  355. package/resources/voice.js.map +1 -1
  356. package/resources/voice.mjs +23 -3
  357. package/resources/voice.mjs.map +1 -1
  358. package/resources.d.mts +2 -0
  359. package/resources.d.mts.map +1 -0
  360. package/resources.d.ts.map +1 -1
  361. package/resources.js +2 -15
  362. package/resources.js.map +1 -1
  363. package/src/api-promise.ts +2 -0
  364. package/src/client.ts +1005 -0
  365. package/src/core/README.md +3 -0
  366. package/src/core/api-promise.ts +92 -0
  367. package/src/core/error.ts +130 -0
  368. package/src/core/resource.ts +11 -0
  369. package/src/core/uploads.ts +2 -0
  370. package/src/error.ts +2 -130
  371. package/src/index.ts +5 -405
  372. package/src/internal/README.md +3 -0
  373. package/src/internal/builtin-types.ts +93 -0
  374. package/src/internal/detect-platform.ts +196 -0
  375. package/src/internal/errors.ts +33 -0
  376. package/src/internal/headers.ts +97 -0
  377. package/src/internal/parse.ts +56 -0
  378. package/src/internal/request-options.ts +91 -0
  379. package/src/internal/shim-types.ts +26 -0
  380. package/src/internal/shims.ts +107 -0
  381. package/src/internal/to-file.ts +154 -0
  382. package/src/internal/types.ts +95 -0
  383. package/src/internal/uploads.ts +187 -0
  384. package/src/internal/utils/base64.ts +40 -0
  385. package/src/internal/utils/bytes.ts +32 -0
  386. package/src/internal/utils/env.ts +18 -0
  387. package/src/internal/utils/log.ts +126 -0
  388. package/src/internal/utils/path.ts +88 -0
  389. package/src/internal/utils/sleep.ts +3 -0
  390. package/src/internal/utils/uuid.ts +17 -0
  391. package/src/internal/utils/values.ts +105 -0
  392. package/src/internal/utils.ts +8 -0
  393. package/src/resource.ts +2 -11
  394. package/src/resources/agent.ts +529 -95
  395. package/src/resources/batch-call.ts +291 -24
  396. package/src/resources/call.ts +757 -105
  397. package/src/resources/chat-agent.ts +191 -41
  398. package/src/resources/chat.ts +108 -40
  399. package/src/resources/concurrency.ts +16 -3
  400. package/src/resources/conversation-flow-component.ts +9469 -4285
  401. package/src/resources/conversation-flow.ts +21572 -11318
  402. package/src/resources/index.ts +25 -2
  403. package/src/resources/knowledge-base.ts +40 -28
  404. package/src/resources/llm.ts +1422 -599
  405. package/src/resources/mcp-tool.ts +13 -6
  406. package/src/resources/phone-number.ts +410 -18
  407. package/src/resources/tests.ts +608 -9
  408. package/src/resources/voice.ts +122 -7
  409. package/src/tsconfig.json +2 -2
  410. package/src/uploads.ts +2 -259
  411. package/src/version.ts +1 -1
  412. package/uploads.d.mts +2 -0
  413. package/uploads.d.mts.map +1 -0
  414. package/uploads.d.ts +1 -74
  415. package/uploads.d.ts.map +1 -1
  416. package/uploads.js +3 -175
  417. package/uploads.js.map +1 -1
  418. package/uploads.mjs +1 -164
  419. package/uploads.mjs.map +1 -1
  420. package/version.d.mts +2 -0
  421. package/version.d.mts.map +1 -0
  422. package/version.d.ts +1 -1
  423. package/version.d.ts.map +1 -1
  424. package/version.js +1 -1
  425. package/version.js.map +1 -1
  426. package/version.mjs +1 -1
  427. package/version.mjs.map +1 -1
  428. package/_shims/MultipartBody.d.ts +0 -9
  429. package/_shims/MultipartBody.d.ts.map +0 -1
  430. package/_shims/MultipartBody.js +0 -16
  431. package/_shims/MultipartBody.js.map +0 -1
  432. package/_shims/MultipartBody.mjs +0 -12
  433. package/_shims/MultipartBody.mjs.map +0 -1
  434. package/_shims/README.md +0 -46
  435. package/_shims/auto/runtime-bun.d.ts +0 -5
  436. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  437. package/_shims/auto/runtime-bun.js +0 -21
  438. package/_shims/auto/runtime-bun.js.map +0 -1
  439. package/_shims/auto/runtime-bun.mjs +0 -2
  440. package/_shims/auto/runtime-bun.mjs.map +0 -1
  441. package/_shims/auto/runtime-node.d.ts +0 -5
  442. package/_shims/auto/runtime-node.d.ts.map +0 -1
  443. package/_shims/auto/runtime-node.js +0 -21
  444. package/_shims/auto/runtime-node.js.map +0 -1
  445. package/_shims/auto/runtime-node.mjs +0 -2
  446. package/_shims/auto/runtime-node.mjs.map +0 -1
  447. package/_shims/auto/runtime.d.ts +0 -5
  448. package/_shims/auto/runtime.d.ts.map +0 -1
  449. package/_shims/auto/runtime.js +0 -21
  450. package/_shims/auto/runtime.js.map +0 -1
  451. package/_shims/auto/runtime.mjs +0 -2
  452. package/_shims/auto/runtime.mjs.map +0 -1
  453. package/_shims/auto/types-node.d.ts +0 -5
  454. package/_shims/auto/types-node.d.ts.map +0 -1
  455. package/_shims/auto/types-node.js +0 -21
  456. package/_shims/auto/types-node.js.map +0 -1
  457. package/_shims/auto/types-node.mjs +0 -2
  458. package/_shims/auto/types-node.mjs.map +0 -1
  459. package/_shims/auto/types.d.ts +0 -101
  460. package/_shims/auto/types.js +0 -3
  461. package/_shims/auto/types.mjs +0 -3
  462. package/_shims/bun-runtime.d.ts +0 -6
  463. package/_shims/bun-runtime.d.ts.map +0 -1
  464. package/_shims/bun-runtime.js +0 -14
  465. package/_shims/bun-runtime.js.map +0 -1
  466. package/_shims/bun-runtime.mjs +0 -10
  467. package/_shims/bun-runtime.mjs.map +0 -1
  468. package/_shims/index.d.ts +0 -83
  469. package/_shims/index.js +0 -17
  470. package/_shims/index.mjs +0 -11
  471. package/_shims/manual-types.d.ts +0 -12
  472. package/_shims/manual-types.js +0 -3
  473. package/_shims/manual-types.mjs +0 -3
  474. package/_shims/node-runtime.d.ts +0 -3
  475. package/_shims/node-runtime.d.ts.map +0 -1
  476. package/_shims/node-runtime.js +0 -89
  477. package/_shims/node-runtime.js.map +0 -1
  478. package/_shims/node-runtime.mjs +0 -56
  479. package/_shims/node-runtime.mjs.map +0 -1
  480. package/_shims/node-types.d.ts +0 -42
  481. package/_shims/node-types.js +0 -3
  482. package/_shims/node-types.mjs +0 -3
  483. package/_shims/registry.d.ts +0 -37
  484. package/_shims/registry.d.ts.map +0 -1
  485. package/_shims/registry.js +0 -41
  486. package/_shims/registry.js.map +0 -1
  487. package/_shims/registry.mjs +0 -37
  488. package/_shims/registry.mjs.map +0 -1
  489. package/_shims/web-runtime.d.ts +0 -5
  490. package/_shims/web-runtime.d.ts.map +0 -1
  491. package/_shims/web-runtime.js +0 -78
  492. package/_shims/web-runtime.js.map +0 -1
  493. package/_shims/web-runtime.mjs +0 -71
  494. package/_shims/web-runtime.mjs.map +0 -1
  495. package/_shims/web-types.d.ts +0 -83
  496. package/_shims/web-types.js +0 -3
  497. package/_shims/web-types.mjs +0 -3
  498. package/core.d.ts +0 -255
  499. package/core.d.ts.map +0 -1
  500. package/core.js +0 -924
  501. package/core.js.map +0 -1
  502. package/core.mjs +0 -892
  503. package/core.mjs.map +0 -1
  504. package/lib/webhook_auth.d.ts +0 -27
  505. package/lib/webhook_auth.d.ts.map +0 -1
  506. package/lib/webhook_auth.js +0 -50
  507. package/lib/webhook_auth.js.map +0 -1
  508. package/lib/webhook_auth.mjs +0 -45
  509. package/lib/webhook_auth.mjs.map +0 -1
  510. package/shims/node.d.ts +0 -30
  511. package/shims/node.d.ts.map +0 -1
  512. package/shims/node.js +0 -31
  513. package/shims/node.js.map +0 -1
  514. package/shims/node.mjs +0 -5
  515. package/shims/node.mjs.map +0 -1
  516. package/shims/web.d.ts +0 -26
  517. package/shims/web.d.ts.map +0 -1
  518. package/shims/web.js +0 -31
  519. package/shims/web.js.map +0 -1
  520. package/shims/web.mjs +0 -5
  521. package/shims/web.mjs.map +0 -1
  522. package/src/_shims/MultipartBody.ts +0 -9
  523. package/src/_shims/README.md +0 -46
  524. package/src/_shims/auto/runtime-bun.ts +0 -4
  525. package/src/_shims/auto/runtime-node.ts +0 -4
  526. package/src/_shims/auto/runtime.ts +0 -4
  527. package/src/_shims/auto/types-node.ts +0 -4
  528. package/src/_shims/auto/types.d.ts +0 -101
  529. package/src/_shims/auto/types.js +0 -3
  530. package/src/_shims/auto/types.mjs +0 -3
  531. package/src/_shims/bun-runtime.ts +0 -14
  532. package/src/_shims/index.d.ts +0 -83
  533. package/src/_shims/index.js +0 -17
  534. package/src/_shims/index.mjs +0 -11
  535. package/src/_shims/manual-types.d.ts +0 -12
  536. package/src/_shims/manual-types.js +0 -3
  537. package/src/_shims/manual-types.mjs +0 -3
  538. package/src/_shims/node-runtime.ts +0 -81
  539. package/src/_shims/node-types.d.ts +0 -42
  540. package/src/_shims/node-types.js +0 -3
  541. package/src/_shims/node-types.mjs +0 -3
  542. package/src/_shims/registry.ts +0 -67
  543. package/src/_shims/web-runtime.ts +0 -103
  544. package/src/_shims/web-types.d.ts +0 -83
  545. package/src/_shims/web-types.js +0 -3
  546. package/src/_shims/web-types.mjs +0 -3
  547. package/src/core.ts +0 -1236
  548. package/src/lib/webhook_auth.ts +0 -69
  549. package/src/shims/node.ts +0 -50
  550. package/src/shims/web.ts +0 -50
@@ -0,0 +1,4280 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { RequestOptions } from "../internal/request-options.mjs";
4
+ export declare class Call extends APIResource {
5
+ /**
6
+ * Retrieve details of a specific call
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const callResponse = await client.call.retrieve(
11
+ * '119c3f8e47135a29e65947eeb34cf12d',
12
+ * );
13
+ * ```
14
+ */
15
+ retrieve(callID: string, options?: RequestOptions): APIPromise<CallResponse>;
16
+ /**
17
+ * Update metadata and sensitive data storage settings for an existing call.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const callResponse = await client.call.update(
22
+ * 'call_a4441234567890777c4a4a123e6',
23
+ * {
24
+ * data_storage_setting: 'everything_except_pii',
25
+ * metadata: {
26
+ * customer_id: 'cust_123',
27
+ * notes: 'Follow-up required',
28
+ * },
29
+ * },
30
+ * );
31
+ * ```
32
+ */
33
+ update(callID: string, body: CallUpdateParams, options?: RequestOptions): APIPromise<CallResponse>;
34
+ /**
35
+ * Retrieve call details
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const callResponses = await client.call.list();
40
+ * ```
41
+ */
42
+ list(body: CallListParams, options?: RequestOptions): APIPromise<CallListResponse>;
43
+ /**
44
+ * Delete a specific call and its associated data
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * await client.call.delete(
49
+ * '119c3f8e47135a29e65947eeb34cf12d',
50
+ * );
51
+ * ```
52
+ */
53
+ delete(callID: string, options?: RequestOptions): APIPromise<void>;
54
+ /**
55
+ * Create a new outbound phone call
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const phoneCallResponse = await client.call.createPhoneCall(
60
+ * {
61
+ * from_number: '+14157774444',
62
+ * to_number: '+12137774445',
63
+ * },
64
+ * );
65
+ * ```
66
+ */
67
+ createPhoneCall(body: CallCreatePhoneCallParams, options?: RequestOptions): APIPromise<PhoneCallResponse>;
68
+ /**
69
+ * Create a new web call
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const webCallResponse = await client.call.createWebCall({
74
+ * agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
75
+ * });
76
+ * ```
77
+ */
78
+ createWebCall(body: CallCreateWebCallParams, options?: RequestOptions): APIPromise<WebCallResponse>;
79
+ /**
80
+ * Register a new phone call for custom telephony
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const phoneCallResponse =
85
+ * await client.call.registerPhoneCall({
86
+ * agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
87
+ * });
88
+ * ```
89
+ */
90
+ registerPhoneCall(body: CallRegisterPhoneCallParams, options?: RequestOptions): APIPromise<PhoneCallResponse>;
91
+ }
92
+ export type CallResponse = WebCallResponse | PhoneCallResponse;
93
+ export interface PhoneCallResponse {
94
+ /**
95
+ * Corresponding agent id of this call.
96
+ */
97
+ agent_id: string;
98
+ /**
99
+ * The version of the agent.
100
+ */
101
+ agent_version: number;
102
+ /**
103
+ * Unique id of the call. Used to identify the call in the LLM websocket and used
104
+ * to authenticate in the audio websocket.
105
+ */
106
+ call_id: string;
107
+ /**
108
+ * Status of call.
109
+ *
110
+ * - `registered`: Call id issued, starting to make a call using this id.
111
+ * - `ongoing`: Call connected and ongoing.
112
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
113
+ * hung up, or call transferred.
114
+ * - `error`: Call encountered error.
115
+ */
116
+ call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error';
117
+ /**
118
+ * Type of the call. Used to distinguish between web call and phone call.
119
+ */
120
+ call_type: 'phone_call';
121
+ /**
122
+ * Direction of the phone call.
123
+ */
124
+ direction: 'inbound' | 'outbound';
125
+ /**
126
+ * The caller number.
127
+ */
128
+ from_number: string;
129
+ /**
130
+ * The callee number.
131
+ */
132
+ to_number: string;
133
+ /**
134
+ * Name of the agent.
135
+ */
136
+ agent_name?: string;
137
+ /**
138
+ * Post call analysis that includes information such as sentiment, status, summary,
139
+ * and custom defined data to extract. Available after call ends. Subscribe to
140
+ * `call_analyzed` webhook event type to receive it once ready.
141
+ */
142
+ call_analysis?: PhoneCallResponse.CallAnalysis;
143
+ /**
144
+ * Cost of the call, including all the products and their costs and discount.
145
+ */
146
+ call_cost?: PhoneCallResponse.CallCost;
147
+ /**
148
+ * Dynamic variables collected from the call. Only available after the call ends.
149
+ */
150
+ collected_dynamic_variables?: {
151
+ [key: string]: unknown;
152
+ };
153
+ /**
154
+ * Custom SIP headers to be added to the call.
155
+ */
156
+ custom_sip_headers?: {
157
+ [key: string]: string;
158
+ };
159
+ /**
160
+ * Data storage setting for this call's agent. "everything" stores all data,
161
+ * "everything_except_pii" excludes PII when possible, "basic_attributes_only"
162
+ * stores only metadata.
163
+ */
164
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
165
+ /**
166
+ * The reason for the disconnection of the call. Read detailed description about
167
+ * reasons listed here at
168
+ * [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons).
169
+ */
170
+ disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_valid_payment' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout';
171
+ /**
172
+ * Duration of the call in milliseconds. Available after call ends.
173
+ */
174
+ duration_ms?: number;
175
+ /**
176
+ * End timestamp (milliseconds since epoch) of the call. Available after call ends.
177
+ */
178
+ end_timestamp?: number;
179
+ /**
180
+ * URL to the knowledge base retrieved contents of the call. Available after call
181
+ * ends if the call utilizes knowledge base feature. It consists of the respond id
182
+ * and the retrieved contents related to that response. It's already rendered in
183
+ * call history tab of dashboard, and you can also manually download and check
184
+ * against the transcript to view the knowledge base retrieval results.
185
+ */
186
+ knowledge_base_retrieved_contents_url?: string;
187
+ /**
188
+ * Latency tracking of the call, available after call ends. Not all fields here
189
+ * will be available, as it depends on the type of call and feature used.
190
+ */
191
+ latency?: PhoneCallResponse.Latency;
192
+ /**
193
+ * LLM token usage of the call, available after call ends. Not populated if using
194
+ * custom LLM, realtime API, or no LLM call is made.
195
+ */
196
+ llm_token_usage?: PhoneCallResponse.LlmTokenUsage;
197
+ /**
198
+ * An arbitrary object for storage purpose only. You can put anything here like
199
+ * your internal customer id associated with the call. Not used for processing. You
200
+ * can later get this field from the call object.
201
+ */
202
+ metadata?: unknown;
203
+ /**
204
+ * Whether this agent opts in for signed URLs for public logs and recordings. When
205
+ * enabled, the generated URLs will include security signatures that restrict
206
+ * access and automatically expire after 24 hours.
207
+ */
208
+ opt_in_signed_url?: boolean;
209
+ /**
210
+ * Public log of the call, containing details about all the requests and responses
211
+ * received in LLM WebSocket, latency tracking for each turntaking, helpful for
212
+ * debugging and tracing. Available after call ends.
213
+ */
214
+ public_log_url?: string;
215
+ /**
216
+ * Recording of the call, with each party's audio stored in a separate channel.
217
+ * Available after the call ends.
218
+ */
219
+ recording_multi_channel_url?: string;
220
+ /**
221
+ * Recording of the call. Available after call ends.
222
+ */
223
+ recording_url?: string;
224
+ /**
225
+ * Add optional dynamic variables in key value pairs of string that injects into
226
+ * your Response Engine prompt and tool description. Only applicable for Response
227
+ * Engine.
228
+ */
229
+ retell_llm_dynamic_variables?: {
230
+ [key: string]: unknown;
231
+ };
232
+ /**
233
+ * Recording of the call without PII, with each party's audio stored in a separate
234
+ * channel. Available after the call ends.
235
+ */
236
+ scrubbed_recording_multi_channel_url?: string;
237
+ /**
238
+ * Recording of the call without PII. Available after call ends.
239
+ */
240
+ scrubbed_recording_url?: string;
241
+ /**
242
+ * Transcript of the call weaved with tool call invocation and results, without
243
+ * PII. It precisely captures when (at what utterance, which word) the tool was
244
+ * invoked and what was the result. Available after call ends.
245
+ */
246
+ scrubbed_transcript_with_tool_calls?: Array<PhoneCallResponse.Utterance | PhoneCallResponse.ToolCallInvocationUtterance | PhoneCallResponse.ToolCallResultUtterance | PhoneCallResponse.NodeTransitionUtterance | PhoneCallResponse.DtmfUtterance>;
247
+ /**
248
+ * Begin timestamp (milliseconds since epoch) of the call. Available after call
249
+ * starts.
250
+ */
251
+ start_timestamp?: number;
252
+ /**
253
+ * Telephony identifier of the call, populated when available. Tracking purposes
254
+ * only.
255
+ */
256
+ telephony_identifier?: PhoneCallResponse.TelephonyIdentifier;
257
+ /**
258
+ * Transcription of the call. Available after call ends.
259
+ */
260
+ transcript?: string;
261
+ /**
262
+ * Transcript of the call in the format of a list of utterance, with timestamp.
263
+ * Available after call ends.
264
+ */
265
+ transcript_object?: Array<PhoneCallResponse.TranscriptObject>;
266
+ /**
267
+ * Transcript of the call weaved with tool call invocation and results. It
268
+ * precisely captures when (at what utterance, which word) the tool was invoked and
269
+ * what was the result. Available after call ends.
270
+ */
271
+ transcript_with_tool_calls?: Array<PhoneCallResponse.Utterance | PhoneCallResponse.ToolCallInvocationUtterance | PhoneCallResponse.ToolCallResultUtterance | PhoneCallResponse.NodeTransitionUtterance | PhoneCallResponse.DtmfUtterance>;
272
+ /**
273
+ * The destination number or identifier where the call was transferred to. Only
274
+ * populated when the disconnection reason was `call_transfer`. Can be a phone
275
+ * number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a
276
+ * ";transport=..." portion (if transport is known) where the transport type can be
277
+ * "tls", "tcp" or "udp".
278
+ */
279
+ transfer_destination?: string | null;
280
+ /**
281
+ * Transfer end timestamp (milliseconds since epoch) of the call. Available after
282
+ * transfer call ends.
283
+ */
284
+ transfer_end_timestamp?: number;
285
+ }
286
+ export declare namespace PhoneCallResponse {
287
+ /**
288
+ * Post call analysis that includes information such as sentiment, status, summary,
289
+ * and custom defined data to extract. Available after call ends. Subscribe to
290
+ * `call_analyzed` webhook event type to receive it once ready.
291
+ */
292
+ interface CallAnalysis {
293
+ /**
294
+ * Whether the agent seems to have a successful call with the user, where the agent
295
+ * finishes the task, and the call was complete without being cutoff.
296
+ */
297
+ call_successful?: boolean;
298
+ /**
299
+ * A high level summary of the call.
300
+ */
301
+ call_summary?: string;
302
+ /**
303
+ * Custom analysis data that was extracted based on the schema defined in agent
304
+ * post call analysis data. Can be empty if nothing is specified.
305
+ */
306
+ custom_analysis_data?: unknown;
307
+ /**
308
+ * Whether the call is entered voicemail.
309
+ */
310
+ in_voicemail?: boolean;
311
+ /**
312
+ * Sentiment of the user in the call.
313
+ */
314
+ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
315
+ }
316
+ /**
317
+ * Cost of the call, including all the products and their costs and discount.
318
+ */
319
+ interface CallCost {
320
+ /**
321
+ * Combined cost of all individual costs in cents
322
+ */
323
+ combined_cost: number;
324
+ /**
325
+ * List of products with their unit prices and costs in cents
326
+ */
327
+ product_costs: Array<CallCost.ProductCost>;
328
+ /**
329
+ * Total duration of the call in seconds
330
+ */
331
+ total_duration_seconds: number;
332
+ /**
333
+ * Total unit duration price of all products in cents per second
334
+ */
335
+ total_duration_unit_price: number;
336
+ }
337
+ namespace CallCost {
338
+ interface ProductCost {
339
+ /**
340
+ * Cost for the product in cents for the duration of the call.
341
+ */
342
+ cost: number;
343
+ /**
344
+ * Product name that has a cost associated with it.
345
+ */
346
+ product: string;
347
+ /**
348
+ * True if this cost item is for a transfer segment.
349
+ */
350
+ is_transfer_leg_cost?: boolean;
351
+ /**
352
+ * Unit price of the product in cents per second.
353
+ */
354
+ unit_price?: number;
355
+ }
356
+ }
357
+ /**
358
+ * Latency tracking of the call, available after call ends. Not all fields here
359
+ * will be available, as it depends on the type of call and feature used.
360
+ */
361
+ interface Latency {
362
+ /**
363
+ * Transcription latency (diff between the duration of the chunks streamed and the
364
+ * durations of the transcribed part) tracking of the call.
365
+ */
366
+ asr?: Latency.Asr;
367
+ /**
368
+ * End to end latency (from user stops talking to agent start talking) tracking of
369
+ * the call. This latency does not account for the network trip time from Retell
370
+ * server to user frontend. The latency is tracked every time turn change between
371
+ * user and agent.
372
+ */
373
+ e2e?: Latency.E2E;
374
+ /**
375
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
376
+ * relevant context received) tracking of the call. Only populated when using
377
+ * knowledge base feature for the agent of the call.
378
+ */
379
+ knowledge_base?: Latency.KnowledgeBase;
380
+ /**
381
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
382
+ * of the call. When using custom LLM. this latency includes LLM websocket
383
+ * roundtrip time between user server and Retell server.
384
+ */
385
+ llm?: Latency.Llm;
386
+ /**
387
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
388
+ * of the call. Only populated for calls using custom LLM.
389
+ */
390
+ llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt;
391
+ /**
392
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
393
+ * received) tracking of the call. Only populated for calls that uses S2S model
394
+ * like Realtime API.
395
+ */
396
+ s2s?: Latency.S2s;
397
+ /**
398
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
399
+ * tracking of the call.
400
+ */
401
+ tts?: Latency.Tts;
402
+ }
403
+ namespace Latency {
404
+ /**
405
+ * Transcription latency (diff between the duration of the chunks streamed and the
406
+ * durations of the transcribed part) tracking of the call.
407
+ */
408
+ interface Asr {
409
+ /**
410
+ * Maximum latency in the call, measured in milliseconds.
411
+ */
412
+ max?: number;
413
+ /**
414
+ * Minimum latency in the call, measured in milliseconds.
415
+ */
416
+ min?: number;
417
+ /**
418
+ * Number of data points (number of times latency is tracked).
419
+ */
420
+ num?: number;
421
+ /**
422
+ * 50 percentile of latency, measured in milliseconds.
423
+ */
424
+ p50?: number;
425
+ /**
426
+ * 90 percentile of latency, measured in milliseconds.
427
+ */
428
+ p90?: number;
429
+ /**
430
+ * 95 percentile of latency, measured in milliseconds.
431
+ */
432
+ p95?: number;
433
+ /**
434
+ * 99 percentile of latency, measured in milliseconds.
435
+ */
436
+ p99?: number;
437
+ /**
438
+ * All the latency data points in the call, measured in milliseconds.
439
+ */
440
+ values?: Array<number>;
441
+ }
442
+ /**
443
+ * End to end latency (from user stops talking to agent start talking) tracking of
444
+ * the call. This latency does not account for the network trip time from Retell
445
+ * server to user frontend. The latency is tracked every time turn change between
446
+ * user and agent.
447
+ */
448
+ interface E2E {
449
+ /**
450
+ * Maximum latency in the call, measured in milliseconds.
451
+ */
452
+ max?: number;
453
+ /**
454
+ * Minimum latency in the call, measured in milliseconds.
455
+ */
456
+ min?: number;
457
+ /**
458
+ * Number of data points (number of times latency is tracked).
459
+ */
460
+ num?: number;
461
+ /**
462
+ * 50 percentile of latency, measured in milliseconds.
463
+ */
464
+ p50?: number;
465
+ /**
466
+ * 90 percentile of latency, measured in milliseconds.
467
+ */
468
+ p90?: number;
469
+ /**
470
+ * 95 percentile of latency, measured in milliseconds.
471
+ */
472
+ p95?: number;
473
+ /**
474
+ * 99 percentile of latency, measured in milliseconds.
475
+ */
476
+ p99?: number;
477
+ /**
478
+ * All the latency data points in the call, measured in milliseconds.
479
+ */
480
+ values?: Array<number>;
481
+ }
482
+ /**
483
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
484
+ * relevant context received) tracking of the call. Only populated when using
485
+ * knowledge base feature for the agent of the call.
486
+ */
487
+ interface KnowledgeBase {
488
+ /**
489
+ * Maximum latency in the call, measured in milliseconds.
490
+ */
491
+ max?: number;
492
+ /**
493
+ * Minimum latency in the call, measured in milliseconds.
494
+ */
495
+ min?: number;
496
+ /**
497
+ * Number of data points (number of times latency is tracked).
498
+ */
499
+ num?: number;
500
+ /**
501
+ * 50 percentile of latency, measured in milliseconds.
502
+ */
503
+ p50?: number;
504
+ /**
505
+ * 90 percentile of latency, measured in milliseconds.
506
+ */
507
+ p90?: number;
508
+ /**
509
+ * 95 percentile of latency, measured in milliseconds.
510
+ */
511
+ p95?: number;
512
+ /**
513
+ * 99 percentile of latency, measured in milliseconds.
514
+ */
515
+ p99?: number;
516
+ /**
517
+ * All the latency data points in the call, measured in milliseconds.
518
+ */
519
+ values?: Array<number>;
520
+ }
521
+ /**
522
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
523
+ * of the call. When using custom LLM. this latency includes LLM websocket
524
+ * roundtrip time between user server and Retell server.
525
+ */
526
+ interface Llm {
527
+ /**
528
+ * Maximum latency in the call, measured in milliseconds.
529
+ */
530
+ max?: number;
531
+ /**
532
+ * Minimum latency in the call, measured in milliseconds.
533
+ */
534
+ min?: number;
535
+ /**
536
+ * Number of data points (number of times latency is tracked).
537
+ */
538
+ num?: number;
539
+ /**
540
+ * 50 percentile of latency, measured in milliseconds.
541
+ */
542
+ p50?: number;
543
+ /**
544
+ * 90 percentile of latency, measured in milliseconds.
545
+ */
546
+ p90?: number;
547
+ /**
548
+ * 95 percentile of latency, measured in milliseconds.
549
+ */
550
+ p95?: number;
551
+ /**
552
+ * 99 percentile of latency, measured in milliseconds.
553
+ */
554
+ p99?: number;
555
+ /**
556
+ * All the latency data points in the call, measured in milliseconds.
557
+ */
558
+ values?: Array<number>;
559
+ }
560
+ /**
561
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
562
+ * of the call. Only populated for calls using custom LLM.
563
+ */
564
+ interface LlmWebsocketNetworkRtt {
565
+ /**
566
+ * Maximum latency in the call, measured in milliseconds.
567
+ */
568
+ max?: number;
569
+ /**
570
+ * Minimum latency in the call, measured in milliseconds.
571
+ */
572
+ min?: number;
573
+ /**
574
+ * Number of data points (number of times latency is tracked).
575
+ */
576
+ num?: number;
577
+ /**
578
+ * 50 percentile of latency, measured in milliseconds.
579
+ */
580
+ p50?: number;
581
+ /**
582
+ * 90 percentile of latency, measured in milliseconds.
583
+ */
584
+ p90?: number;
585
+ /**
586
+ * 95 percentile of latency, measured in milliseconds.
587
+ */
588
+ p95?: number;
589
+ /**
590
+ * 99 percentile of latency, measured in milliseconds.
591
+ */
592
+ p99?: number;
593
+ /**
594
+ * All the latency data points in the call, measured in milliseconds.
595
+ */
596
+ values?: Array<number>;
597
+ }
598
+ /**
599
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
600
+ * received) tracking of the call. Only populated for calls that uses S2S model
601
+ * like Realtime API.
602
+ */
603
+ interface S2s {
604
+ /**
605
+ * Maximum latency in the call, measured in milliseconds.
606
+ */
607
+ max?: number;
608
+ /**
609
+ * Minimum latency in the call, measured in milliseconds.
610
+ */
611
+ min?: number;
612
+ /**
613
+ * Number of data points (number of times latency is tracked).
614
+ */
615
+ num?: number;
616
+ /**
617
+ * 50 percentile of latency, measured in milliseconds.
618
+ */
619
+ p50?: number;
620
+ /**
621
+ * 90 percentile of latency, measured in milliseconds.
622
+ */
623
+ p90?: number;
624
+ /**
625
+ * 95 percentile of latency, measured in milliseconds.
626
+ */
627
+ p95?: number;
628
+ /**
629
+ * 99 percentile of latency, measured in milliseconds.
630
+ */
631
+ p99?: number;
632
+ /**
633
+ * All the latency data points in the call, measured in milliseconds.
634
+ */
635
+ values?: Array<number>;
636
+ }
637
+ /**
638
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
639
+ * tracking of the call.
640
+ */
641
+ interface Tts {
642
+ /**
643
+ * Maximum latency in the call, measured in milliseconds.
644
+ */
645
+ max?: number;
646
+ /**
647
+ * Minimum latency in the call, measured in milliseconds.
648
+ */
649
+ min?: number;
650
+ /**
651
+ * Number of data points (number of times latency is tracked).
652
+ */
653
+ num?: number;
654
+ /**
655
+ * 50 percentile of latency, measured in milliseconds.
656
+ */
657
+ p50?: number;
658
+ /**
659
+ * 90 percentile of latency, measured in milliseconds.
660
+ */
661
+ p90?: number;
662
+ /**
663
+ * 95 percentile of latency, measured in milliseconds.
664
+ */
665
+ p95?: number;
666
+ /**
667
+ * 99 percentile of latency, measured in milliseconds.
668
+ */
669
+ p99?: number;
670
+ /**
671
+ * All the latency data points in the call, measured in milliseconds.
672
+ */
673
+ values?: Array<number>;
674
+ }
675
+ }
676
+ /**
677
+ * LLM token usage of the call, available after call ends. Not populated if using
678
+ * custom LLM, realtime API, or no LLM call is made.
679
+ */
680
+ interface LlmTokenUsage {
681
+ /**
682
+ * Average token count of the call.
683
+ */
684
+ average: number;
685
+ /**
686
+ * Number of requests made to the LLM.
687
+ */
688
+ num_requests: number;
689
+ /**
690
+ * All the token count values in the call.
691
+ */
692
+ values: Array<number>;
693
+ }
694
+ interface Utterance {
695
+ /**
696
+ * Transcript of the utterances.
697
+ */
698
+ content: string;
699
+ /**
700
+ * Documents whether this utterance is spoken by agent or user.
701
+ */
702
+ role: 'agent' | 'user' | 'transfer_target';
703
+ /**
704
+ * Array of words in the utterance with the word timestamp. Useful for
705
+ * understanding what word was spoken at what time. Note that the word timestamp is
706
+ * not guaranteed to be accurate, it's more like an approximation.
707
+ */
708
+ words: Array<Utterance.Word>;
709
+ }
710
+ namespace Utterance {
711
+ interface Word {
712
+ /**
713
+ * End time of the word in the call in second. This is relative audio time, not
714
+ * wall time.
715
+ */
716
+ end?: number;
717
+ /**
718
+ * Start time of the word in the call in second. This is relative audio time, not
719
+ * wall time.
720
+ */
721
+ start?: number;
722
+ /**
723
+ * Word transcript (with punctuation if applicable).
724
+ */
725
+ word?: string;
726
+ }
727
+ }
728
+ interface ToolCallInvocationUtterance {
729
+ /**
730
+ * Arguments for this tool call, it's a stringified JSON object.
731
+ */
732
+ arguments: string;
733
+ /**
734
+ * Name of the function in this tool call.
735
+ */
736
+ name: string;
737
+ /**
738
+ * This is a tool call invocation.
739
+ */
740
+ role: 'tool_call_invocation';
741
+ /**
742
+ * Tool call id, globally unique.
743
+ */
744
+ tool_call_id: string;
745
+ /**
746
+ * Optional thought signature from Google Gemini thinking models. This is used
747
+ * internally to maintain reasoning chain in multi-turn function calling.
748
+ */
749
+ thought_signature?: string;
750
+ }
751
+ interface ToolCallResultUtterance {
752
+ /**
753
+ * Result of the tool call, can be a string, a stringified json, etc.
754
+ */
755
+ content: string;
756
+ /**
757
+ * This is the result of a tool call.
758
+ */
759
+ role: 'tool_call_result';
760
+ /**
761
+ * Tool call id, globally unique.
762
+ */
763
+ tool_call_id: string;
764
+ }
765
+ interface NodeTransitionUtterance {
766
+ /**
767
+ * Former node id
768
+ */
769
+ former_node_id: string;
770
+ /**
771
+ * Former node name
772
+ */
773
+ former_node_name: string;
774
+ /**
775
+ * New node id
776
+ */
777
+ new_node_id: string;
778
+ /**
779
+ * New node name
780
+ */
781
+ new_node_name: string;
782
+ /**
783
+ * This is result of a node transition
784
+ */
785
+ role: 'node_transition';
786
+ }
787
+ interface DtmfUtterance {
788
+ /**
789
+ * The digit pressed by the user. Will be a single digit string like "1", "2", "3",
790
+ * "\*", "#" etc.
791
+ */
792
+ digit: string;
793
+ /**
794
+ * Digit pressed by the user from their phone keypad.
795
+ */
796
+ role: 'dtmf';
797
+ }
798
+ /**
799
+ * Telephony identifier of the call, populated when available. Tracking purposes
800
+ * only.
801
+ */
802
+ interface TelephonyIdentifier {
803
+ /**
804
+ * Twilio call sid.
805
+ */
806
+ twilio_call_sid?: string;
807
+ }
808
+ interface TranscriptObject {
809
+ /**
810
+ * Transcript of the utterances.
811
+ */
812
+ content: string;
813
+ /**
814
+ * Documents whether this utterance is spoken by agent or user.
815
+ */
816
+ role: 'agent' | 'user' | 'transfer_target';
817
+ /**
818
+ * Array of words in the utterance with the word timestamp. Useful for
819
+ * understanding what word was spoken at what time. Note that the word timestamp is
820
+ * not guaranteed to be accurate, it's more like an approximation.
821
+ */
822
+ words: Array<TranscriptObject.Word>;
823
+ }
824
+ namespace TranscriptObject {
825
+ interface Word {
826
+ /**
827
+ * End time of the word in the call in second. This is relative audio time, not
828
+ * wall time.
829
+ */
830
+ end?: number;
831
+ /**
832
+ * Start time of the word in the call in second. This is relative audio time, not
833
+ * wall time.
834
+ */
835
+ start?: number;
836
+ /**
837
+ * Word transcript (with punctuation if applicable).
838
+ */
839
+ word?: string;
840
+ }
841
+ }
842
+ interface Utterance {
843
+ /**
844
+ * Transcript of the utterances.
845
+ */
846
+ content: string;
847
+ /**
848
+ * Documents whether this utterance is spoken by agent or user.
849
+ */
850
+ role: 'agent' | 'user' | 'transfer_target';
851
+ /**
852
+ * Array of words in the utterance with the word timestamp. Useful for
853
+ * understanding what word was spoken at what time. Note that the word timestamp is
854
+ * not guaranteed to be accurate, it's more like an approximation.
855
+ */
856
+ words: Array<Utterance.Word>;
857
+ }
858
+ namespace Utterance {
859
+ interface Word {
860
+ /**
861
+ * End time of the word in the call in second. This is relative audio time, not
862
+ * wall time.
863
+ */
864
+ end?: number;
865
+ /**
866
+ * Start time of the word in the call in second. This is relative audio time, not
867
+ * wall time.
868
+ */
869
+ start?: number;
870
+ /**
871
+ * Word transcript (with punctuation if applicable).
872
+ */
873
+ word?: string;
874
+ }
875
+ }
876
+ interface ToolCallInvocationUtterance {
877
+ /**
878
+ * Arguments for this tool call, it's a stringified JSON object.
879
+ */
880
+ arguments: string;
881
+ /**
882
+ * Name of the function in this tool call.
883
+ */
884
+ name: string;
885
+ /**
886
+ * This is a tool call invocation.
887
+ */
888
+ role: 'tool_call_invocation';
889
+ /**
890
+ * Tool call id, globally unique.
891
+ */
892
+ tool_call_id: string;
893
+ /**
894
+ * Optional thought signature from Google Gemini thinking models. This is used
895
+ * internally to maintain reasoning chain in multi-turn function calling.
896
+ */
897
+ thought_signature?: string;
898
+ }
899
+ interface ToolCallResultUtterance {
900
+ /**
901
+ * Result of the tool call, can be a string, a stringified json, etc.
902
+ */
903
+ content: string;
904
+ /**
905
+ * This is the result of a tool call.
906
+ */
907
+ role: 'tool_call_result';
908
+ /**
909
+ * Tool call id, globally unique.
910
+ */
911
+ tool_call_id: string;
912
+ }
913
+ interface NodeTransitionUtterance {
914
+ /**
915
+ * Former node id
916
+ */
917
+ former_node_id: string;
918
+ /**
919
+ * Former node name
920
+ */
921
+ former_node_name: string;
922
+ /**
923
+ * New node id
924
+ */
925
+ new_node_id: string;
926
+ /**
927
+ * New node name
928
+ */
929
+ new_node_name: string;
930
+ /**
931
+ * This is result of a node transition
932
+ */
933
+ role: 'node_transition';
934
+ }
935
+ interface DtmfUtterance {
936
+ /**
937
+ * The digit pressed by the user. Will be a single digit string like "1", "2", "3",
938
+ * "\*", "#" etc.
939
+ */
940
+ digit: string;
941
+ /**
942
+ * Digit pressed by the user from their phone keypad.
943
+ */
944
+ role: 'dtmf';
945
+ }
946
+ }
947
+ export interface WebCallResponse {
948
+ /**
949
+ * Access token to enter the web call room. This needs to be passed to your
950
+ * frontend to join the call.
951
+ */
952
+ access_token: string;
953
+ /**
954
+ * Corresponding agent id of this call.
955
+ */
956
+ agent_id: string;
957
+ /**
958
+ * The version of the agent.
959
+ */
960
+ agent_version: number;
961
+ /**
962
+ * Unique id of the call. Used to identify the call in the LLM websocket and used
963
+ * to authenticate in the audio websocket.
964
+ */
965
+ call_id: string;
966
+ /**
967
+ * Status of call.
968
+ *
969
+ * - `registered`: Call id issued, starting to make a call using this id.
970
+ * - `ongoing`: Call connected and ongoing.
971
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
972
+ * hung up, or call transferred.
973
+ * - `error`: Call encountered error.
974
+ */
975
+ call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error';
976
+ /**
977
+ * Type of the call. Used to distinguish between web call and phone call.
978
+ */
979
+ call_type: 'web_call';
980
+ /**
981
+ * Name of the agent.
982
+ */
983
+ agent_name?: string;
984
+ /**
985
+ * Post call analysis that includes information such as sentiment, status, summary,
986
+ * and custom defined data to extract. Available after call ends. Subscribe to
987
+ * `call_analyzed` webhook event type to receive it once ready.
988
+ */
989
+ call_analysis?: WebCallResponse.CallAnalysis;
990
+ /**
991
+ * Cost of the call, including all the products and their costs and discount.
992
+ */
993
+ call_cost?: WebCallResponse.CallCost;
994
+ /**
995
+ * Dynamic variables collected from the call. Only available after the call ends.
996
+ */
997
+ collected_dynamic_variables?: {
998
+ [key: string]: unknown;
999
+ };
1000
+ /**
1001
+ * Custom SIP headers to be added to the call.
1002
+ */
1003
+ custom_sip_headers?: {
1004
+ [key: string]: string;
1005
+ };
1006
+ /**
1007
+ * Data storage setting for this call's agent. "everything" stores all data,
1008
+ * "everything_except_pii" excludes PII when possible, "basic_attributes_only"
1009
+ * stores only metadata.
1010
+ */
1011
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
1012
+ /**
1013
+ * The reason for the disconnection of the call. Read detailed description about
1014
+ * reasons listed here at
1015
+ * [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons).
1016
+ */
1017
+ disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_valid_payment' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout';
1018
+ /**
1019
+ * Duration of the call in milliseconds. Available after call ends.
1020
+ */
1021
+ duration_ms?: number;
1022
+ /**
1023
+ * End timestamp (milliseconds since epoch) of the call. Available after call ends.
1024
+ */
1025
+ end_timestamp?: number;
1026
+ /**
1027
+ * URL to the knowledge base retrieved contents of the call. Available after call
1028
+ * ends if the call utilizes knowledge base feature. It consists of the respond id
1029
+ * and the retrieved contents related to that response. It's already rendered in
1030
+ * call history tab of dashboard, and you can also manually download and check
1031
+ * against the transcript to view the knowledge base retrieval results.
1032
+ */
1033
+ knowledge_base_retrieved_contents_url?: string;
1034
+ /**
1035
+ * Latency tracking of the call, available after call ends. Not all fields here
1036
+ * will be available, as it depends on the type of call and feature used.
1037
+ */
1038
+ latency?: WebCallResponse.Latency;
1039
+ /**
1040
+ * LLM token usage of the call, available after call ends. Not populated if using
1041
+ * custom LLM, realtime API, or no LLM call is made.
1042
+ */
1043
+ llm_token_usage?: WebCallResponse.LlmTokenUsage;
1044
+ /**
1045
+ * An arbitrary object for storage purpose only. You can put anything here like
1046
+ * your internal customer id associated with the call. Not used for processing. You
1047
+ * can later get this field from the call object.
1048
+ */
1049
+ metadata?: unknown;
1050
+ /**
1051
+ * Whether this agent opts in for signed URLs for public logs and recordings. When
1052
+ * enabled, the generated URLs will include security signatures that restrict
1053
+ * access and automatically expire after 24 hours.
1054
+ */
1055
+ opt_in_signed_url?: boolean;
1056
+ /**
1057
+ * Public log of the call, containing details about all the requests and responses
1058
+ * received in LLM WebSocket, latency tracking for each turntaking, helpful for
1059
+ * debugging and tracing. Available after call ends.
1060
+ */
1061
+ public_log_url?: string;
1062
+ /**
1063
+ * Recording of the call, with each party's audio stored in a separate channel.
1064
+ * Available after the call ends.
1065
+ */
1066
+ recording_multi_channel_url?: string;
1067
+ /**
1068
+ * Recording of the call. Available after call ends.
1069
+ */
1070
+ recording_url?: string;
1071
+ /**
1072
+ * Add optional dynamic variables in key value pairs of string that injects into
1073
+ * your Response Engine prompt and tool description. Only applicable for Response
1074
+ * Engine.
1075
+ */
1076
+ retell_llm_dynamic_variables?: {
1077
+ [key: string]: unknown;
1078
+ };
1079
+ /**
1080
+ * Recording of the call without PII, with each party's audio stored in a separate
1081
+ * channel. Available after the call ends.
1082
+ */
1083
+ scrubbed_recording_multi_channel_url?: string;
1084
+ /**
1085
+ * Recording of the call without PII. Available after call ends.
1086
+ */
1087
+ scrubbed_recording_url?: string;
1088
+ /**
1089
+ * Transcript of the call weaved with tool call invocation and results, without
1090
+ * PII. It precisely captures when (at what utterance, which word) the tool was
1091
+ * invoked and what was the result. Available after call ends.
1092
+ */
1093
+ scrubbed_transcript_with_tool_calls?: Array<WebCallResponse.Utterance | WebCallResponse.ToolCallInvocationUtterance | WebCallResponse.ToolCallResultUtterance | WebCallResponse.NodeTransitionUtterance | WebCallResponse.DtmfUtterance>;
1094
+ /**
1095
+ * Begin timestamp (milliseconds since epoch) of the call. Available after call
1096
+ * starts.
1097
+ */
1098
+ start_timestamp?: number;
1099
+ /**
1100
+ * Transcription of the call. Available after call ends.
1101
+ */
1102
+ transcript?: string;
1103
+ /**
1104
+ * Transcript of the call in the format of a list of utterance, with timestamp.
1105
+ * Available after call ends.
1106
+ */
1107
+ transcript_object?: Array<WebCallResponse.TranscriptObject>;
1108
+ /**
1109
+ * Transcript of the call weaved with tool call invocation and results. It
1110
+ * precisely captures when (at what utterance, which word) the tool was invoked and
1111
+ * what was the result. Available after call ends.
1112
+ */
1113
+ transcript_with_tool_calls?: Array<WebCallResponse.Utterance | WebCallResponse.ToolCallInvocationUtterance | WebCallResponse.ToolCallResultUtterance | WebCallResponse.NodeTransitionUtterance | WebCallResponse.DtmfUtterance>;
1114
+ /**
1115
+ * The destination number or identifier where the call was transferred to. Only
1116
+ * populated when the disconnection reason was `call_transfer`. Can be a phone
1117
+ * number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a
1118
+ * ";transport=..." portion (if transport is known) where the transport type can be
1119
+ * "tls", "tcp" or "udp".
1120
+ */
1121
+ transfer_destination?: string | null;
1122
+ /**
1123
+ * Transfer end timestamp (milliseconds since epoch) of the call. Available after
1124
+ * transfer call ends.
1125
+ */
1126
+ transfer_end_timestamp?: number;
1127
+ }
1128
+ export declare namespace WebCallResponse {
1129
+ /**
1130
+ * Post call analysis that includes information such as sentiment, status, summary,
1131
+ * and custom defined data to extract. Available after call ends. Subscribe to
1132
+ * `call_analyzed` webhook event type to receive it once ready.
1133
+ */
1134
+ interface CallAnalysis {
1135
+ /**
1136
+ * Whether the agent seems to have a successful call with the user, where the agent
1137
+ * finishes the task, and the call was complete without being cutoff.
1138
+ */
1139
+ call_successful?: boolean;
1140
+ /**
1141
+ * A high level summary of the call.
1142
+ */
1143
+ call_summary?: string;
1144
+ /**
1145
+ * Custom analysis data that was extracted based on the schema defined in agent
1146
+ * post call analysis data. Can be empty if nothing is specified.
1147
+ */
1148
+ custom_analysis_data?: unknown;
1149
+ /**
1150
+ * Whether the call is entered voicemail.
1151
+ */
1152
+ in_voicemail?: boolean;
1153
+ /**
1154
+ * Sentiment of the user in the call.
1155
+ */
1156
+ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
1157
+ }
1158
+ /**
1159
+ * Cost of the call, including all the products and their costs and discount.
1160
+ */
1161
+ interface CallCost {
1162
+ /**
1163
+ * Combined cost of all individual costs in cents
1164
+ */
1165
+ combined_cost: number;
1166
+ /**
1167
+ * List of products with their unit prices and costs in cents
1168
+ */
1169
+ product_costs: Array<CallCost.ProductCost>;
1170
+ /**
1171
+ * Total duration of the call in seconds
1172
+ */
1173
+ total_duration_seconds: number;
1174
+ /**
1175
+ * Total unit duration price of all products in cents per second
1176
+ */
1177
+ total_duration_unit_price: number;
1178
+ }
1179
+ namespace CallCost {
1180
+ interface ProductCost {
1181
+ /**
1182
+ * Cost for the product in cents for the duration of the call.
1183
+ */
1184
+ cost: number;
1185
+ /**
1186
+ * Product name that has a cost associated with it.
1187
+ */
1188
+ product: string;
1189
+ /**
1190
+ * True if this cost item is for a transfer segment.
1191
+ */
1192
+ is_transfer_leg_cost?: boolean;
1193
+ /**
1194
+ * Unit price of the product in cents per second.
1195
+ */
1196
+ unit_price?: number;
1197
+ }
1198
+ }
1199
+ /**
1200
+ * Latency tracking of the call, available after call ends. Not all fields here
1201
+ * will be available, as it depends on the type of call and feature used.
1202
+ */
1203
+ interface Latency {
1204
+ /**
1205
+ * Transcription latency (diff between the duration of the chunks streamed and the
1206
+ * durations of the transcribed part) tracking of the call.
1207
+ */
1208
+ asr?: Latency.Asr;
1209
+ /**
1210
+ * End to end latency (from user stops talking to agent start talking) tracking of
1211
+ * the call. This latency does not account for the network trip time from Retell
1212
+ * server to user frontend. The latency is tracked every time turn change between
1213
+ * user and agent.
1214
+ */
1215
+ e2e?: Latency.E2E;
1216
+ /**
1217
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
1218
+ * relevant context received) tracking of the call. Only populated when using
1219
+ * knowledge base feature for the agent of the call.
1220
+ */
1221
+ knowledge_base?: Latency.KnowledgeBase;
1222
+ /**
1223
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
1224
+ * of the call. When using custom LLM. this latency includes LLM websocket
1225
+ * roundtrip time between user server and Retell server.
1226
+ */
1227
+ llm?: Latency.Llm;
1228
+ /**
1229
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
1230
+ * of the call. Only populated for calls using custom LLM.
1231
+ */
1232
+ llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt;
1233
+ /**
1234
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
1235
+ * received) tracking of the call. Only populated for calls that uses S2S model
1236
+ * like Realtime API.
1237
+ */
1238
+ s2s?: Latency.S2s;
1239
+ /**
1240
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
1241
+ * tracking of the call.
1242
+ */
1243
+ tts?: Latency.Tts;
1244
+ }
1245
+ namespace Latency {
1246
+ /**
1247
+ * Transcription latency (diff between the duration of the chunks streamed and the
1248
+ * durations of the transcribed part) tracking of the call.
1249
+ */
1250
+ interface Asr {
1251
+ /**
1252
+ * Maximum latency in the call, measured in milliseconds.
1253
+ */
1254
+ max?: number;
1255
+ /**
1256
+ * Minimum latency in the call, measured in milliseconds.
1257
+ */
1258
+ min?: number;
1259
+ /**
1260
+ * Number of data points (number of times latency is tracked).
1261
+ */
1262
+ num?: number;
1263
+ /**
1264
+ * 50 percentile of latency, measured in milliseconds.
1265
+ */
1266
+ p50?: number;
1267
+ /**
1268
+ * 90 percentile of latency, measured in milliseconds.
1269
+ */
1270
+ p90?: number;
1271
+ /**
1272
+ * 95 percentile of latency, measured in milliseconds.
1273
+ */
1274
+ p95?: number;
1275
+ /**
1276
+ * 99 percentile of latency, measured in milliseconds.
1277
+ */
1278
+ p99?: number;
1279
+ /**
1280
+ * All the latency data points in the call, measured in milliseconds.
1281
+ */
1282
+ values?: Array<number>;
1283
+ }
1284
+ /**
1285
+ * End to end latency (from user stops talking to agent start talking) tracking of
1286
+ * the call. This latency does not account for the network trip time from Retell
1287
+ * server to user frontend. The latency is tracked every time turn change between
1288
+ * user and agent.
1289
+ */
1290
+ interface E2E {
1291
+ /**
1292
+ * Maximum latency in the call, measured in milliseconds.
1293
+ */
1294
+ max?: number;
1295
+ /**
1296
+ * Minimum latency in the call, measured in milliseconds.
1297
+ */
1298
+ min?: number;
1299
+ /**
1300
+ * Number of data points (number of times latency is tracked).
1301
+ */
1302
+ num?: number;
1303
+ /**
1304
+ * 50 percentile of latency, measured in milliseconds.
1305
+ */
1306
+ p50?: number;
1307
+ /**
1308
+ * 90 percentile of latency, measured in milliseconds.
1309
+ */
1310
+ p90?: number;
1311
+ /**
1312
+ * 95 percentile of latency, measured in milliseconds.
1313
+ */
1314
+ p95?: number;
1315
+ /**
1316
+ * 99 percentile of latency, measured in milliseconds.
1317
+ */
1318
+ p99?: number;
1319
+ /**
1320
+ * All the latency data points in the call, measured in milliseconds.
1321
+ */
1322
+ values?: Array<number>;
1323
+ }
1324
+ /**
1325
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
1326
+ * relevant context received) tracking of the call. Only populated when using
1327
+ * knowledge base feature for the agent of the call.
1328
+ */
1329
+ interface KnowledgeBase {
1330
+ /**
1331
+ * Maximum latency in the call, measured in milliseconds.
1332
+ */
1333
+ max?: number;
1334
+ /**
1335
+ * Minimum latency in the call, measured in milliseconds.
1336
+ */
1337
+ min?: number;
1338
+ /**
1339
+ * Number of data points (number of times latency is tracked).
1340
+ */
1341
+ num?: number;
1342
+ /**
1343
+ * 50 percentile of latency, measured in milliseconds.
1344
+ */
1345
+ p50?: number;
1346
+ /**
1347
+ * 90 percentile of latency, measured in milliseconds.
1348
+ */
1349
+ p90?: number;
1350
+ /**
1351
+ * 95 percentile of latency, measured in milliseconds.
1352
+ */
1353
+ p95?: number;
1354
+ /**
1355
+ * 99 percentile of latency, measured in milliseconds.
1356
+ */
1357
+ p99?: number;
1358
+ /**
1359
+ * All the latency data points in the call, measured in milliseconds.
1360
+ */
1361
+ values?: Array<number>;
1362
+ }
1363
+ /**
1364
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
1365
+ * of the call. When using custom LLM. this latency includes LLM websocket
1366
+ * roundtrip time between user server and Retell server.
1367
+ */
1368
+ interface Llm {
1369
+ /**
1370
+ * Maximum latency in the call, measured in milliseconds.
1371
+ */
1372
+ max?: number;
1373
+ /**
1374
+ * Minimum latency in the call, measured in milliseconds.
1375
+ */
1376
+ min?: number;
1377
+ /**
1378
+ * Number of data points (number of times latency is tracked).
1379
+ */
1380
+ num?: number;
1381
+ /**
1382
+ * 50 percentile of latency, measured in milliseconds.
1383
+ */
1384
+ p50?: number;
1385
+ /**
1386
+ * 90 percentile of latency, measured in milliseconds.
1387
+ */
1388
+ p90?: number;
1389
+ /**
1390
+ * 95 percentile of latency, measured in milliseconds.
1391
+ */
1392
+ p95?: number;
1393
+ /**
1394
+ * 99 percentile of latency, measured in milliseconds.
1395
+ */
1396
+ p99?: number;
1397
+ /**
1398
+ * All the latency data points in the call, measured in milliseconds.
1399
+ */
1400
+ values?: Array<number>;
1401
+ }
1402
+ /**
1403
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
1404
+ * of the call. Only populated for calls using custom LLM.
1405
+ */
1406
+ interface LlmWebsocketNetworkRtt {
1407
+ /**
1408
+ * Maximum latency in the call, measured in milliseconds.
1409
+ */
1410
+ max?: number;
1411
+ /**
1412
+ * Minimum latency in the call, measured in milliseconds.
1413
+ */
1414
+ min?: number;
1415
+ /**
1416
+ * Number of data points (number of times latency is tracked).
1417
+ */
1418
+ num?: number;
1419
+ /**
1420
+ * 50 percentile of latency, measured in milliseconds.
1421
+ */
1422
+ p50?: number;
1423
+ /**
1424
+ * 90 percentile of latency, measured in milliseconds.
1425
+ */
1426
+ p90?: number;
1427
+ /**
1428
+ * 95 percentile of latency, measured in milliseconds.
1429
+ */
1430
+ p95?: number;
1431
+ /**
1432
+ * 99 percentile of latency, measured in milliseconds.
1433
+ */
1434
+ p99?: number;
1435
+ /**
1436
+ * All the latency data points in the call, measured in milliseconds.
1437
+ */
1438
+ values?: Array<number>;
1439
+ }
1440
+ /**
1441
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
1442
+ * received) tracking of the call. Only populated for calls that uses S2S model
1443
+ * like Realtime API.
1444
+ */
1445
+ interface S2s {
1446
+ /**
1447
+ * Maximum latency in the call, measured in milliseconds.
1448
+ */
1449
+ max?: number;
1450
+ /**
1451
+ * Minimum latency in the call, measured in milliseconds.
1452
+ */
1453
+ min?: number;
1454
+ /**
1455
+ * Number of data points (number of times latency is tracked).
1456
+ */
1457
+ num?: number;
1458
+ /**
1459
+ * 50 percentile of latency, measured in milliseconds.
1460
+ */
1461
+ p50?: number;
1462
+ /**
1463
+ * 90 percentile of latency, measured in milliseconds.
1464
+ */
1465
+ p90?: number;
1466
+ /**
1467
+ * 95 percentile of latency, measured in milliseconds.
1468
+ */
1469
+ p95?: number;
1470
+ /**
1471
+ * 99 percentile of latency, measured in milliseconds.
1472
+ */
1473
+ p99?: number;
1474
+ /**
1475
+ * All the latency data points in the call, measured in milliseconds.
1476
+ */
1477
+ values?: Array<number>;
1478
+ }
1479
+ /**
1480
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
1481
+ * tracking of the call.
1482
+ */
1483
+ interface Tts {
1484
+ /**
1485
+ * Maximum latency in the call, measured in milliseconds.
1486
+ */
1487
+ max?: number;
1488
+ /**
1489
+ * Minimum latency in the call, measured in milliseconds.
1490
+ */
1491
+ min?: number;
1492
+ /**
1493
+ * Number of data points (number of times latency is tracked).
1494
+ */
1495
+ num?: number;
1496
+ /**
1497
+ * 50 percentile of latency, measured in milliseconds.
1498
+ */
1499
+ p50?: number;
1500
+ /**
1501
+ * 90 percentile of latency, measured in milliseconds.
1502
+ */
1503
+ p90?: number;
1504
+ /**
1505
+ * 95 percentile of latency, measured in milliseconds.
1506
+ */
1507
+ p95?: number;
1508
+ /**
1509
+ * 99 percentile of latency, measured in milliseconds.
1510
+ */
1511
+ p99?: number;
1512
+ /**
1513
+ * All the latency data points in the call, measured in milliseconds.
1514
+ */
1515
+ values?: Array<number>;
1516
+ }
1517
+ }
1518
+ /**
1519
+ * LLM token usage of the call, available after call ends. Not populated if using
1520
+ * custom LLM, realtime API, or no LLM call is made.
1521
+ */
1522
+ interface LlmTokenUsage {
1523
+ /**
1524
+ * Average token count of the call.
1525
+ */
1526
+ average: number;
1527
+ /**
1528
+ * Number of requests made to the LLM.
1529
+ */
1530
+ num_requests: number;
1531
+ /**
1532
+ * All the token count values in the call.
1533
+ */
1534
+ values: Array<number>;
1535
+ }
1536
+ interface Utterance {
1537
+ /**
1538
+ * Transcript of the utterances.
1539
+ */
1540
+ content: string;
1541
+ /**
1542
+ * Documents whether this utterance is spoken by agent or user.
1543
+ */
1544
+ role: 'agent' | 'user' | 'transfer_target';
1545
+ /**
1546
+ * Array of words in the utterance with the word timestamp. Useful for
1547
+ * understanding what word was spoken at what time. Note that the word timestamp is
1548
+ * not guaranteed to be accurate, it's more like an approximation.
1549
+ */
1550
+ words: Array<Utterance.Word>;
1551
+ }
1552
+ namespace Utterance {
1553
+ interface Word {
1554
+ /**
1555
+ * End time of the word in the call in second. This is relative audio time, not
1556
+ * wall time.
1557
+ */
1558
+ end?: number;
1559
+ /**
1560
+ * Start time of the word in the call in second. This is relative audio time, not
1561
+ * wall time.
1562
+ */
1563
+ start?: number;
1564
+ /**
1565
+ * Word transcript (with punctuation if applicable).
1566
+ */
1567
+ word?: string;
1568
+ }
1569
+ }
1570
+ interface ToolCallInvocationUtterance {
1571
+ /**
1572
+ * Arguments for this tool call, it's a stringified JSON object.
1573
+ */
1574
+ arguments: string;
1575
+ /**
1576
+ * Name of the function in this tool call.
1577
+ */
1578
+ name: string;
1579
+ /**
1580
+ * This is a tool call invocation.
1581
+ */
1582
+ role: 'tool_call_invocation';
1583
+ /**
1584
+ * Tool call id, globally unique.
1585
+ */
1586
+ tool_call_id: string;
1587
+ /**
1588
+ * Optional thought signature from Google Gemini thinking models. This is used
1589
+ * internally to maintain reasoning chain in multi-turn function calling.
1590
+ */
1591
+ thought_signature?: string;
1592
+ }
1593
+ interface ToolCallResultUtterance {
1594
+ /**
1595
+ * Result of the tool call, can be a string, a stringified json, etc.
1596
+ */
1597
+ content: string;
1598
+ /**
1599
+ * This is the result of a tool call.
1600
+ */
1601
+ role: 'tool_call_result';
1602
+ /**
1603
+ * Tool call id, globally unique.
1604
+ */
1605
+ tool_call_id: string;
1606
+ }
1607
+ interface NodeTransitionUtterance {
1608
+ /**
1609
+ * Former node id
1610
+ */
1611
+ former_node_id: string;
1612
+ /**
1613
+ * Former node name
1614
+ */
1615
+ former_node_name: string;
1616
+ /**
1617
+ * New node id
1618
+ */
1619
+ new_node_id: string;
1620
+ /**
1621
+ * New node name
1622
+ */
1623
+ new_node_name: string;
1624
+ /**
1625
+ * This is result of a node transition
1626
+ */
1627
+ role: 'node_transition';
1628
+ }
1629
+ interface DtmfUtterance {
1630
+ /**
1631
+ * The digit pressed by the user. Will be a single digit string like "1", "2", "3",
1632
+ * "\*", "#" etc.
1633
+ */
1634
+ digit: string;
1635
+ /**
1636
+ * Digit pressed by the user from their phone keypad.
1637
+ */
1638
+ role: 'dtmf';
1639
+ }
1640
+ interface TranscriptObject {
1641
+ /**
1642
+ * Transcript of the utterances.
1643
+ */
1644
+ content: string;
1645
+ /**
1646
+ * Documents whether this utterance is spoken by agent or user.
1647
+ */
1648
+ role: 'agent' | 'user' | 'transfer_target';
1649
+ /**
1650
+ * Array of words in the utterance with the word timestamp. Useful for
1651
+ * understanding what word was spoken at what time. Note that the word timestamp is
1652
+ * not guaranteed to be accurate, it's more like an approximation.
1653
+ */
1654
+ words: Array<TranscriptObject.Word>;
1655
+ }
1656
+ namespace TranscriptObject {
1657
+ interface Word {
1658
+ /**
1659
+ * End time of the word in the call in second. This is relative audio time, not
1660
+ * wall time.
1661
+ */
1662
+ end?: number;
1663
+ /**
1664
+ * Start time of the word in the call in second. This is relative audio time, not
1665
+ * wall time.
1666
+ */
1667
+ start?: number;
1668
+ /**
1669
+ * Word transcript (with punctuation if applicable).
1670
+ */
1671
+ word?: string;
1672
+ }
1673
+ }
1674
+ interface Utterance {
1675
+ /**
1676
+ * Transcript of the utterances.
1677
+ */
1678
+ content: string;
1679
+ /**
1680
+ * Documents whether this utterance is spoken by agent or user.
1681
+ */
1682
+ role: 'agent' | 'user' | 'transfer_target';
1683
+ /**
1684
+ * Array of words in the utterance with the word timestamp. Useful for
1685
+ * understanding what word was spoken at what time. Note that the word timestamp is
1686
+ * not guaranteed to be accurate, it's more like an approximation.
1687
+ */
1688
+ words: Array<Utterance.Word>;
1689
+ }
1690
+ namespace Utterance {
1691
+ interface Word {
1692
+ /**
1693
+ * End time of the word in the call in second. This is relative audio time, not
1694
+ * wall time.
1695
+ */
1696
+ end?: number;
1697
+ /**
1698
+ * Start time of the word in the call in second. This is relative audio time, not
1699
+ * wall time.
1700
+ */
1701
+ start?: number;
1702
+ /**
1703
+ * Word transcript (with punctuation if applicable).
1704
+ */
1705
+ word?: string;
1706
+ }
1707
+ }
1708
+ interface ToolCallInvocationUtterance {
1709
+ /**
1710
+ * Arguments for this tool call, it's a stringified JSON object.
1711
+ */
1712
+ arguments: string;
1713
+ /**
1714
+ * Name of the function in this tool call.
1715
+ */
1716
+ name: string;
1717
+ /**
1718
+ * This is a tool call invocation.
1719
+ */
1720
+ role: 'tool_call_invocation';
1721
+ /**
1722
+ * Tool call id, globally unique.
1723
+ */
1724
+ tool_call_id: string;
1725
+ /**
1726
+ * Optional thought signature from Google Gemini thinking models. This is used
1727
+ * internally to maintain reasoning chain in multi-turn function calling.
1728
+ */
1729
+ thought_signature?: string;
1730
+ }
1731
+ interface ToolCallResultUtterance {
1732
+ /**
1733
+ * Result of the tool call, can be a string, a stringified json, etc.
1734
+ */
1735
+ content: string;
1736
+ /**
1737
+ * This is the result of a tool call.
1738
+ */
1739
+ role: 'tool_call_result';
1740
+ /**
1741
+ * Tool call id, globally unique.
1742
+ */
1743
+ tool_call_id: string;
1744
+ }
1745
+ interface NodeTransitionUtterance {
1746
+ /**
1747
+ * Former node id
1748
+ */
1749
+ former_node_id: string;
1750
+ /**
1751
+ * Former node name
1752
+ */
1753
+ former_node_name: string;
1754
+ /**
1755
+ * New node id
1756
+ */
1757
+ new_node_id: string;
1758
+ /**
1759
+ * New node name
1760
+ */
1761
+ new_node_name: string;
1762
+ /**
1763
+ * This is result of a node transition
1764
+ */
1765
+ role: 'node_transition';
1766
+ }
1767
+ interface DtmfUtterance {
1768
+ /**
1769
+ * The digit pressed by the user. Will be a single digit string like "1", "2", "3",
1770
+ * "\*", "#" etc.
1771
+ */
1772
+ digit: string;
1773
+ /**
1774
+ * Digit pressed by the user from their phone keypad.
1775
+ */
1776
+ role: 'dtmf';
1777
+ }
1778
+ }
1779
+ export type CallListResponse = Array<CallResponse>;
1780
+ export interface CallUpdateParams {
1781
+ /**
1782
+ * Custom attributes for the call
1783
+ */
1784
+ custom_attributes?: {
1785
+ [key: string]: string | number | boolean;
1786
+ };
1787
+ /**
1788
+ * Data storage setting for this call. Overrides the agent's default setting.
1789
+ * "everything" stores all data, "everything_except_pii" excludes PII when
1790
+ * possible, "basic_attributes_only" stores only metadata. Cannot be downgraded
1791
+ * from more restrictive to less restrictive settings.
1792
+ */
1793
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only';
1794
+ /**
1795
+ * An arbitrary object for storage purpose only. You can put anything here like
1796
+ * your internal customer id associated with the call. Not used for processing. You
1797
+ * can later get this field from the call object. Size limited to 50kB max.
1798
+ */
1799
+ metadata?: unknown;
1800
+ /**
1801
+ * Override dynamic varaibles represented as key-value pairs of strings. Setting
1802
+ * this will override or add the dynamic variables set in the agent during the
1803
+ * call. Only need to set the delta where you want to override, no need to set the
1804
+ * entire dynamic variables object. Setting this to null will remove any existing
1805
+ * override.
1806
+ */
1807
+ override_dynamic_variables?: {
1808
+ [key: string]: string;
1809
+ } | null;
1810
+ }
1811
+ export interface CallListParams {
1812
+ /**
1813
+ * Filter criteria for the calls to retrieve.
1814
+ */
1815
+ filter_criteria?: CallListParams.FilterCriteria;
1816
+ /**
1817
+ * Limit the number of calls returned. Default 50, Max 1000. To retrieve more than
1818
+ * 1000, use pagination_key to continue fetching the next page.
1819
+ */
1820
+ limit?: number;
1821
+ /**
1822
+ * The pagination key to continue fetching the next page of calls. Pagination key
1823
+ * is represented by a call id here, and it's exclusive (not included in the
1824
+ * fetched calls). The last call id from the list calls is usually used as
1825
+ * pagination key here. If not set, will start from the beginning.
1826
+ */
1827
+ pagination_key?: string;
1828
+ /**
1829
+ * The calls will be sorted by `start_timestamp`, whether to return the calls in
1830
+ * ascending or descending order.
1831
+ */
1832
+ sort_order?: 'ascending' | 'descending';
1833
+ }
1834
+ export declare namespace CallListParams {
1835
+ /**
1836
+ * Filter criteria for the calls to retrieve.
1837
+ */
1838
+ interface FilterCriteria {
1839
+ /**
1840
+ * Only retrieve calls that are made with specific agent(s).
1841
+ */
1842
+ agent_id?: Array<string>;
1843
+ /**
1844
+ * Only retrieve calls with specific batch call id(s).
1845
+ */
1846
+ batch_call_id?: Array<string>;
1847
+ /**
1848
+ * Only retrieve calls with specific call status(es).
1849
+ */
1850
+ call_status?: Array<'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error'>;
1851
+ /**
1852
+ * Only retrieve calls with specific call successful(s).
1853
+ */
1854
+ call_successful?: Array<boolean>;
1855
+ /**
1856
+ * Only retrieve calls with specific call type(s).
1857
+ */
1858
+ call_type?: Array<'web_call' | 'phone_call'>;
1859
+ /**
1860
+ * Only retrieve calls with specific direction(s).
1861
+ */
1862
+ direction?: Array<'inbound' | 'outbound'>;
1863
+ /**
1864
+ * Only retrieve calls with specific disconnection reason(s).
1865
+ */
1866
+ disconnection_reason?: Array<'user_hangup' | 'agent_hangup' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_valid_payment' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout'>;
1867
+ /**
1868
+ * Only retrieve calls with specific range of duration(s).
1869
+ */
1870
+ duration_ms?: FilterCriteria.DurationMs;
1871
+ /**
1872
+ * Filter by dynamic variables using dot notation (e.g., `dynamic_variables.name`).
1873
+ * Values are matched exactly as strings.
1874
+ */
1875
+ dynamic_variables?: {
1876
+ [key: string]: Array<string>;
1877
+ };
1878
+ e2e_latency_p50?: FilterCriteria.E2ELatencyP50;
1879
+ /**
1880
+ * Only retrieve calls with specific range of end timestamp(s).
1881
+ */
1882
+ end_timestamp?: FilterCriteria.EndTimestamp;
1883
+ /**
1884
+ * Only retrieve calls with specific from number(s).
1885
+ */
1886
+ from_number?: Array<string>;
1887
+ /**
1888
+ * Only retrieve calls that are in voicemail or not in voicemail.
1889
+ */
1890
+ in_voicemail?: Array<boolean>;
1891
+ /**
1892
+ * Filter by metadata fields using dot notation (e.g., `metadata.customer_id`).
1893
+ * Values are matched exactly as strings.
1894
+ */
1895
+ metadata?: {
1896
+ [key: string]: Array<string>;
1897
+ };
1898
+ /**
1899
+ * Only retrieve calls with specific range of start timestamp(s).
1900
+ */
1901
+ start_timestamp?: FilterCriteria.StartTimestamp;
1902
+ /**
1903
+ * Only retrieve calls with specific to number(s).
1904
+ */
1905
+ to_number?: Array<string>;
1906
+ /**
1907
+ * Only retrieve calls with specific user sentiment(s).
1908
+ */
1909
+ user_sentiment?: Array<'Negative' | 'Positive' | 'Neutral' | 'Unknown'>;
1910
+ /**
1911
+ * The version of the agent to use for the call.
1912
+ */
1913
+ version?: Array<number>;
1914
+ }
1915
+ namespace FilterCriteria {
1916
+ /**
1917
+ * Only retrieve calls with specific range of duration(s).
1918
+ */
1919
+ interface DurationMs {
1920
+ lower_threshold?: number;
1921
+ upper_threshold?: number;
1922
+ }
1923
+ interface E2ELatencyP50 {
1924
+ lower_threshold?: number;
1925
+ upper_threshold?: number;
1926
+ }
1927
+ /**
1928
+ * Only retrieve calls with specific range of end timestamp(s).
1929
+ */
1930
+ interface EndTimestamp {
1931
+ lower_threshold?: number;
1932
+ upper_threshold?: number;
1933
+ }
1934
+ /**
1935
+ * Only retrieve calls with specific range of start timestamp(s).
1936
+ */
1937
+ interface StartTimestamp {
1938
+ lower_threshold?: number;
1939
+ upper_threshold?: number;
1940
+ }
1941
+ }
1942
+ }
1943
+ export interface CallCreatePhoneCallParams {
1944
+ /**
1945
+ * The number you own in E.164 format. Must be a number purchased from Retell or
1946
+ * imported to Retell.
1947
+ */
1948
+ from_number: string;
1949
+ /**
1950
+ * The number you want to call, in E.164 format. If using a number purchased from
1951
+ * Retell, only US numbers are supported as destination.
1952
+ */
1953
+ to_number: string;
1954
+ /**
1955
+ * For this particular call, override agent configuration with these settings. This
1956
+ * allows you to customize agent behavior for individual calls without modifying
1957
+ * the base agent.
1958
+ */
1959
+ agent_override?: CallCreatePhoneCallParams.AgentOverride;
1960
+ /**
1961
+ * Add optional custom SIP headers to the call.
1962
+ */
1963
+ custom_sip_headers?: {
1964
+ [key: string]: string;
1965
+ };
1966
+ /**
1967
+ * If true, the e.164 validation will be ignored for the from_number. This can be
1968
+ * useful when you want to dial to internal pseudo numbers. This only applies when
1969
+ * you are using custom telephony and does not apply when you are using Retell
1970
+ * Telephony. If omitted, the default value is false.
1971
+ */
1972
+ ignore_e164_validation?: boolean;
1973
+ /**
1974
+ * An arbitrary object for storage purpose only. You can put anything here like
1975
+ * your internal customer id associated with the call. Not used for processing. You
1976
+ * can later get this field from the call object.
1977
+ */
1978
+ metadata?: unknown;
1979
+ /**
1980
+ * For this particular call, override the agent used with this agent id. This does
1981
+ * not bind the agent to this number, this is for one time override.
1982
+ */
1983
+ override_agent_id?: string;
1984
+ /**
1985
+ * For this particular call, override the agent version used with this version.
1986
+ * This does not bind the agent version to this number, this is for one time
1987
+ * override.
1988
+ */
1989
+ override_agent_version?: number;
1990
+ /**
1991
+ * Add optional dynamic variables in key value pairs of string that injects into
1992
+ * your Response Engine prompt and tool description. Only applicable for Response
1993
+ * Engine.
1994
+ */
1995
+ retell_llm_dynamic_variables?: {
1996
+ [key: string]: unknown;
1997
+ };
1998
+ }
1999
+ export declare namespace CallCreatePhoneCallParams {
2000
+ /**
2001
+ * For this particular call, override agent configuration with these settings. This
2002
+ * allows you to customize agent behavior for individual calls without modifying
2003
+ * the base agent.
2004
+ */
2005
+ interface AgentOverride {
2006
+ /**
2007
+ * Override agent configuration settings. Any properties specified here will
2008
+ * override the base agent configuration for this call.
2009
+ */
2010
+ agent?: AgentOverride.Agent;
2011
+ /**
2012
+ * Override conversation flow configuration settings. Only applicable when using
2013
+ * conversation flow as the response engine. Supported attributes - model_choice,
2014
+ * model_temperature, tool_call_strict_mode, knowledge_base_ids, kb_config,
2015
+ * start_speaker, begin_after_user_silence_ms.
2016
+ */
2017
+ conversation_flow?: AgentOverride.ConversationFlow;
2018
+ /**
2019
+ * Override Retell LLM configuration settings. Only applicable when using Retell
2020
+ * LLM as the response engine. Supported attributes - model, s2s_model,
2021
+ * model_temperature, model_high_priority, tool_call_strict_mode,
2022
+ * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms,
2023
+ * begin_message.
2024
+ */
2025
+ retell_llm?: AgentOverride.RetellLlm;
2026
+ }
2027
+ namespace AgentOverride {
2028
+ /**
2029
+ * Override agent configuration settings. Any properties specified here will
2030
+ * override the base agent configuration for this call.
2031
+ */
2032
+ interface Agent {
2033
+ /**
2034
+ * The name of the agent. Only used for your own reference.
2035
+ */
2036
+ agent_name?: string | null;
2037
+ /**
2038
+ * If set to true, DTMF input will be accepted and processed. If false, any DTMF
2039
+ * input will be ignored. Default to true.
2040
+ */
2041
+ allow_user_dtmf?: boolean;
2042
+ /**
2043
+ * If set, will add ambient environment sound to the call to make experience more
2044
+ * realistic. Currently supports the following options:
2045
+ *
2046
+ * - `coffee-shop`: Coffee shop ambience with people chatting in background.
2047
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/coffee-shop.wav)
2048
+ * - `convention-hall`: Convention hall ambience, with some echo and people
2049
+ * chatting in background.
2050
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/convention-hall.wav)
2051
+ * - `summer-outdoor`: Summer outdoor ambience with cicada chirping.
2052
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/summer-outdoor.wav)
2053
+ * - `mountain-outdoor`: Mountain outdoor ambience with birds singing.
2054
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/mountain-outdoor.wav)
2055
+ * - `static-noise`: Constant static noise.
2056
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/static-noise.wav)
2057
+ * - `call-center`: Call center work noise.
2058
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/call-center.wav)
2059
+ * Set to `null` to remove ambient sound from this agent.
2060
+ */
2061
+ ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'static-noise' | 'call-center' | null;
2062
+ /**
2063
+ * If set, will control the volume of the ambient sound. Value ranging from [0,2].
2064
+ * Lower value means quieter ambient sound, while higher value means louder ambient
2065
+ * sound. If unset, default value 1 will apply.
2066
+ */
2067
+ ambient_sound_volume?: number;
2068
+ /**
2069
+ * Prompt to determine whether the post call or chat analysis should mark the
2070
+ * interaction as successful. Set to null to use the default prompt.
2071
+ */
2072
+ analysis_successful_prompt?: string | null;
2073
+ /**
2074
+ * Prompt to guide how the post call or chat analysis summary should be generated.
2075
+ * When unset, the default system prompt is used. Set to null to use the default
2076
+ * prompt.
2077
+ */
2078
+ analysis_summary_prompt?: string | null;
2079
+ /**
2080
+ * Only applicable when enable_backchannel is true. Controls how often the agent
2081
+ * would backchannel when a backchannel is possible. Value ranging from [0,1].
2082
+ * Lower value means less frequent backchannel, while higher value means more
2083
+ * frequent backchannel. If unset, default value 0.8 will apply.
2084
+ */
2085
+ backchannel_frequency?: number;
2086
+ /**
2087
+ * Only applicable when enable_backchannel is true. A list of words that the agent
2088
+ * would use as backchannel. If not set, default backchannel words will apply.
2089
+ * Check out
2090
+ * [backchannel default words](/agent/interaction-configuration#backchannel) for
2091
+ * more details. Note that certain voices do not work too well with certain words,
2092
+ * so it's recommended to experiment before adding any words.
2093
+ */
2094
+ backchannel_words?: Array<string> | null;
2095
+ /**
2096
+ * If set, will delay the first message by the specified amount of milliseconds, so
2097
+ * that it gives user more time to prepare to take the call. Valid range is [0,
2098
+ * 5000]. If not set or set to 0, agent will speak immediately. Only applicable
2099
+ * when agent speaks first.
2100
+ */
2101
+ begin_message_delay_ms?: number;
2102
+ /**
2103
+ * Provide a customized list of keywords to bias the transcriber model, so that
2104
+ * these words are more likely to get transcribed. Commonly used for names, brands,
2105
+ * street, etc.
2106
+ */
2107
+ boosted_keywords?: Array<string> | null;
2108
+ /**
2109
+ * Custom STT configuration. Only used when stt_mode is set to custom.
2110
+ */
2111
+ custom_stt_config?: Agent.CustomSttConfig;
2112
+ /**
2113
+ * Granular setting to manage how Retell stores sensitive data (transcripts,
2114
+ * recordings, logs, etc.). This replaces the deprecated
2115
+ * `opt_out_sensitive_data_storage` field.
2116
+ *
2117
+ * - `everything`: Store all data including transcripts, recordings, and logs.
2118
+ * - `everything_except_pii`: Store data without PII when PII is detected.
2119
+ * - `basic_attributes_only`: Store only basic attributes; no
2120
+ * transcripts/recordings/logs. If not set, default value of "everything" will
2121
+ * apply.
2122
+ */
2123
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only';
2124
+ /**
2125
+ * If set, determines what denoising mode to use. Use "no-denoise" to bypass all
2126
+ * audio denoising. Default to noise-cancellation.
2127
+ */
2128
+ denoising_mode?: 'no-denoise' | 'noise-cancellation' | 'noise-and-background-speech-cancellation';
2129
+ /**
2130
+ * Controls whether the agent would backchannel (agent interjects the speaker with
2131
+ * phrases like "yeah", "uh-huh" to signify interest and engagement). Backchannel
2132
+ * when enabled tends to show up more in longer user utterances. If not set, agent
2133
+ * will not backchannel.
2134
+ */
2135
+ enable_backchannel?: boolean;
2136
+ /**
2137
+ * If set to true, will enable dynamic voice speed adjustment based on the user's
2138
+ * speech rate and conversation context. If unset, default value false will apply.
2139
+ */
2140
+ enable_dynamic_voice_speed?: boolean;
2141
+ /**
2142
+ * If set to true, will detect whether the call enters a voicemail. Note that this
2143
+ * feature is only available for phone calls.
2144
+ */
2145
+ enable_voicemail_detection?: boolean;
2146
+ /**
2147
+ * If users stay silent for a period after agent speech, end the call. The minimum
2148
+ * value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min).
2149
+ */
2150
+ end_call_after_silence_ms?: number;
2151
+ /**
2152
+ * When TTS provider for the selected voice is experiencing outages, we would use
2153
+ * fallback voices listed here for the agent. Voice id and the fallback voice ids
2154
+ * must be from different TTS providers. The system would go through the list in
2155
+ * order, if the first one in the list is also having outage, it would use the next
2156
+ * one. Set to null to remove voice fallback for the agent.
2157
+ */
2158
+ fallback_voice_ids?: Array<string> | null;
2159
+ /**
2160
+ * Configuration for guardrail checks to detect and prevent prohibited topics in
2161
+ * agent output and user input.
2162
+ */
2163
+ guardrail_config?: Agent.GuardrailConfig;
2164
+ /**
2165
+ * Controls how sensitive the agent is to user interruptions. Value ranging from
2166
+ * [0,1]. Lower value means it will take longer / more words for user to interrupt
2167
+ * agent, while higher value means it's easier for user to interrupt agent. If
2168
+ * unset, default value 1 will apply. When this is set to 0, agent would never be
2169
+ * interrupted.
2170
+ */
2171
+ interruption_sensitivity?: number;
2172
+ /**
2173
+ * Whether the agent is public. When set to true, the agent is available for public
2174
+ * agent preview link.
2175
+ */
2176
+ is_public?: boolean | null;
2177
+ /**
2178
+ * If this option is set, the call will try to detect IVR in the first 3 minutes of
2179
+ * the call. Actions defined will be applied when the IVR is detected. Set this to
2180
+ * null to disable IVR detection.
2181
+ */
2182
+ ivr_option?: Agent.IvrOption | null;
2183
+ /**
2184
+ * Specifies what language (and dialect) the speech recognition will operate in.
2185
+ * For instance, selecting `en-GB` optimizes speech recognition for British
2186
+ * English. If unset, will use default value `en-US`. Select `multi` for
2187
+ * multilingual support.
2188
+ */
2189
+ language?: 'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA' | 'multi';
2190
+ /**
2191
+ * Maximum allowed length for the call, will force end the call if reached. The
2192
+ * minimum value allowed is 60,000 ms (1 min), and maximum value allowed is
2193
+ * 7,200,000 (2 hours). By default, this is set to 3,600,000 (1 hour).
2194
+ */
2195
+ max_call_duration_ms?: number;
2196
+ /**
2197
+ * If set to true, will normalize the some part of text (number, currency, date,
2198
+ * etc) to spoken to its spoken form for more consistent speech synthesis
2199
+ * (sometimes the voice synthesize system itself might read these wrong with the
2200
+ * raw text). For example, it will convert "Call my number 2137112342 on Jul 5th,
2201
+ * 2024 for the $24.12 payment" to "Call my number two one three seven one one two
2202
+ * three four two on july fifth, twenty twenty four for the twenty four dollars
2203
+ * twelve cents payment" before starting audio generation.
2204
+ */
2205
+ normalize_for_speech?: boolean;
2206
+ /**
2207
+ * Whether this agent opts in for signed URLs for public logs and recordings. When
2208
+ * enabled, the generated URLs will include security signatures that restrict
2209
+ * access and automatically expire after 24 hours.
2210
+ */
2211
+ opt_in_signed_url?: boolean;
2212
+ /**
2213
+ * Configuration for PII scrubbing from transcripts and recordings.
2214
+ */
2215
+ pii_config?: Agent.PiiConfig;
2216
+ /**
2217
+ * Post call analysis data to extract from the call. This data will augment the
2218
+ * pre-defined variables extracted in the call analysis. This will be available
2219
+ * after the call ends.
2220
+ */
2221
+ post_call_analysis_data?: Array<Agent.StringAnalysisData | Agent.EnumAnalysisData | Agent.BooleanAnalysisData | Agent.NumberAnalysisData> | null;
2222
+ /**
2223
+ * The model to use for post call analysis. Default to gpt-4.1-mini.
2224
+ */
2225
+ post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5-mini' | 'gpt-5-nano' | 'claude-4.5-sonnet' | 'claude-4.5-haiku' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-3.0-flash' | null;
2226
+ /**
2227
+ * A list of words / phrases and their pronunciation to be used to guide the audio
2228
+ * synthesize for consistent pronunciation. Currently only supported for English &
2229
+ * 11labs voices. Set to null to remove pronunciation dictionary from this agent.
2230
+ */
2231
+ pronunciation_dictionary?: Array<Agent.PronunciationDictionary> | null;
2232
+ /**
2233
+ * If set, controls how many times agent would remind user when user is
2234
+ * unresponsive. Must be a non negative integer. If unset, default value of 1 will
2235
+ * apply (remind once). Set to 0 to disable agent from reminding.
2236
+ */
2237
+ reminder_max_count?: number;
2238
+ /**
2239
+ * If set (in milliseconds), will trigger a reminder to the agent to speak if the
2240
+ * user has been silent for the specified duration after some agent speech. Must be
2241
+ * a positive number. If unset, default value of 10000 ms (10 s) will apply.
2242
+ */
2243
+ reminder_trigger_ms?: number;
2244
+ /**
2245
+ * The Response Engine to attach to the agent. It is used to generate responses for
2246
+ * the agent. You need to create a Response Engine first before attaching it to an
2247
+ * agent.
2248
+ */
2249
+ response_engine?: Agent.ResponseEngineRetellLm | Agent.ResponseEngineCustomLm | Agent.ResponseEngineConversationFlow;
2250
+ /**
2251
+ * Controls how responsive is the agent. Value ranging from [0,1]. Lower value
2252
+ * means less responsive agent (wait more, respond slower), while higher value
2253
+ * means faster exchanges (respond when it can). If unset, default value 1 will
2254
+ * apply.
2255
+ */
2256
+ responsiveness?: number;
2257
+ /**
2258
+ * If set, the phone ringing will last for the specified amount of milliseconds.
2259
+ * This applies for both outbound call ringtime, and call transfer ringtime.
2260
+ * Default to 30000 (30 s). Valid range is [5000, 90000].
2261
+ */
2262
+ ring_duration_ms?: number;
2263
+ /**
2264
+ * The expiration time for the signed url in milliseconds. Only applicable when
2265
+ * opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will
2266
+ * apply.
2267
+ */
2268
+ signed_url_expiration_ms?: number | null;
2269
+ /**
2270
+ * If set, determines whether speech to text should focus on latency or accuracy.
2271
+ * Default to fast mode. When set to custom, custom_stt_config must be provided.
2272
+ */
2273
+ stt_mode?: 'fast' | 'accurate' | 'custom';
2274
+ user_dtmf_options?: Agent.UserDtmfOptions | null;
2275
+ /**
2276
+ * Optional description of the agent version. Used for your own reference and
2277
+ * documentation.
2278
+ */
2279
+ version_description?: string | null;
2280
+ /**
2281
+ * If set, determines the vocabulary set to use for transcription. This setting
2282
+ * only applies for English agents, for non English agent, this setting is a no-op.
2283
+ * Default to general.
2284
+ */
2285
+ vocab_specialization?: 'general' | 'medical';
2286
+ /**
2287
+ * Controls the emotional tone of the agent's voice. Currently supported for
2288
+ * Cartesia and Minimax TTS providers. If unset, no emotion will be used.
2289
+ */
2290
+ voice_emotion?: 'calm' | 'sympathetic' | 'happy' | 'sad' | 'angry' | 'fearful' | 'surprised' | null;
2291
+ /**
2292
+ * Unique voice id used for the agent. Find list of available voices and their
2293
+ * preview in Dashboard.
2294
+ */
2295
+ voice_id?: string;
2296
+ /**
2297
+ * Select the voice model used for the selected voice. Each provider has a set of
2298
+ * available voice models. Set to null to remove voice model selection, and default
2299
+ * ones will apply. Check out dashboard for more details of each voice model.
2300
+ */
2301
+ voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'sonic-2' | 'sonic-3' | 'sonic-3-latest' | 'sonic-turbo' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | null;
2302
+ /**
2303
+ * Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
2304
+ * speech, while higher value means faster speech rate. If unset, default value 1
2305
+ * will apply.
2306
+ */
2307
+ voice_speed?: number;
2308
+ /**
2309
+ * Controls how stable the voice is. Value ranging from [0,2]. Lower value means
2310
+ * more stable, and higher value means more variant speech generation. Currently
2311
+ * this setting only applies to `11labs` voices. If unset, default value 1 will
2312
+ * apply.
2313
+ */
2314
+ voice_temperature?: number;
2315
+ /**
2316
+ * Configures when to stop running voicemail detection, as it becomes unlikely to
2317
+ * hit voicemail after a couple minutes, and keep running it will only have
2318
+ * negative impact. The minimum value allowed is 5,000 ms (5 s), and maximum value
2319
+ * allowed is 180,000 (3 minutes). By default, this is set to 30,000 (30 s).
2320
+ */
2321
+ voicemail_detection_timeout_ms?: number;
2322
+ /**
2323
+ * The message to be played when the call enters a voicemail. Note that this
2324
+ * feature is only available for phone calls. If you want to hangup after hitting
2325
+ * voicemail, set this to empty string.
2326
+ */
2327
+ voicemail_message?: string;
2328
+ /**
2329
+ * If this option is set, the call will try to detect voicemail in the first 3
2330
+ * minutes of the call. Actions defined (hangup, or leave a message) will be
2331
+ * applied when the voicemail is detected. Set this to null to disable voicemail
2332
+ * detection.
2333
+ */
2334
+ voicemail_option?: Agent.VoicemailOption | null;
2335
+ /**
2336
+ * If set, will control the volume of the agent. Value ranging from [0,2]. Lower
2337
+ * value means quieter agent speech, while higher value means louder agent speech.
2338
+ * If unset, default value 1 will apply.
2339
+ */
2340
+ volume?: number;
2341
+ /**
2342
+ * Which webhook events this agent should receive. If not set, defaults to
2343
+ * call_started, call_ended, call_analyzed.
2344
+ */
2345
+ webhook_events?: Array<'call_started' | 'call_ended' | 'call_analyzed' | 'transcript_updated' | 'transfer_started' | 'transfer_bridged' | 'transfer_cancelled' | 'transfer_ended'> | null;
2346
+ /**
2347
+ * The timeout for the webhook in milliseconds. If not set, default value of 10000
2348
+ * will apply.
2349
+ */
2350
+ webhook_timeout_ms?: number;
2351
+ /**
2352
+ * The webhook for agent to listen to call events. See what events it would get at
2353
+ * [webhook doc](/features/webhook). If set, will binds webhook events for this
2354
+ * agent to the specified url, and will ignore the account level webhook for this
2355
+ * agent. Set to `null` to remove webhook url from this agent.
2356
+ */
2357
+ webhook_url?: string | null;
2358
+ }
2359
+ namespace Agent {
2360
+ /**
2361
+ * Custom STT configuration. Only used when stt_mode is set to custom.
2362
+ */
2363
+ interface CustomSttConfig {
2364
+ /**
2365
+ * Endpointing timeout in milliseconds. Minimum is 100 for azure, 10 for deepgram.
2366
+ */
2367
+ endpointing_ms: number;
2368
+ /**
2369
+ * The STT provider to use.
2370
+ */
2371
+ provider: 'azure' | 'deepgram';
2372
+ }
2373
+ /**
2374
+ * Configuration for guardrail checks to detect and prevent prohibited topics in
2375
+ * agent output and user input.
2376
+ */
2377
+ interface GuardrailConfig {
2378
+ /**
2379
+ * Selected prohibited user topic categories to check. When user messages contain
2380
+ * these topics, the agent will respond with a placeholder message instead of
2381
+ * processing the request.
2382
+ */
2383
+ input_topics?: Array<'platform_integrity_jailbreaking'> | null;
2384
+ /**
2385
+ * Selected prohibited agent topic categories to check. When agent messages contain
2386
+ * these topics, they will be replaced with a placeholder message.
2387
+ */
2388
+ output_topics?: Array<'harassment' | 'self_harm' | 'sexual_exploitation' | 'violence' | 'defense_and_national_security' | 'illicit_and_harmful_activity' | 'gambling' | 'regulated_professional_advice' | 'child_safety_and_exploitation'> | null;
2389
+ }
2390
+ /**
2391
+ * If this option is set, the call will try to detect IVR in the first 3 minutes of
2392
+ * the call. Actions defined will be applied when the IVR is detected. Set this to
2393
+ * null to disable IVR detection.
2394
+ */
2395
+ interface IvrOption {
2396
+ action: IvrOption.Action;
2397
+ }
2398
+ namespace IvrOption {
2399
+ interface Action {
2400
+ type: 'hangup';
2401
+ }
2402
+ }
2403
+ /**
2404
+ * Configuration for PII scrubbing from transcripts and recordings.
2405
+ */
2406
+ interface PiiConfig {
2407
+ /**
2408
+ * List of PII categories to scrub from transcripts and recordings.
2409
+ */
2410
+ categories: Array<'person_name' | 'address' | 'email' | 'phone_number' | 'ssn' | 'passport' | 'driver_license' | 'credit_card' | 'bank_account' | 'password' | 'pin' | 'medical_id' | 'date_of_birth' | 'customer_account_number'>;
2411
+ /**
2412
+ * The processing mode for PII scrubbing. Currently only post-call is supported.
2413
+ */
2414
+ mode: 'post_call';
2415
+ }
2416
+ interface StringAnalysisData {
2417
+ /**
2418
+ * Description of the variable.
2419
+ */
2420
+ description: string;
2421
+ /**
2422
+ * Name of the variable.
2423
+ */
2424
+ name: string;
2425
+ /**
2426
+ * Type of the variable to extract.
2427
+ */
2428
+ type: 'string';
2429
+ /**
2430
+ * Examples of the variable value to teach model the style and syntax.
2431
+ */
2432
+ examples?: Array<string>;
2433
+ }
2434
+ interface EnumAnalysisData {
2435
+ /**
2436
+ * The possible values of the variable, must be non empty array.
2437
+ */
2438
+ choices: Array<string>;
2439
+ /**
2440
+ * Description of the variable.
2441
+ */
2442
+ description: string;
2443
+ /**
2444
+ * Name of the variable.
2445
+ */
2446
+ name: string;
2447
+ /**
2448
+ * Type of the variable to extract.
2449
+ */
2450
+ type: 'enum';
2451
+ }
2452
+ interface BooleanAnalysisData {
2453
+ /**
2454
+ * Description of the variable.
2455
+ */
2456
+ description: string;
2457
+ /**
2458
+ * Name of the variable.
2459
+ */
2460
+ name: string;
2461
+ /**
2462
+ * Type of the variable to extract.
2463
+ */
2464
+ type: 'boolean';
2465
+ }
2466
+ interface NumberAnalysisData {
2467
+ /**
2468
+ * Description of the variable.
2469
+ */
2470
+ description: string;
2471
+ /**
2472
+ * Name of the variable.
2473
+ */
2474
+ name: string;
2475
+ /**
2476
+ * Type of the variable to extract.
2477
+ */
2478
+ type: 'number';
2479
+ }
2480
+ interface PronunciationDictionary {
2481
+ /**
2482
+ * The phonetic alphabet to be used for pronunciation.
2483
+ */
2484
+ alphabet: 'ipa' | 'cmu';
2485
+ /**
2486
+ * Pronunciation of the word in the format of a IPA / CMU pronunciation.
2487
+ */
2488
+ phoneme: string;
2489
+ /**
2490
+ * The string of word / phrase to be annotated with pronunciation.
2491
+ */
2492
+ word: string;
2493
+ }
2494
+ interface ResponseEngineRetellLm {
2495
+ /**
2496
+ * id of the Retell LLM Response Engine.
2497
+ */
2498
+ llm_id: string;
2499
+ /**
2500
+ * type of the Response Engine.
2501
+ */
2502
+ type: 'retell-llm';
2503
+ /**
2504
+ * Version of the Retell LLM Response Engine.
2505
+ */
2506
+ version?: number | null;
2507
+ }
2508
+ interface ResponseEngineCustomLm {
2509
+ /**
2510
+ * LLM websocket url of the custom LLM.
2511
+ */
2512
+ llm_websocket_url: string;
2513
+ /**
2514
+ * type of the Response Engine.
2515
+ */
2516
+ type: 'custom-llm';
2517
+ }
2518
+ interface ResponseEngineConversationFlow {
2519
+ /**
2520
+ * ID of the Conversation Flow Response Engine.
2521
+ */
2522
+ conversation_flow_id: string;
2523
+ /**
2524
+ * type of the Response Engine.
2525
+ */
2526
+ type: 'conversation-flow';
2527
+ /**
2528
+ * Version of the Conversation Flow Response Engine.
2529
+ */
2530
+ version?: number | null;
2531
+ }
2532
+ interface UserDtmfOptions {
2533
+ /**
2534
+ * The maximum number of digits allowed in the user's DTMF (Dual-Tone
2535
+ * Multi-Frequency) input per turn. Once this limit is reached, the input is
2536
+ * considered complete and a response will be generated immediately.
2537
+ */
2538
+ digit_limit?: number | null;
2539
+ /**
2540
+ * A single key that signals the end of DTMF input. Acceptable values include any
2541
+ * digit (0-9), the pound/hash symbol (#), or the asterisk (\*).
2542
+ */
2543
+ termination_key?: string | null;
2544
+ /**
2545
+ * The time (in milliseconds) to wait for user DTMF input before timing out. The
2546
+ * timer resets with each digit received.
2547
+ */
2548
+ timeout_ms?: number;
2549
+ }
2550
+ /**
2551
+ * If this option is set, the call will try to detect voicemail in the first 3
2552
+ * minutes of the call. Actions defined (hangup, or leave a message) will be
2553
+ * applied when the voicemail is detected. Set this to null to disable voicemail
2554
+ * detection.
2555
+ */
2556
+ interface VoicemailOption {
2557
+ action: VoicemailOption.VoicemailActionPrompt | VoicemailOption.VoicemailActionStaticText | VoicemailOption.VoicemailActionHangup | VoicemailOption.VoicemailActionBridgeTransfer;
2558
+ }
2559
+ namespace VoicemailOption {
2560
+ interface VoicemailActionPrompt {
2561
+ /**
2562
+ * The prompt used to generate the text to be spoken when the call is detected to
2563
+ * be in voicemail.
2564
+ */
2565
+ text: string;
2566
+ type: 'prompt';
2567
+ }
2568
+ interface VoicemailActionStaticText {
2569
+ /**
2570
+ * The text to be spoken when the call is detected to be in voicemail.
2571
+ */
2572
+ text: string;
2573
+ type: 'static_text';
2574
+ }
2575
+ interface VoicemailActionHangup {
2576
+ type: 'hangup';
2577
+ }
2578
+ interface VoicemailActionBridgeTransfer {
2579
+ type: 'bridge_transfer';
2580
+ }
2581
+ }
2582
+ }
2583
+ /**
2584
+ * Override conversation flow configuration settings. Only applicable when using
2585
+ * conversation flow as the response engine. Supported attributes - model_choice,
2586
+ * model_temperature, tool_call_strict_mode, knowledge_base_ids, kb_config,
2587
+ * start_speaker, begin_after_user_silence_ms.
2588
+ */
2589
+ interface ConversationFlow {
2590
+ /**
2591
+ * If set, the AI will begin the conversation after waiting for the user for the
2592
+ * duration (in milliseconds) specified by this attribute. This only applies if the
2593
+ * agent is configured to wait for the user to speak first. If not set, the agent
2594
+ * will wait indefinitely for the user to speak.
2595
+ */
2596
+ begin_after_user_silence_ms?: number | null;
2597
+ /**
2598
+ * Knowledge base configuration for RAG retrieval.
2599
+ */
2600
+ kb_config?: ConversationFlow.KBConfig;
2601
+ /**
2602
+ * Knowledge base IDs for RAG (Retrieval-Augmented Generation).
2603
+ */
2604
+ knowledge_base_ids?: Array<string> | null;
2605
+ /**
2606
+ * The model choice for the conversation flow.
2607
+ */
2608
+ model_choice?: ConversationFlow.ModelChoice;
2609
+ /**
2610
+ * Controls the randomness of the model's responses. Lower values make responses
2611
+ * more deterministic.
2612
+ */
2613
+ model_temperature?: number | null;
2614
+ /**
2615
+ * Who starts the conversation - user or agent.
2616
+ */
2617
+ start_speaker?: 'user' | 'agent';
2618
+ /**
2619
+ * Whether to use strict mode for tool calls. Only applicable when using certain
2620
+ * supported models.
2621
+ */
2622
+ tool_call_strict_mode?: boolean | null;
2623
+ }
2624
+ namespace ConversationFlow {
2625
+ /**
2626
+ * Knowledge base configuration for RAG retrieval.
2627
+ */
2628
+ interface KBConfig {
2629
+ /**
2630
+ * Similarity threshold for filtering search results
2631
+ */
2632
+ filter_score?: number;
2633
+ /**
2634
+ * Max number of knowledge base chunks to retrieve
2635
+ */
2636
+ top_k?: number;
2637
+ }
2638
+ /**
2639
+ * The model choice for the conversation flow.
2640
+ */
2641
+ interface ModelChoice {
2642
+ /**
2643
+ * The LLM model to use
2644
+ */
2645
+ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5-mini' | 'gpt-5-nano' | 'claude-4.5-sonnet' | 'claude-4.5-haiku' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-3.0-flash';
2646
+ /**
2647
+ * Type of model choice
2648
+ */
2649
+ type: 'cascading';
2650
+ /**
2651
+ * Whether to use high priority pool with more dedicated resource, default false
2652
+ */
2653
+ high_priority?: boolean;
2654
+ }
2655
+ }
2656
+ /**
2657
+ * Override Retell LLM configuration settings. Only applicable when using Retell
2658
+ * LLM as the response engine. Supported attributes - model, s2s_model,
2659
+ * model_temperature, model_high_priority, tool_call_strict_mode,
2660
+ * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms,
2661
+ * begin_message.
2662
+ */
2663
+ interface RetellLlm {
2664
+ /**
2665
+ * If set, the AI will begin the conversation after waiting for the user for the
2666
+ * duration (in milliseconds) specified by this attribute. This only applies if the
2667
+ * agent is configured to wait for the user to speak first. If not set, the agent
2668
+ * will wait indefinitely for the user to speak.
2669
+ */
2670
+ begin_after_user_silence_ms?: number | null;
2671
+ /**
2672
+ * First utterance said by the agent in the call. If not set, LLM will dynamically
2673
+ * generate a message. If set to "", agent will wait for user to speak first.
2674
+ */
2675
+ begin_message?: string | null;
2676
+ /**
2677
+ * Knowledge base configuration for RAG retrieval.
2678
+ */
2679
+ kb_config?: RetellLlm.KBConfig | null;
2680
+ /**
2681
+ * A list of knowledge base ids to use for this resource.
2682
+ */
2683
+ knowledge_base_ids?: Array<string> | null;
2684
+ /**
2685
+ * Select the underlying text LLM. If not set, would default to gpt-4.1.
2686
+ */
2687
+ model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5-mini' | 'gpt-5-nano' | 'claude-4.5-sonnet' | 'claude-4.5-haiku' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-3.0-flash' | null;
2688
+ /**
2689
+ * If set to true, will use high priority pool with more dedicated resource to
2690
+ * ensure lower and more consistent latency, default to false. This feature usually
2691
+ * comes with a higher cost.
2692
+ */
2693
+ model_high_priority?: boolean | null;
2694
+ /**
2695
+ * If set, will control the randomness of the response. Value ranging from [0,1].
2696
+ * Lower value means more deterministic, while higher value means more random. If
2697
+ * unset, default value 0 will apply. Note that for tool calling, a lower value is
2698
+ * recommended.
2699
+ */
2700
+ model_temperature?: number;
2701
+ /**
2702
+ * Select the underlying speech to speech model. Can only set this or model, not
2703
+ * both.
2704
+ */
2705
+ s2s_model?: 'gpt-4o-realtime' | 'gpt-4o-mini-realtime' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
2706
+ /**
2707
+ * The speaker who starts the conversation. Required. Must be either 'user' or
2708
+ * 'agent'.
2709
+ */
2710
+ start_speaker?: 'user' | 'agent';
2711
+ /**
2712
+ * Whether to use strict mode for tool calls. Only applicable when using certain
2713
+ * supported models.
2714
+ */
2715
+ tool_call_strict_mode?: boolean | null;
2716
+ }
2717
+ namespace RetellLlm {
2718
+ /**
2719
+ * Knowledge base configuration for RAG retrieval.
2720
+ */
2721
+ interface KBConfig {
2722
+ /**
2723
+ * Similarity threshold for filtering search results
2724
+ */
2725
+ filter_score?: number;
2726
+ /**
2727
+ * Max number of knowledge base chunks to retrieve
2728
+ */
2729
+ top_k?: number;
2730
+ }
2731
+ }
2732
+ }
2733
+ }
2734
+ export interface CallCreateWebCallParams {
2735
+ /**
2736
+ * Unique id of agent used for the call. Your agent would contain the LLM Websocket
2737
+ * url used for this call.
2738
+ */
2739
+ agent_id: string;
2740
+ /**
2741
+ * For this particular call, override agent configuration with these settings. This
2742
+ * allows you to customize agent behavior for individual calls without modifying
2743
+ * the base agent.
2744
+ */
2745
+ agent_override?: CallCreateWebCallParams.AgentOverride;
2746
+ /**
2747
+ * The version of the agent to use for the call.
2748
+ */
2749
+ agent_version?: number;
2750
+ /**
2751
+ * An arbitrary object for storage purpose only. You can put anything here like
2752
+ * your internal customer id associated with the call. Not used for processing. You
2753
+ * can later get this field from the call object.
2754
+ */
2755
+ metadata?: unknown;
2756
+ /**
2757
+ * Add optional dynamic variables in key value pairs of string that injects into
2758
+ * your Response Engine prompt and tool description. Only applicable for Response
2759
+ * Engine.
2760
+ */
2761
+ retell_llm_dynamic_variables?: {
2762
+ [key: string]: unknown;
2763
+ };
2764
+ }
2765
+ export declare namespace CallCreateWebCallParams {
2766
+ /**
2767
+ * For this particular call, override agent configuration with these settings. This
2768
+ * allows you to customize agent behavior for individual calls without modifying
2769
+ * the base agent.
2770
+ */
2771
+ interface AgentOverride {
2772
+ /**
2773
+ * Override agent configuration settings. Any properties specified here will
2774
+ * override the base agent configuration for this call.
2775
+ */
2776
+ agent?: AgentOverride.Agent;
2777
+ /**
2778
+ * Override conversation flow configuration settings. Only applicable when using
2779
+ * conversation flow as the response engine. Supported attributes - model_choice,
2780
+ * model_temperature, tool_call_strict_mode, knowledge_base_ids, kb_config,
2781
+ * start_speaker, begin_after_user_silence_ms.
2782
+ */
2783
+ conversation_flow?: AgentOverride.ConversationFlow;
2784
+ /**
2785
+ * Override Retell LLM configuration settings. Only applicable when using Retell
2786
+ * LLM as the response engine. Supported attributes - model, s2s_model,
2787
+ * model_temperature, model_high_priority, tool_call_strict_mode,
2788
+ * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms,
2789
+ * begin_message.
2790
+ */
2791
+ retell_llm?: AgentOverride.RetellLlm;
2792
+ }
2793
+ namespace AgentOverride {
2794
+ /**
2795
+ * Override agent configuration settings. Any properties specified here will
2796
+ * override the base agent configuration for this call.
2797
+ */
2798
+ interface Agent {
2799
+ /**
2800
+ * The name of the agent. Only used for your own reference.
2801
+ */
2802
+ agent_name?: string | null;
2803
+ /**
2804
+ * If set to true, DTMF input will be accepted and processed. If false, any DTMF
2805
+ * input will be ignored. Default to true.
2806
+ */
2807
+ allow_user_dtmf?: boolean;
2808
+ /**
2809
+ * If set, will add ambient environment sound to the call to make experience more
2810
+ * realistic. Currently supports the following options:
2811
+ *
2812
+ * - `coffee-shop`: Coffee shop ambience with people chatting in background.
2813
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/coffee-shop.wav)
2814
+ * - `convention-hall`: Convention hall ambience, with some echo and people
2815
+ * chatting in background.
2816
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/convention-hall.wav)
2817
+ * - `summer-outdoor`: Summer outdoor ambience with cicada chirping.
2818
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/summer-outdoor.wav)
2819
+ * - `mountain-outdoor`: Mountain outdoor ambience with birds singing.
2820
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/mountain-outdoor.wav)
2821
+ * - `static-noise`: Constant static noise.
2822
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/static-noise.wav)
2823
+ * - `call-center`: Call center work noise.
2824
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/call-center.wav)
2825
+ * Set to `null` to remove ambient sound from this agent.
2826
+ */
2827
+ ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'static-noise' | 'call-center' | null;
2828
+ /**
2829
+ * If set, will control the volume of the ambient sound. Value ranging from [0,2].
2830
+ * Lower value means quieter ambient sound, while higher value means louder ambient
2831
+ * sound. If unset, default value 1 will apply.
2832
+ */
2833
+ ambient_sound_volume?: number;
2834
+ /**
2835
+ * Prompt to determine whether the post call or chat analysis should mark the
2836
+ * interaction as successful. Set to null to use the default prompt.
2837
+ */
2838
+ analysis_successful_prompt?: string | null;
2839
+ /**
2840
+ * Prompt to guide how the post call or chat analysis summary should be generated.
2841
+ * When unset, the default system prompt is used. Set to null to use the default
2842
+ * prompt.
2843
+ */
2844
+ analysis_summary_prompt?: string | null;
2845
+ /**
2846
+ * Only applicable when enable_backchannel is true. Controls how often the agent
2847
+ * would backchannel when a backchannel is possible. Value ranging from [0,1].
2848
+ * Lower value means less frequent backchannel, while higher value means more
2849
+ * frequent backchannel. If unset, default value 0.8 will apply.
2850
+ */
2851
+ backchannel_frequency?: number;
2852
+ /**
2853
+ * Only applicable when enable_backchannel is true. A list of words that the agent
2854
+ * would use as backchannel. If not set, default backchannel words will apply.
2855
+ * Check out
2856
+ * [backchannel default words](/agent/interaction-configuration#backchannel) for
2857
+ * more details. Note that certain voices do not work too well with certain words,
2858
+ * so it's recommended to experiment before adding any words.
2859
+ */
2860
+ backchannel_words?: Array<string> | null;
2861
+ /**
2862
+ * If set, will delay the first message by the specified amount of milliseconds, so
2863
+ * that it gives user more time to prepare to take the call. Valid range is [0,
2864
+ * 5000]. If not set or set to 0, agent will speak immediately. Only applicable
2865
+ * when agent speaks first.
2866
+ */
2867
+ begin_message_delay_ms?: number;
2868
+ /**
2869
+ * Provide a customized list of keywords to bias the transcriber model, so that
2870
+ * these words are more likely to get transcribed. Commonly used for names, brands,
2871
+ * street, etc.
2872
+ */
2873
+ boosted_keywords?: Array<string> | null;
2874
+ /**
2875
+ * Custom STT configuration. Only used when stt_mode is set to custom.
2876
+ */
2877
+ custom_stt_config?: Agent.CustomSttConfig;
2878
+ /**
2879
+ * Granular setting to manage how Retell stores sensitive data (transcripts,
2880
+ * recordings, logs, etc.). This replaces the deprecated
2881
+ * `opt_out_sensitive_data_storage` field.
2882
+ *
2883
+ * - `everything`: Store all data including transcripts, recordings, and logs.
2884
+ * - `everything_except_pii`: Store data without PII when PII is detected.
2885
+ * - `basic_attributes_only`: Store only basic attributes; no
2886
+ * transcripts/recordings/logs. If not set, default value of "everything" will
2887
+ * apply.
2888
+ */
2889
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only';
2890
+ /**
2891
+ * If set, determines what denoising mode to use. Use "no-denoise" to bypass all
2892
+ * audio denoising. Default to noise-cancellation.
2893
+ */
2894
+ denoising_mode?: 'no-denoise' | 'noise-cancellation' | 'noise-and-background-speech-cancellation';
2895
+ /**
2896
+ * Controls whether the agent would backchannel (agent interjects the speaker with
2897
+ * phrases like "yeah", "uh-huh" to signify interest and engagement). Backchannel
2898
+ * when enabled tends to show up more in longer user utterances. If not set, agent
2899
+ * will not backchannel.
2900
+ */
2901
+ enable_backchannel?: boolean;
2902
+ /**
2903
+ * If set to true, will enable dynamic voice speed adjustment based on the user's
2904
+ * speech rate and conversation context. If unset, default value false will apply.
2905
+ */
2906
+ enable_dynamic_voice_speed?: boolean;
2907
+ /**
2908
+ * If set to true, will detect whether the call enters a voicemail. Note that this
2909
+ * feature is only available for phone calls.
2910
+ */
2911
+ enable_voicemail_detection?: boolean;
2912
+ /**
2913
+ * If users stay silent for a period after agent speech, end the call. The minimum
2914
+ * value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min).
2915
+ */
2916
+ end_call_after_silence_ms?: number;
2917
+ /**
2918
+ * When TTS provider for the selected voice is experiencing outages, we would use
2919
+ * fallback voices listed here for the agent. Voice id and the fallback voice ids
2920
+ * must be from different TTS providers. The system would go through the list in
2921
+ * order, if the first one in the list is also having outage, it would use the next
2922
+ * one. Set to null to remove voice fallback for the agent.
2923
+ */
2924
+ fallback_voice_ids?: Array<string> | null;
2925
+ /**
2926
+ * Configuration for guardrail checks to detect and prevent prohibited topics in
2927
+ * agent output and user input.
2928
+ */
2929
+ guardrail_config?: Agent.GuardrailConfig;
2930
+ /**
2931
+ * Controls how sensitive the agent is to user interruptions. Value ranging from
2932
+ * [0,1]. Lower value means it will take longer / more words for user to interrupt
2933
+ * agent, while higher value means it's easier for user to interrupt agent. If
2934
+ * unset, default value 1 will apply. When this is set to 0, agent would never be
2935
+ * interrupted.
2936
+ */
2937
+ interruption_sensitivity?: number;
2938
+ /**
2939
+ * Whether the agent is public. When set to true, the agent is available for public
2940
+ * agent preview link.
2941
+ */
2942
+ is_public?: boolean | null;
2943
+ /**
2944
+ * If this option is set, the call will try to detect IVR in the first 3 minutes of
2945
+ * the call. Actions defined will be applied when the IVR is detected. Set this to
2946
+ * null to disable IVR detection.
2947
+ */
2948
+ ivr_option?: Agent.IvrOption | null;
2949
+ /**
2950
+ * Specifies what language (and dialect) the speech recognition will operate in.
2951
+ * For instance, selecting `en-GB` optimizes speech recognition for British
2952
+ * English. If unset, will use default value `en-US`. Select `multi` for
2953
+ * multilingual support.
2954
+ */
2955
+ language?: 'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA' | 'multi';
2956
+ /**
2957
+ * Maximum allowed length for the call, will force end the call if reached. The
2958
+ * minimum value allowed is 60,000 ms (1 min), and maximum value allowed is
2959
+ * 7,200,000 (2 hours). By default, this is set to 3,600,000 (1 hour).
2960
+ */
2961
+ max_call_duration_ms?: number;
2962
+ /**
2963
+ * If set to true, will normalize the some part of text (number, currency, date,
2964
+ * etc) to spoken to its spoken form for more consistent speech synthesis
2965
+ * (sometimes the voice synthesize system itself might read these wrong with the
2966
+ * raw text). For example, it will convert "Call my number 2137112342 on Jul 5th,
2967
+ * 2024 for the $24.12 payment" to "Call my number two one three seven one one two
2968
+ * three four two on july fifth, twenty twenty four for the twenty four dollars
2969
+ * twelve cents payment" before starting audio generation.
2970
+ */
2971
+ normalize_for_speech?: boolean;
2972
+ /**
2973
+ * Whether this agent opts in for signed URLs for public logs and recordings. When
2974
+ * enabled, the generated URLs will include security signatures that restrict
2975
+ * access and automatically expire after 24 hours.
2976
+ */
2977
+ opt_in_signed_url?: boolean;
2978
+ /**
2979
+ * Configuration for PII scrubbing from transcripts and recordings.
2980
+ */
2981
+ pii_config?: Agent.PiiConfig;
2982
+ /**
2983
+ * Post call analysis data to extract from the call. This data will augment the
2984
+ * pre-defined variables extracted in the call analysis. This will be available
2985
+ * after the call ends.
2986
+ */
2987
+ post_call_analysis_data?: Array<Agent.StringAnalysisData | Agent.EnumAnalysisData | Agent.BooleanAnalysisData | Agent.NumberAnalysisData> | null;
2988
+ /**
2989
+ * The model to use for post call analysis. Default to gpt-4.1-mini.
2990
+ */
2991
+ post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5-mini' | 'gpt-5-nano' | 'claude-4.5-sonnet' | 'claude-4.5-haiku' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-3.0-flash' | null;
2992
+ /**
2993
+ * A list of words / phrases and their pronunciation to be used to guide the audio
2994
+ * synthesize for consistent pronunciation. Currently only supported for English &
2995
+ * 11labs voices. Set to null to remove pronunciation dictionary from this agent.
2996
+ */
2997
+ pronunciation_dictionary?: Array<Agent.PronunciationDictionary> | null;
2998
+ /**
2999
+ * If set, controls how many times agent would remind user when user is
3000
+ * unresponsive. Must be a non negative integer. If unset, default value of 1 will
3001
+ * apply (remind once). Set to 0 to disable agent from reminding.
3002
+ */
3003
+ reminder_max_count?: number;
3004
+ /**
3005
+ * If set (in milliseconds), will trigger a reminder to the agent to speak if the
3006
+ * user has been silent for the specified duration after some agent speech. Must be
3007
+ * a positive number. If unset, default value of 10000 ms (10 s) will apply.
3008
+ */
3009
+ reminder_trigger_ms?: number;
3010
+ /**
3011
+ * The Response Engine to attach to the agent. It is used to generate responses for
3012
+ * the agent. You need to create a Response Engine first before attaching it to an
3013
+ * agent.
3014
+ */
3015
+ response_engine?: Agent.ResponseEngineRetellLm | Agent.ResponseEngineCustomLm | Agent.ResponseEngineConversationFlow;
3016
+ /**
3017
+ * Controls how responsive is the agent. Value ranging from [0,1]. Lower value
3018
+ * means less responsive agent (wait more, respond slower), while higher value
3019
+ * means faster exchanges (respond when it can). If unset, default value 1 will
3020
+ * apply.
3021
+ */
3022
+ responsiveness?: number;
3023
+ /**
3024
+ * If set, the phone ringing will last for the specified amount of milliseconds.
3025
+ * This applies for both outbound call ringtime, and call transfer ringtime.
3026
+ * Default to 30000 (30 s). Valid range is [5000, 90000].
3027
+ */
3028
+ ring_duration_ms?: number;
3029
+ /**
3030
+ * The expiration time for the signed url in milliseconds. Only applicable when
3031
+ * opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will
3032
+ * apply.
3033
+ */
3034
+ signed_url_expiration_ms?: number | null;
3035
+ /**
3036
+ * If set, determines whether speech to text should focus on latency or accuracy.
3037
+ * Default to fast mode. When set to custom, custom_stt_config must be provided.
3038
+ */
3039
+ stt_mode?: 'fast' | 'accurate' | 'custom';
3040
+ user_dtmf_options?: Agent.UserDtmfOptions | null;
3041
+ /**
3042
+ * Optional description of the agent version. Used for your own reference and
3043
+ * documentation.
3044
+ */
3045
+ version_description?: string | null;
3046
+ /**
3047
+ * If set, determines the vocabulary set to use for transcription. This setting
3048
+ * only applies for English agents, for non English agent, this setting is a no-op.
3049
+ * Default to general.
3050
+ */
3051
+ vocab_specialization?: 'general' | 'medical';
3052
+ /**
3053
+ * Controls the emotional tone of the agent's voice. Currently supported for
3054
+ * Cartesia and Minimax TTS providers. If unset, no emotion will be used.
3055
+ */
3056
+ voice_emotion?: 'calm' | 'sympathetic' | 'happy' | 'sad' | 'angry' | 'fearful' | 'surprised' | null;
3057
+ /**
3058
+ * Unique voice id used for the agent. Find list of available voices and their
3059
+ * preview in Dashboard.
3060
+ */
3061
+ voice_id?: string;
3062
+ /**
3063
+ * Select the voice model used for the selected voice. Each provider has a set of
3064
+ * available voice models. Set to null to remove voice model selection, and default
3065
+ * ones will apply. Check out dashboard for more details of each voice model.
3066
+ */
3067
+ voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'sonic-2' | 'sonic-3' | 'sonic-3-latest' | 'sonic-turbo' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | null;
3068
+ /**
3069
+ * Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
3070
+ * speech, while higher value means faster speech rate. If unset, default value 1
3071
+ * will apply.
3072
+ */
3073
+ voice_speed?: number;
3074
+ /**
3075
+ * Controls how stable the voice is. Value ranging from [0,2]. Lower value means
3076
+ * more stable, and higher value means more variant speech generation. Currently
3077
+ * this setting only applies to `11labs` voices. If unset, default value 1 will
3078
+ * apply.
3079
+ */
3080
+ voice_temperature?: number;
3081
+ /**
3082
+ * Configures when to stop running voicemail detection, as it becomes unlikely to
3083
+ * hit voicemail after a couple minutes, and keep running it will only have
3084
+ * negative impact. The minimum value allowed is 5,000 ms (5 s), and maximum value
3085
+ * allowed is 180,000 (3 minutes). By default, this is set to 30,000 (30 s).
3086
+ */
3087
+ voicemail_detection_timeout_ms?: number;
3088
+ /**
3089
+ * The message to be played when the call enters a voicemail. Note that this
3090
+ * feature is only available for phone calls. If you want to hangup after hitting
3091
+ * voicemail, set this to empty string.
3092
+ */
3093
+ voicemail_message?: string;
3094
+ /**
3095
+ * If this option is set, the call will try to detect voicemail in the first 3
3096
+ * minutes of the call. Actions defined (hangup, or leave a message) will be
3097
+ * applied when the voicemail is detected. Set this to null to disable voicemail
3098
+ * detection.
3099
+ */
3100
+ voicemail_option?: Agent.VoicemailOption | null;
3101
+ /**
3102
+ * If set, will control the volume of the agent. Value ranging from [0,2]. Lower
3103
+ * value means quieter agent speech, while higher value means louder agent speech.
3104
+ * If unset, default value 1 will apply.
3105
+ */
3106
+ volume?: number;
3107
+ /**
3108
+ * Which webhook events this agent should receive. If not set, defaults to
3109
+ * call_started, call_ended, call_analyzed.
3110
+ */
3111
+ webhook_events?: Array<'call_started' | 'call_ended' | 'call_analyzed' | 'transcript_updated' | 'transfer_started' | 'transfer_bridged' | 'transfer_cancelled' | 'transfer_ended'> | null;
3112
+ /**
3113
+ * The timeout for the webhook in milliseconds. If not set, default value of 10000
3114
+ * will apply.
3115
+ */
3116
+ webhook_timeout_ms?: number;
3117
+ /**
3118
+ * The webhook for agent to listen to call events. See what events it would get at
3119
+ * [webhook doc](/features/webhook). If set, will binds webhook events for this
3120
+ * agent to the specified url, and will ignore the account level webhook for this
3121
+ * agent. Set to `null` to remove webhook url from this agent.
3122
+ */
3123
+ webhook_url?: string | null;
3124
+ }
3125
+ namespace Agent {
3126
+ /**
3127
+ * Custom STT configuration. Only used when stt_mode is set to custom.
3128
+ */
3129
+ interface CustomSttConfig {
3130
+ /**
3131
+ * Endpointing timeout in milliseconds. Minimum is 100 for azure, 10 for deepgram.
3132
+ */
3133
+ endpointing_ms: number;
3134
+ /**
3135
+ * The STT provider to use.
3136
+ */
3137
+ provider: 'azure' | 'deepgram';
3138
+ }
3139
+ /**
3140
+ * Configuration for guardrail checks to detect and prevent prohibited topics in
3141
+ * agent output and user input.
3142
+ */
3143
+ interface GuardrailConfig {
3144
+ /**
3145
+ * Selected prohibited user topic categories to check. When user messages contain
3146
+ * these topics, the agent will respond with a placeholder message instead of
3147
+ * processing the request.
3148
+ */
3149
+ input_topics?: Array<'platform_integrity_jailbreaking'> | null;
3150
+ /**
3151
+ * Selected prohibited agent topic categories to check. When agent messages contain
3152
+ * these topics, they will be replaced with a placeholder message.
3153
+ */
3154
+ output_topics?: Array<'harassment' | 'self_harm' | 'sexual_exploitation' | 'violence' | 'defense_and_national_security' | 'illicit_and_harmful_activity' | 'gambling' | 'regulated_professional_advice' | 'child_safety_and_exploitation'> | null;
3155
+ }
3156
+ /**
3157
+ * If this option is set, the call will try to detect IVR in the first 3 minutes of
3158
+ * the call. Actions defined will be applied when the IVR is detected. Set this to
3159
+ * null to disable IVR detection.
3160
+ */
3161
+ interface IvrOption {
3162
+ action: IvrOption.Action;
3163
+ }
3164
+ namespace IvrOption {
3165
+ interface Action {
3166
+ type: 'hangup';
3167
+ }
3168
+ }
3169
+ /**
3170
+ * Configuration for PII scrubbing from transcripts and recordings.
3171
+ */
3172
+ interface PiiConfig {
3173
+ /**
3174
+ * List of PII categories to scrub from transcripts and recordings.
3175
+ */
3176
+ categories: Array<'person_name' | 'address' | 'email' | 'phone_number' | 'ssn' | 'passport' | 'driver_license' | 'credit_card' | 'bank_account' | 'password' | 'pin' | 'medical_id' | 'date_of_birth' | 'customer_account_number'>;
3177
+ /**
3178
+ * The processing mode for PII scrubbing. Currently only post-call is supported.
3179
+ */
3180
+ mode: 'post_call';
3181
+ }
3182
+ interface StringAnalysisData {
3183
+ /**
3184
+ * Description of the variable.
3185
+ */
3186
+ description: string;
3187
+ /**
3188
+ * Name of the variable.
3189
+ */
3190
+ name: string;
3191
+ /**
3192
+ * Type of the variable to extract.
3193
+ */
3194
+ type: 'string';
3195
+ /**
3196
+ * Examples of the variable value to teach model the style and syntax.
3197
+ */
3198
+ examples?: Array<string>;
3199
+ }
3200
+ interface EnumAnalysisData {
3201
+ /**
3202
+ * The possible values of the variable, must be non empty array.
3203
+ */
3204
+ choices: Array<string>;
3205
+ /**
3206
+ * Description of the variable.
3207
+ */
3208
+ description: string;
3209
+ /**
3210
+ * Name of the variable.
3211
+ */
3212
+ name: string;
3213
+ /**
3214
+ * Type of the variable to extract.
3215
+ */
3216
+ type: 'enum';
3217
+ }
3218
+ interface BooleanAnalysisData {
3219
+ /**
3220
+ * Description of the variable.
3221
+ */
3222
+ description: string;
3223
+ /**
3224
+ * Name of the variable.
3225
+ */
3226
+ name: string;
3227
+ /**
3228
+ * Type of the variable to extract.
3229
+ */
3230
+ type: 'boolean';
3231
+ }
3232
+ interface NumberAnalysisData {
3233
+ /**
3234
+ * Description of the variable.
3235
+ */
3236
+ description: string;
3237
+ /**
3238
+ * Name of the variable.
3239
+ */
3240
+ name: string;
3241
+ /**
3242
+ * Type of the variable to extract.
3243
+ */
3244
+ type: 'number';
3245
+ }
3246
+ interface PronunciationDictionary {
3247
+ /**
3248
+ * The phonetic alphabet to be used for pronunciation.
3249
+ */
3250
+ alphabet: 'ipa' | 'cmu';
3251
+ /**
3252
+ * Pronunciation of the word in the format of a IPA / CMU pronunciation.
3253
+ */
3254
+ phoneme: string;
3255
+ /**
3256
+ * The string of word / phrase to be annotated with pronunciation.
3257
+ */
3258
+ word: string;
3259
+ }
3260
+ interface ResponseEngineRetellLm {
3261
+ /**
3262
+ * id of the Retell LLM Response Engine.
3263
+ */
3264
+ llm_id: string;
3265
+ /**
3266
+ * type of the Response Engine.
3267
+ */
3268
+ type: 'retell-llm';
3269
+ /**
3270
+ * Version of the Retell LLM Response Engine.
3271
+ */
3272
+ version?: number | null;
3273
+ }
3274
+ interface ResponseEngineCustomLm {
3275
+ /**
3276
+ * LLM websocket url of the custom LLM.
3277
+ */
3278
+ llm_websocket_url: string;
3279
+ /**
3280
+ * type of the Response Engine.
3281
+ */
3282
+ type: 'custom-llm';
3283
+ }
3284
+ interface ResponseEngineConversationFlow {
3285
+ /**
3286
+ * ID of the Conversation Flow Response Engine.
3287
+ */
3288
+ conversation_flow_id: string;
3289
+ /**
3290
+ * type of the Response Engine.
3291
+ */
3292
+ type: 'conversation-flow';
3293
+ /**
3294
+ * Version of the Conversation Flow Response Engine.
3295
+ */
3296
+ version?: number | null;
3297
+ }
3298
+ interface UserDtmfOptions {
3299
+ /**
3300
+ * The maximum number of digits allowed in the user's DTMF (Dual-Tone
3301
+ * Multi-Frequency) input per turn. Once this limit is reached, the input is
3302
+ * considered complete and a response will be generated immediately.
3303
+ */
3304
+ digit_limit?: number | null;
3305
+ /**
3306
+ * A single key that signals the end of DTMF input. Acceptable values include any
3307
+ * digit (0-9), the pound/hash symbol (#), or the asterisk (\*).
3308
+ */
3309
+ termination_key?: string | null;
3310
+ /**
3311
+ * The time (in milliseconds) to wait for user DTMF input before timing out. The
3312
+ * timer resets with each digit received.
3313
+ */
3314
+ timeout_ms?: number;
3315
+ }
3316
+ /**
3317
+ * If this option is set, the call will try to detect voicemail in the first 3
3318
+ * minutes of the call. Actions defined (hangup, or leave a message) will be
3319
+ * applied when the voicemail is detected. Set this to null to disable voicemail
3320
+ * detection.
3321
+ */
3322
+ interface VoicemailOption {
3323
+ action: VoicemailOption.VoicemailActionPrompt | VoicemailOption.VoicemailActionStaticText | VoicemailOption.VoicemailActionHangup | VoicemailOption.VoicemailActionBridgeTransfer;
3324
+ }
3325
+ namespace VoicemailOption {
3326
+ interface VoicemailActionPrompt {
3327
+ /**
3328
+ * The prompt used to generate the text to be spoken when the call is detected to
3329
+ * be in voicemail.
3330
+ */
3331
+ text: string;
3332
+ type: 'prompt';
3333
+ }
3334
+ interface VoicemailActionStaticText {
3335
+ /**
3336
+ * The text to be spoken when the call is detected to be in voicemail.
3337
+ */
3338
+ text: string;
3339
+ type: 'static_text';
3340
+ }
3341
+ interface VoicemailActionHangup {
3342
+ type: 'hangup';
3343
+ }
3344
+ interface VoicemailActionBridgeTransfer {
3345
+ type: 'bridge_transfer';
3346
+ }
3347
+ }
3348
+ }
3349
+ /**
3350
+ * Override conversation flow configuration settings. Only applicable when using
3351
+ * conversation flow as the response engine. Supported attributes - model_choice,
3352
+ * model_temperature, tool_call_strict_mode, knowledge_base_ids, kb_config,
3353
+ * start_speaker, begin_after_user_silence_ms.
3354
+ */
3355
+ interface ConversationFlow {
3356
+ /**
3357
+ * If set, the AI will begin the conversation after waiting for the user for the
3358
+ * duration (in milliseconds) specified by this attribute. This only applies if the
3359
+ * agent is configured to wait for the user to speak first. If not set, the agent
3360
+ * will wait indefinitely for the user to speak.
3361
+ */
3362
+ begin_after_user_silence_ms?: number | null;
3363
+ /**
3364
+ * Knowledge base configuration for RAG retrieval.
3365
+ */
3366
+ kb_config?: ConversationFlow.KBConfig;
3367
+ /**
3368
+ * Knowledge base IDs for RAG (Retrieval-Augmented Generation).
3369
+ */
3370
+ knowledge_base_ids?: Array<string> | null;
3371
+ /**
3372
+ * The model choice for the conversation flow.
3373
+ */
3374
+ model_choice?: ConversationFlow.ModelChoice;
3375
+ /**
3376
+ * Controls the randomness of the model's responses. Lower values make responses
3377
+ * more deterministic.
3378
+ */
3379
+ model_temperature?: number | null;
3380
+ /**
3381
+ * Who starts the conversation - user or agent.
3382
+ */
3383
+ start_speaker?: 'user' | 'agent';
3384
+ /**
3385
+ * Whether to use strict mode for tool calls. Only applicable when using certain
3386
+ * supported models.
3387
+ */
3388
+ tool_call_strict_mode?: boolean | null;
3389
+ }
3390
+ namespace ConversationFlow {
3391
+ /**
3392
+ * Knowledge base configuration for RAG retrieval.
3393
+ */
3394
+ interface KBConfig {
3395
+ /**
3396
+ * Similarity threshold for filtering search results
3397
+ */
3398
+ filter_score?: number;
3399
+ /**
3400
+ * Max number of knowledge base chunks to retrieve
3401
+ */
3402
+ top_k?: number;
3403
+ }
3404
+ /**
3405
+ * The model choice for the conversation flow.
3406
+ */
3407
+ interface ModelChoice {
3408
+ /**
3409
+ * The LLM model to use
3410
+ */
3411
+ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5-mini' | 'gpt-5-nano' | 'claude-4.5-sonnet' | 'claude-4.5-haiku' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-3.0-flash';
3412
+ /**
3413
+ * Type of model choice
3414
+ */
3415
+ type: 'cascading';
3416
+ /**
3417
+ * Whether to use high priority pool with more dedicated resource, default false
3418
+ */
3419
+ high_priority?: boolean;
3420
+ }
3421
+ }
3422
+ /**
3423
+ * Override Retell LLM configuration settings. Only applicable when using Retell
3424
+ * LLM as the response engine. Supported attributes - model, s2s_model,
3425
+ * model_temperature, model_high_priority, tool_call_strict_mode,
3426
+ * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms,
3427
+ * begin_message.
3428
+ */
3429
+ interface RetellLlm {
3430
+ /**
3431
+ * If set, the AI will begin the conversation after waiting for the user for the
3432
+ * duration (in milliseconds) specified by this attribute. This only applies if the
3433
+ * agent is configured to wait for the user to speak first. If not set, the agent
3434
+ * will wait indefinitely for the user to speak.
3435
+ */
3436
+ begin_after_user_silence_ms?: number | null;
3437
+ /**
3438
+ * First utterance said by the agent in the call. If not set, LLM will dynamically
3439
+ * generate a message. If set to "", agent will wait for user to speak first.
3440
+ */
3441
+ begin_message?: string | null;
3442
+ /**
3443
+ * Knowledge base configuration for RAG retrieval.
3444
+ */
3445
+ kb_config?: RetellLlm.KBConfig | null;
3446
+ /**
3447
+ * A list of knowledge base ids to use for this resource.
3448
+ */
3449
+ knowledge_base_ids?: Array<string> | null;
3450
+ /**
3451
+ * Select the underlying text LLM. If not set, would default to gpt-4.1.
3452
+ */
3453
+ model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5-mini' | 'gpt-5-nano' | 'claude-4.5-sonnet' | 'claude-4.5-haiku' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-3.0-flash' | null;
3454
+ /**
3455
+ * If set to true, will use high priority pool with more dedicated resource to
3456
+ * ensure lower and more consistent latency, default to false. This feature usually
3457
+ * comes with a higher cost.
3458
+ */
3459
+ model_high_priority?: boolean | null;
3460
+ /**
3461
+ * If set, will control the randomness of the response. Value ranging from [0,1].
3462
+ * Lower value means more deterministic, while higher value means more random. If
3463
+ * unset, default value 0 will apply. Note that for tool calling, a lower value is
3464
+ * recommended.
3465
+ */
3466
+ model_temperature?: number;
3467
+ /**
3468
+ * Select the underlying speech to speech model. Can only set this or model, not
3469
+ * both.
3470
+ */
3471
+ s2s_model?: 'gpt-4o-realtime' | 'gpt-4o-mini-realtime' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
3472
+ /**
3473
+ * The speaker who starts the conversation. Required. Must be either 'user' or
3474
+ * 'agent'.
3475
+ */
3476
+ start_speaker?: 'user' | 'agent';
3477
+ /**
3478
+ * Whether to use strict mode for tool calls. Only applicable when using certain
3479
+ * supported models.
3480
+ */
3481
+ tool_call_strict_mode?: boolean | null;
3482
+ }
3483
+ namespace RetellLlm {
3484
+ /**
3485
+ * Knowledge base configuration for RAG retrieval.
3486
+ */
3487
+ interface KBConfig {
3488
+ /**
3489
+ * Similarity threshold for filtering search results
3490
+ */
3491
+ filter_score?: number;
3492
+ /**
3493
+ * Max number of knowledge base chunks to retrieve
3494
+ */
3495
+ top_k?: number;
3496
+ }
3497
+ }
3498
+ }
3499
+ }
3500
+ export interface CallRegisterPhoneCallParams {
3501
+ /**
3502
+ * The agent to use for the call.
3503
+ */
3504
+ agent_id: string;
3505
+ /**
3506
+ * For this particular call, override agent configuration with these settings. This
3507
+ * allows you to customize agent behavior for individual calls without modifying
3508
+ * the base agent.
3509
+ */
3510
+ agent_override?: CallRegisterPhoneCallParams.AgentOverride;
3511
+ /**
3512
+ * The version of the agent to use for the call.
3513
+ */
3514
+ agent_version?: number;
3515
+ /**
3516
+ * Direction of the phone call. Stored for tracking purpose.
3517
+ */
3518
+ direction?: 'inbound' | 'outbound';
3519
+ /**
3520
+ * The number you own in E.164 format. Stored for tracking purpose.
3521
+ */
3522
+ from_number?: string;
3523
+ /**
3524
+ * An arbitrary object for storage purpose only. You can put anything here like
3525
+ * your internal customer id associated with the call. Not used for processing. You
3526
+ * can later get this field from the call object.
3527
+ */
3528
+ metadata?: unknown;
3529
+ /**
3530
+ * Add optional dynamic variables in key value pairs of string that injects into
3531
+ * your Response Engine prompt and tool description. Only applicable for Response
3532
+ * Engine.
3533
+ */
3534
+ retell_llm_dynamic_variables?: {
3535
+ [key: string]: unknown;
3536
+ };
3537
+ /**
3538
+ * The number you want to call, in E.164 format. Stored for tracking purpose.
3539
+ */
3540
+ to_number?: string;
3541
+ }
3542
+ export declare namespace CallRegisterPhoneCallParams {
3543
+ /**
3544
+ * For this particular call, override agent configuration with these settings. This
3545
+ * allows you to customize agent behavior for individual calls without modifying
3546
+ * the base agent.
3547
+ */
3548
+ interface AgentOverride {
3549
+ /**
3550
+ * Override agent configuration settings. Any properties specified here will
3551
+ * override the base agent configuration for this call.
3552
+ */
3553
+ agent?: AgentOverride.Agent;
3554
+ /**
3555
+ * Override conversation flow configuration settings. Only applicable when using
3556
+ * conversation flow as the response engine. Supported attributes - model_choice,
3557
+ * model_temperature, tool_call_strict_mode, knowledge_base_ids, kb_config,
3558
+ * start_speaker, begin_after_user_silence_ms.
3559
+ */
3560
+ conversation_flow?: AgentOverride.ConversationFlow;
3561
+ /**
3562
+ * Override Retell LLM configuration settings. Only applicable when using Retell
3563
+ * LLM as the response engine. Supported attributes - model, s2s_model,
3564
+ * model_temperature, model_high_priority, tool_call_strict_mode,
3565
+ * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms,
3566
+ * begin_message.
3567
+ */
3568
+ retell_llm?: AgentOverride.RetellLlm;
3569
+ }
3570
+ namespace AgentOverride {
3571
+ /**
3572
+ * Override agent configuration settings. Any properties specified here will
3573
+ * override the base agent configuration for this call.
3574
+ */
3575
+ interface Agent {
3576
+ /**
3577
+ * The name of the agent. Only used for your own reference.
3578
+ */
3579
+ agent_name?: string | null;
3580
+ /**
3581
+ * If set to true, DTMF input will be accepted and processed. If false, any DTMF
3582
+ * input will be ignored. Default to true.
3583
+ */
3584
+ allow_user_dtmf?: boolean;
3585
+ /**
3586
+ * If set, will add ambient environment sound to the call to make experience more
3587
+ * realistic. Currently supports the following options:
3588
+ *
3589
+ * - `coffee-shop`: Coffee shop ambience with people chatting in background.
3590
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/coffee-shop.wav)
3591
+ * - `convention-hall`: Convention hall ambience, with some echo and people
3592
+ * chatting in background.
3593
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/convention-hall.wav)
3594
+ * - `summer-outdoor`: Summer outdoor ambience with cicada chirping.
3595
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/summer-outdoor.wav)
3596
+ * - `mountain-outdoor`: Mountain outdoor ambience with birds singing.
3597
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/mountain-outdoor.wav)
3598
+ * - `static-noise`: Constant static noise.
3599
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/static-noise.wav)
3600
+ * - `call-center`: Call center work noise.
3601
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/call-center.wav)
3602
+ * Set to `null` to remove ambient sound from this agent.
3603
+ */
3604
+ ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'static-noise' | 'call-center' | null;
3605
+ /**
3606
+ * If set, will control the volume of the ambient sound. Value ranging from [0,2].
3607
+ * Lower value means quieter ambient sound, while higher value means louder ambient
3608
+ * sound. If unset, default value 1 will apply.
3609
+ */
3610
+ ambient_sound_volume?: number;
3611
+ /**
3612
+ * Prompt to determine whether the post call or chat analysis should mark the
3613
+ * interaction as successful. Set to null to use the default prompt.
3614
+ */
3615
+ analysis_successful_prompt?: string | null;
3616
+ /**
3617
+ * Prompt to guide how the post call or chat analysis summary should be generated.
3618
+ * When unset, the default system prompt is used. Set to null to use the default
3619
+ * prompt.
3620
+ */
3621
+ analysis_summary_prompt?: string | null;
3622
+ /**
3623
+ * Only applicable when enable_backchannel is true. Controls how often the agent
3624
+ * would backchannel when a backchannel is possible. Value ranging from [0,1].
3625
+ * Lower value means less frequent backchannel, while higher value means more
3626
+ * frequent backchannel. If unset, default value 0.8 will apply.
3627
+ */
3628
+ backchannel_frequency?: number;
3629
+ /**
3630
+ * Only applicable when enable_backchannel is true. A list of words that the agent
3631
+ * would use as backchannel. If not set, default backchannel words will apply.
3632
+ * Check out
3633
+ * [backchannel default words](/agent/interaction-configuration#backchannel) for
3634
+ * more details. Note that certain voices do not work too well with certain words,
3635
+ * so it's recommended to experiment before adding any words.
3636
+ */
3637
+ backchannel_words?: Array<string> | null;
3638
+ /**
3639
+ * If set, will delay the first message by the specified amount of milliseconds, so
3640
+ * that it gives user more time to prepare to take the call. Valid range is [0,
3641
+ * 5000]. If not set or set to 0, agent will speak immediately. Only applicable
3642
+ * when agent speaks first.
3643
+ */
3644
+ begin_message_delay_ms?: number;
3645
+ /**
3646
+ * Provide a customized list of keywords to bias the transcriber model, so that
3647
+ * these words are more likely to get transcribed. Commonly used for names, brands,
3648
+ * street, etc.
3649
+ */
3650
+ boosted_keywords?: Array<string> | null;
3651
+ /**
3652
+ * Custom STT configuration. Only used when stt_mode is set to custom.
3653
+ */
3654
+ custom_stt_config?: Agent.CustomSttConfig;
3655
+ /**
3656
+ * Granular setting to manage how Retell stores sensitive data (transcripts,
3657
+ * recordings, logs, etc.). This replaces the deprecated
3658
+ * `opt_out_sensitive_data_storage` field.
3659
+ *
3660
+ * - `everything`: Store all data including transcripts, recordings, and logs.
3661
+ * - `everything_except_pii`: Store data without PII when PII is detected.
3662
+ * - `basic_attributes_only`: Store only basic attributes; no
3663
+ * transcripts/recordings/logs. If not set, default value of "everything" will
3664
+ * apply.
3665
+ */
3666
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only';
3667
+ /**
3668
+ * If set, determines what denoising mode to use. Use "no-denoise" to bypass all
3669
+ * audio denoising. Default to noise-cancellation.
3670
+ */
3671
+ denoising_mode?: 'no-denoise' | 'noise-cancellation' | 'noise-and-background-speech-cancellation';
3672
+ /**
3673
+ * Controls whether the agent would backchannel (agent interjects the speaker with
3674
+ * phrases like "yeah", "uh-huh" to signify interest and engagement). Backchannel
3675
+ * when enabled tends to show up more in longer user utterances. If not set, agent
3676
+ * will not backchannel.
3677
+ */
3678
+ enable_backchannel?: boolean;
3679
+ /**
3680
+ * If set to true, will enable dynamic voice speed adjustment based on the user's
3681
+ * speech rate and conversation context. If unset, default value false will apply.
3682
+ */
3683
+ enable_dynamic_voice_speed?: boolean;
3684
+ /**
3685
+ * If set to true, will detect whether the call enters a voicemail. Note that this
3686
+ * feature is only available for phone calls.
3687
+ */
3688
+ enable_voicemail_detection?: boolean;
3689
+ /**
3690
+ * If users stay silent for a period after agent speech, end the call. The minimum
3691
+ * value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min).
3692
+ */
3693
+ end_call_after_silence_ms?: number;
3694
+ /**
3695
+ * When TTS provider for the selected voice is experiencing outages, we would use
3696
+ * fallback voices listed here for the agent. Voice id and the fallback voice ids
3697
+ * must be from different TTS providers. The system would go through the list in
3698
+ * order, if the first one in the list is also having outage, it would use the next
3699
+ * one. Set to null to remove voice fallback for the agent.
3700
+ */
3701
+ fallback_voice_ids?: Array<string> | null;
3702
+ /**
3703
+ * Configuration for guardrail checks to detect and prevent prohibited topics in
3704
+ * agent output and user input.
3705
+ */
3706
+ guardrail_config?: Agent.GuardrailConfig;
3707
+ /**
3708
+ * Controls how sensitive the agent is to user interruptions. Value ranging from
3709
+ * [0,1]. Lower value means it will take longer / more words for user to interrupt
3710
+ * agent, while higher value means it's easier for user to interrupt agent. If
3711
+ * unset, default value 1 will apply. When this is set to 0, agent would never be
3712
+ * interrupted.
3713
+ */
3714
+ interruption_sensitivity?: number;
3715
+ /**
3716
+ * Whether the agent is public. When set to true, the agent is available for public
3717
+ * agent preview link.
3718
+ */
3719
+ is_public?: boolean | null;
3720
+ /**
3721
+ * If this option is set, the call will try to detect IVR in the first 3 minutes of
3722
+ * the call. Actions defined will be applied when the IVR is detected. Set this to
3723
+ * null to disable IVR detection.
3724
+ */
3725
+ ivr_option?: Agent.IvrOption | null;
3726
+ /**
3727
+ * Specifies what language (and dialect) the speech recognition will operate in.
3728
+ * For instance, selecting `en-GB` optimizes speech recognition for British
3729
+ * English. If unset, will use default value `en-US`. Select `multi` for
3730
+ * multilingual support.
3731
+ */
3732
+ language?: 'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA' | 'multi';
3733
+ /**
3734
+ * Maximum allowed length for the call, will force end the call if reached. The
3735
+ * minimum value allowed is 60,000 ms (1 min), and maximum value allowed is
3736
+ * 7,200,000 (2 hours). By default, this is set to 3,600,000 (1 hour).
3737
+ */
3738
+ max_call_duration_ms?: number;
3739
+ /**
3740
+ * If set to true, will normalize the some part of text (number, currency, date,
3741
+ * etc) to spoken to its spoken form for more consistent speech synthesis
3742
+ * (sometimes the voice synthesize system itself might read these wrong with the
3743
+ * raw text). For example, it will convert "Call my number 2137112342 on Jul 5th,
3744
+ * 2024 for the $24.12 payment" to "Call my number two one three seven one one two
3745
+ * three four two on july fifth, twenty twenty four for the twenty four dollars
3746
+ * twelve cents payment" before starting audio generation.
3747
+ */
3748
+ normalize_for_speech?: boolean;
3749
+ /**
3750
+ * Whether this agent opts in for signed URLs for public logs and recordings. When
3751
+ * enabled, the generated URLs will include security signatures that restrict
3752
+ * access and automatically expire after 24 hours.
3753
+ */
3754
+ opt_in_signed_url?: boolean;
3755
+ /**
3756
+ * Configuration for PII scrubbing from transcripts and recordings.
3757
+ */
3758
+ pii_config?: Agent.PiiConfig;
3759
+ /**
3760
+ * Post call analysis data to extract from the call. This data will augment the
3761
+ * pre-defined variables extracted in the call analysis. This will be available
3762
+ * after the call ends.
3763
+ */
3764
+ post_call_analysis_data?: Array<Agent.StringAnalysisData | Agent.EnumAnalysisData | Agent.BooleanAnalysisData | Agent.NumberAnalysisData> | null;
3765
+ /**
3766
+ * The model to use for post call analysis. Default to gpt-4.1-mini.
3767
+ */
3768
+ post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5-mini' | 'gpt-5-nano' | 'claude-4.5-sonnet' | 'claude-4.5-haiku' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-3.0-flash' | null;
3769
+ /**
3770
+ * A list of words / phrases and their pronunciation to be used to guide the audio
3771
+ * synthesize for consistent pronunciation. Currently only supported for English &
3772
+ * 11labs voices. Set to null to remove pronunciation dictionary from this agent.
3773
+ */
3774
+ pronunciation_dictionary?: Array<Agent.PronunciationDictionary> | null;
3775
+ /**
3776
+ * If set, controls how many times agent would remind user when user is
3777
+ * unresponsive. Must be a non negative integer. If unset, default value of 1 will
3778
+ * apply (remind once). Set to 0 to disable agent from reminding.
3779
+ */
3780
+ reminder_max_count?: number;
3781
+ /**
3782
+ * If set (in milliseconds), will trigger a reminder to the agent to speak if the
3783
+ * user has been silent for the specified duration after some agent speech. Must be
3784
+ * a positive number. If unset, default value of 10000 ms (10 s) will apply.
3785
+ */
3786
+ reminder_trigger_ms?: number;
3787
+ /**
3788
+ * The Response Engine to attach to the agent. It is used to generate responses for
3789
+ * the agent. You need to create a Response Engine first before attaching it to an
3790
+ * agent.
3791
+ */
3792
+ response_engine?: Agent.ResponseEngineRetellLm | Agent.ResponseEngineCustomLm | Agent.ResponseEngineConversationFlow;
3793
+ /**
3794
+ * Controls how responsive is the agent. Value ranging from [0,1]. Lower value
3795
+ * means less responsive agent (wait more, respond slower), while higher value
3796
+ * means faster exchanges (respond when it can). If unset, default value 1 will
3797
+ * apply.
3798
+ */
3799
+ responsiveness?: number;
3800
+ /**
3801
+ * If set, the phone ringing will last for the specified amount of milliseconds.
3802
+ * This applies for both outbound call ringtime, and call transfer ringtime.
3803
+ * Default to 30000 (30 s). Valid range is [5000, 90000].
3804
+ */
3805
+ ring_duration_ms?: number;
3806
+ /**
3807
+ * The expiration time for the signed url in milliseconds. Only applicable when
3808
+ * opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will
3809
+ * apply.
3810
+ */
3811
+ signed_url_expiration_ms?: number | null;
3812
+ /**
3813
+ * If set, determines whether speech to text should focus on latency or accuracy.
3814
+ * Default to fast mode. When set to custom, custom_stt_config must be provided.
3815
+ */
3816
+ stt_mode?: 'fast' | 'accurate' | 'custom';
3817
+ user_dtmf_options?: Agent.UserDtmfOptions | null;
3818
+ /**
3819
+ * Optional description of the agent version. Used for your own reference and
3820
+ * documentation.
3821
+ */
3822
+ version_description?: string | null;
3823
+ /**
3824
+ * If set, determines the vocabulary set to use for transcription. This setting
3825
+ * only applies for English agents, for non English agent, this setting is a no-op.
3826
+ * Default to general.
3827
+ */
3828
+ vocab_specialization?: 'general' | 'medical';
3829
+ /**
3830
+ * Controls the emotional tone of the agent's voice. Currently supported for
3831
+ * Cartesia and Minimax TTS providers. If unset, no emotion will be used.
3832
+ */
3833
+ voice_emotion?: 'calm' | 'sympathetic' | 'happy' | 'sad' | 'angry' | 'fearful' | 'surprised' | null;
3834
+ /**
3835
+ * Unique voice id used for the agent. Find list of available voices and their
3836
+ * preview in Dashboard.
3837
+ */
3838
+ voice_id?: string;
3839
+ /**
3840
+ * Select the voice model used for the selected voice. Each provider has a set of
3841
+ * available voice models. Set to null to remove voice model selection, and default
3842
+ * ones will apply. Check out dashboard for more details of each voice model.
3843
+ */
3844
+ voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'sonic-2' | 'sonic-3' | 'sonic-3-latest' | 'sonic-turbo' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | null;
3845
+ /**
3846
+ * Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
3847
+ * speech, while higher value means faster speech rate. If unset, default value 1
3848
+ * will apply.
3849
+ */
3850
+ voice_speed?: number;
3851
+ /**
3852
+ * Controls how stable the voice is. Value ranging from [0,2]. Lower value means
3853
+ * more stable, and higher value means more variant speech generation. Currently
3854
+ * this setting only applies to `11labs` voices. If unset, default value 1 will
3855
+ * apply.
3856
+ */
3857
+ voice_temperature?: number;
3858
+ /**
3859
+ * Configures when to stop running voicemail detection, as it becomes unlikely to
3860
+ * hit voicemail after a couple minutes, and keep running it will only have
3861
+ * negative impact. The minimum value allowed is 5,000 ms (5 s), and maximum value
3862
+ * allowed is 180,000 (3 minutes). By default, this is set to 30,000 (30 s).
3863
+ */
3864
+ voicemail_detection_timeout_ms?: number;
3865
+ /**
3866
+ * The message to be played when the call enters a voicemail. Note that this
3867
+ * feature is only available for phone calls. If you want to hangup after hitting
3868
+ * voicemail, set this to empty string.
3869
+ */
3870
+ voicemail_message?: string;
3871
+ /**
3872
+ * If this option is set, the call will try to detect voicemail in the first 3
3873
+ * minutes of the call. Actions defined (hangup, or leave a message) will be
3874
+ * applied when the voicemail is detected. Set this to null to disable voicemail
3875
+ * detection.
3876
+ */
3877
+ voicemail_option?: Agent.VoicemailOption | null;
3878
+ /**
3879
+ * If set, will control the volume of the agent. Value ranging from [0,2]. Lower
3880
+ * value means quieter agent speech, while higher value means louder agent speech.
3881
+ * If unset, default value 1 will apply.
3882
+ */
3883
+ volume?: number;
3884
+ /**
3885
+ * Which webhook events this agent should receive. If not set, defaults to
3886
+ * call_started, call_ended, call_analyzed.
3887
+ */
3888
+ webhook_events?: Array<'call_started' | 'call_ended' | 'call_analyzed' | 'transcript_updated' | 'transfer_started' | 'transfer_bridged' | 'transfer_cancelled' | 'transfer_ended'> | null;
3889
+ /**
3890
+ * The timeout for the webhook in milliseconds. If not set, default value of 10000
3891
+ * will apply.
3892
+ */
3893
+ webhook_timeout_ms?: number;
3894
+ /**
3895
+ * The webhook for agent to listen to call events. See what events it would get at
3896
+ * [webhook doc](/features/webhook). If set, will binds webhook events for this
3897
+ * agent to the specified url, and will ignore the account level webhook for this
3898
+ * agent. Set to `null` to remove webhook url from this agent.
3899
+ */
3900
+ webhook_url?: string | null;
3901
+ }
3902
+ namespace Agent {
3903
+ /**
3904
+ * Custom STT configuration. Only used when stt_mode is set to custom.
3905
+ */
3906
+ interface CustomSttConfig {
3907
+ /**
3908
+ * Endpointing timeout in milliseconds. Minimum is 100 for azure, 10 for deepgram.
3909
+ */
3910
+ endpointing_ms: number;
3911
+ /**
3912
+ * The STT provider to use.
3913
+ */
3914
+ provider: 'azure' | 'deepgram';
3915
+ }
3916
+ /**
3917
+ * Configuration for guardrail checks to detect and prevent prohibited topics in
3918
+ * agent output and user input.
3919
+ */
3920
+ interface GuardrailConfig {
3921
+ /**
3922
+ * Selected prohibited user topic categories to check. When user messages contain
3923
+ * these topics, the agent will respond with a placeholder message instead of
3924
+ * processing the request.
3925
+ */
3926
+ input_topics?: Array<'platform_integrity_jailbreaking'> | null;
3927
+ /**
3928
+ * Selected prohibited agent topic categories to check. When agent messages contain
3929
+ * these topics, they will be replaced with a placeholder message.
3930
+ */
3931
+ output_topics?: Array<'harassment' | 'self_harm' | 'sexual_exploitation' | 'violence' | 'defense_and_national_security' | 'illicit_and_harmful_activity' | 'gambling' | 'regulated_professional_advice' | 'child_safety_and_exploitation'> | null;
3932
+ }
3933
+ /**
3934
+ * If this option is set, the call will try to detect IVR in the first 3 minutes of
3935
+ * the call. Actions defined will be applied when the IVR is detected. Set this to
3936
+ * null to disable IVR detection.
3937
+ */
3938
+ interface IvrOption {
3939
+ action: IvrOption.Action;
3940
+ }
3941
+ namespace IvrOption {
3942
+ interface Action {
3943
+ type: 'hangup';
3944
+ }
3945
+ }
3946
+ /**
3947
+ * Configuration for PII scrubbing from transcripts and recordings.
3948
+ */
3949
+ interface PiiConfig {
3950
+ /**
3951
+ * List of PII categories to scrub from transcripts and recordings.
3952
+ */
3953
+ categories: Array<'person_name' | 'address' | 'email' | 'phone_number' | 'ssn' | 'passport' | 'driver_license' | 'credit_card' | 'bank_account' | 'password' | 'pin' | 'medical_id' | 'date_of_birth' | 'customer_account_number'>;
3954
+ /**
3955
+ * The processing mode for PII scrubbing. Currently only post-call is supported.
3956
+ */
3957
+ mode: 'post_call';
3958
+ }
3959
+ interface StringAnalysisData {
3960
+ /**
3961
+ * Description of the variable.
3962
+ */
3963
+ description: string;
3964
+ /**
3965
+ * Name of the variable.
3966
+ */
3967
+ name: string;
3968
+ /**
3969
+ * Type of the variable to extract.
3970
+ */
3971
+ type: 'string';
3972
+ /**
3973
+ * Examples of the variable value to teach model the style and syntax.
3974
+ */
3975
+ examples?: Array<string>;
3976
+ }
3977
+ interface EnumAnalysisData {
3978
+ /**
3979
+ * The possible values of the variable, must be non empty array.
3980
+ */
3981
+ choices: Array<string>;
3982
+ /**
3983
+ * Description of the variable.
3984
+ */
3985
+ description: string;
3986
+ /**
3987
+ * Name of the variable.
3988
+ */
3989
+ name: string;
3990
+ /**
3991
+ * Type of the variable to extract.
3992
+ */
3993
+ type: 'enum';
3994
+ }
3995
+ interface BooleanAnalysisData {
3996
+ /**
3997
+ * Description of the variable.
3998
+ */
3999
+ description: string;
4000
+ /**
4001
+ * Name of the variable.
4002
+ */
4003
+ name: string;
4004
+ /**
4005
+ * Type of the variable to extract.
4006
+ */
4007
+ type: 'boolean';
4008
+ }
4009
+ interface NumberAnalysisData {
4010
+ /**
4011
+ * Description of the variable.
4012
+ */
4013
+ description: string;
4014
+ /**
4015
+ * Name of the variable.
4016
+ */
4017
+ name: string;
4018
+ /**
4019
+ * Type of the variable to extract.
4020
+ */
4021
+ type: 'number';
4022
+ }
4023
+ interface PronunciationDictionary {
4024
+ /**
4025
+ * The phonetic alphabet to be used for pronunciation.
4026
+ */
4027
+ alphabet: 'ipa' | 'cmu';
4028
+ /**
4029
+ * Pronunciation of the word in the format of a IPA / CMU pronunciation.
4030
+ */
4031
+ phoneme: string;
4032
+ /**
4033
+ * The string of word / phrase to be annotated with pronunciation.
4034
+ */
4035
+ word: string;
4036
+ }
4037
+ interface ResponseEngineRetellLm {
4038
+ /**
4039
+ * id of the Retell LLM Response Engine.
4040
+ */
4041
+ llm_id: string;
4042
+ /**
4043
+ * type of the Response Engine.
4044
+ */
4045
+ type: 'retell-llm';
4046
+ /**
4047
+ * Version of the Retell LLM Response Engine.
4048
+ */
4049
+ version?: number | null;
4050
+ }
4051
+ interface ResponseEngineCustomLm {
4052
+ /**
4053
+ * LLM websocket url of the custom LLM.
4054
+ */
4055
+ llm_websocket_url: string;
4056
+ /**
4057
+ * type of the Response Engine.
4058
+ */
4059
+ type: 'custom-llm';
4060
+ }
4061
+ interface ResponseEngineConversationFlow {
4062
+ /**
4063
+ * ID of the Conversation Flow Response Engine.
4064
+ */
4065
+ conversation_flow_id: string;
4066
+ /**
4067
+ * type of the Response Engine.
4068
+ */
4069
+ type: 'conversation-flow';
4070
+ /**
4071
+ * Version of the Conversation Flow Response Engine.
4072
+ */
4073
+ version?: number | null;
4074
+ }
4075
+ interface UserDtmfOptions {
4076
+ /**
4077
+ * The maximum number of digits allowed in the user's DTMF (Dual-Tone
4078
+ * Multi-Frequency) input per turn. Once this limit is reached, the input is
4079
+ * considered complete and a response will be generated immediately.
4080
+ */
4081
+ digit_limit?: number | null;
4082
+ /**
4083
+ * A single key that signals the end of DTMF input. Acceptable values include any
4084
+ * digit (0-9), the pound/hash symbol (#), or the asterisk (\*).
4085
+ */
4086
+ termination_key?: string | null;
4087
+ /**
4088
+ * The time (in milliseconds) to wait for user DTMF input before timing out. The
4089
+ * timer resets with each digit received.
4090
+ */
4091
+ timeout_ms?: number;
4092
+ }
4093
+ /**
4094
+ * If this option is set, the call will try to detect voicemail in the first 3
4095
+ * minutes of the call. Actions defined (hangup, or leave a message) will be
4096
+ * applied when the voicemail is detected. Set this to null to disable voicemail
4097
+ * detection.
4098
+ */
4099
+ interface VoicemailOption {
4100
+ action: VoicemailOption.VoicemailActionPrompt | VoicemailOption.VoicemailActionStaticText | VoicemailOption.VoicemailActionHangup | VoicemailOption.VoicemailActionBridgeTransfer;
4101
+ }
4102
+ namespace VoicemailOption {
4103
+ interface VoicemailActionPrompt {
4104
+ /**
4105
+ * The prompt used to generate the text to be spoken when the call is detected to
4106
+ * be in voicemail.
4107
+ */
4108
+ text: string;
4109
+ type: 'prompt';
4110
+ }
4111
+ interface VoicemailActionStaticText {
4112
+ /**
4113
+ * The text to be spoken when the call is detected to be in voicemail.
4114
+ */
4115
+ text: string;
4116
+ type: 'static_text';
4117
+ }
4118
+ interface VoicemailActionHangup {
4119
+ type: 'hangup';
4120
+ }
4121
+ interface VoicemailActionBridgeTransfer {
4122
+ type: 'bridge_transfer';
4123
+ }
4124
+ }
4125
+ }
4126
+ /**
4127
+ * Override conversation flow configuration settings. Only applicable when using
4128
+ * conversation flow as the response engine. Supported attributes - model_choice,
4129
+ * model_temperature, tool_call_strict_mode, knowledge_base_ids, kb_config,
4130
+ * start_speaker, begin_after_user_silence_ms.
4131
+ */
4132
+ interface ConversationFlow {
4133
+ /**
4134
+ * If set, the AI will begin the conversation after waiting for the user for the
4135
+ * duration (in milliseconds) specified by this attribute. This only applies if the
4136
+ * agent is configured to wait for the user to speak first. If not set, the agent
4137
+ * will wait indefinitely for the user to speak.
4138
+ */
4139
+ begin_after_user_silence_ms?: number | null;
4140
+ /**
4141
+ * Knowledge base configuration for RAG retrieval.
4142
+ */
4143
+ kb_config?: ConversationFlow.KBConfig;
4144
+ /**
4145
+ * Knowledge base IDs for RAG (Retrieval-Augmented Generation).
4146
+ */
4147
+ knowledge_base_ids?: Array<string> | null;
4148
+ /**
4149
+ * The model choice for the conversation flow.
4150
+ */
4151
+ model_choice?: ConversationFlow.ModelChoice;
4152
+ /**
4153
+ * Controls the randomness of the model's responses. Lower values make responses
4154
+ * more deterministic.
4155
+ */
4156
+ model_temperature?: number | null;
4157
+ /**
4158
+ * Who starts the conversation - user or agent.
4159
+ */
4160
+ start_speaker?: 'user' | 'agent';
4161
+ /**
4162
+ * Whether to use strict mode for tool calls. Only applicable when using certain
4163
+ * supported models.
4164
+ */
4165
+ tool_call_strict_mode?: boolean | null;
4166
+ }
4167
+ namespace ConversationFlow {
4168
+ /**
4169
+ * Knowledge base configuration for RAG retrieval.
4170
+ */
4171
+ interface KBConfig {
4172
+ /**
4173
+ * Similarity threshold for filtering search results
4174
+ */
4175
+ filter_score?: number;
4176
+ /**
4177
+ * Max number of knowledge base chunks to retrieve
4178
+ */
4179
+ top_k?: number;
4180
+ }
4181
+ /**
4182
+ * The model choice for the conversation flow.
4183
+ */
4184
+ interface ModelChoice {
4185
+ /**
4186
+ * The LLM model to use
4187
+ */
4188
+ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5-mini' | 'gpt-5-nano' | 'claude-4.5-sonnet' | 'claude-4.5-haiku' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-3.0-flash';
4189
+ /**
4190
+ * Type of model choice
4191
+ */
4192
+ type: 'cascading';
4193
+ /**
4194
+ * Whether to use high priority pool with more dedicated resource, default false
4195
+ */
4196
+ high_priority?: boolean;
4197
+ }
4198
+ }
4199
+ /**
4200
+ * Override Retell LLM configuration settings. Only applicable when using Retell
4201
+ * LLM as the response engine. Supported attributes - model, s2s_model,
4202
+ * model_temperature, model_high_priority, tool_call_strict_mode,
4203
+ * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms,
4204
+ * begin_message.
4205
+ */
4206
+ interface RetellLlm {
4207
+ /**
4208
+ * If set, the AI will begin the conversation after waiting for the user for the
4209
+ * duration (in milliseconds) specified by this attribute. This only applies if the
4210
+ * agent is configured to wait for the user to speak first. If not set, the agent
4211
+ * will wait indefinitely for the user to speak.
4212
+ */
4213
+ begin_after_user_silence_ms?: number | null;
4214
+ /**
4215
+ * First utterance said by the agent in the call. If not set, LLM will dynamically
4216
+ * generate a message. If set to "", agent will wait for user to speak first.
4217
+ */
4218
+ begin_message?: string | null;
4219
+ /**
4220
+ * Knowledge base configuration for RAG retrieval.
4221
+ */
4222
+ kb_config?: RetellLlm.KBConfig | null;
4223
+ /**
4224
+ * A list of knowledge base ids to use for this resource.
4225
+ */
4226
+ knowledge_base_ids?: Array<string> | null;
4227
+ /**
4228
+ * Select the underlying text LLM. If not set, would default to gpt-4.1.
4229
+ */
4230
+ model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5-mini' | 'gpt-5-nano' | 'claude-4.5-sonnet' | 'claude-4.5-haiku' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-3.0-flash' | null;
4231
+ /**
4232
+ * If set to true, will use high priority pool with more dedicated resource to
4233
+ * ensure lower and more consistent latency, default to false. This feature usually
4234
+ * comes with a higher cost.
4235
+ */
4236
+ model_high_priority?: boolean | null;
4237
+ /**
4238
+ * If set, will control the randomness of the response. Value ranging from [0,1].
4239
+ * Lower value means more deterministic, while higher value means more random. If
4240
+ * unset, default value 0 will apply. Note that for tool calling, a lower value is
4241
+ * recommended.
4242
+ */
4243
+ model_temperature?: number;
4244
+ /**
4245
+ * Select the underlying speech to speech model. Can only set this or model, not
4246
+ * both.
4247
+ */
4248
+ s2s_model?: 'gpt-4o-realtime' | 'gpt-4o-mini-realtime' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
4249
+ /**
4250
+ * The speaker who starts the conversation. Required. Must be either 'user' or
4251
+ * 'agent'.
4252
+ */
4253
+ start_speaker?: 'user' | 'agent';
4254
+ /**
4255
+ * Whether to use strict mode for tool calls. Only applicable when using certain
4256
+ * supported models.
4257
+ */
4258
+ tool_call_strict_mode?: boolean | null;
4259
+ }
4260
+ namespace RetellLlm {
4261
+ /**
4262
+ * Knowledge base configuration for RAG retrieval.
4263
+ */
4264
+ interface KBConfig {
4265
+ /**
4266
+ * Similarity threshold for filtering search results
4267
+ */
4268
+ filter_score?: number;
4269
+ /**
4270
+ * Max number of knowledge base chunks to retrieve
4271
+ */
4272
+ top_k?: number;
4273
+ }
4274
+ }
4275
+ }
4276
+ }
4277
+ export declare namespace Call {
4278
+ export { type CallResponse as CallResponse, type PhoneCallResponse as PhoneCallResponse, type WebCallResponse as WebCallResponse, type CallListResponse as CallListResponse, type CallUpdateParams as CallUpdateParams, type CallListParams as CallListParams, type CallCreatePhoneCallParams as CallCreatePhoneCallParams, type CallCreateWebCallParams as CallCreateWebCallParams, type CallRegisterPhoneCallParams as CallRegisterPhoneCallParams, };
4279
+ }
4280
+ //# sourceMappingURL=call.d.mts.map