@linqapp/sdk 0.1.0-alpha.1

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 (433) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/LICENSE +7 -0
  3. package/README.md +393 -0
  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 +193 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +193 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +479 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +475 -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 +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +30 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  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 +137 -0
  231. package/resource.d.mts +2 -0
  232. package/resource.d.mts.map +1 -0
  233. package/resource.d.ts +2 -0
  234. package/resource.d.ts.map +1 -0
  235. package/resource.js +6 -0
  236. package/resource.js.map +1 -0
  237. package/resource.mjs +2 -0
  238. package/resource.mjs.map +1 -0
  239. package/resources/attachments.d.mts +215 -0
  240. package/resources/attachments.d.mts.map +1 -0
  241. package/resources/attachments.d.ts +215 -0
  242. package/resources/attachments.d.ts.map +1 -0
  243. package/resources/attachments.js +102 -0
  244. package/resources/attachments.js.map +1 -0
  245. package/resources/attachments.mjs +98 -0
  246. package/resources/attachments.mjs.map +1 -0
  247. package/resources/chats/chats.d.mts +1040 -0
  248. package/resources/chats/chats.d.mts.map +1 -0
  249. package/resources/chats/chats.d.ts +1040 -0
  250. package/resources/chats/chats.d.ts.map +1 -0
  251. package/resources/chats/chats.js +182 -0
  252. package/resources/chats/chats.js.map +1 -0
  253. package/resources/chats/chats.mjs +177 -0
  254. package/resources/chats/chats.mjs.map +1 -0
  255. package/resources/chats/index.d.mts +5 -0
  256. package/resources/chats/index.d.mts.map +1 -0
  257. package/resources/chats/index.d.ts +5 -0
  258. package/resources/chats/index.d.ts.map +1 -0
  259. package/resources/chats/index.js +13 -0
  260. package/resources/chats/index.js.map +1 -0
  261. package/resources/chats/index.mjs +6 -0
  262. package/resources/chats/index.mjs.map +1 -0
  263. package/resources/chats/messages.d.mts +813 -0
  264. package/resources/chats/messages.d.mts.map +1 -0
  265. package/resources/chats/messages.d.ts +813 -0
  266. package/resources/chats/messages.d.ts.map +1 -0
  267. package/resources/chats/messages.js +56 -0
  268. package/resources/chats/messages.js.map +1 -0
  269. package/resources/chats/messages.mjs +52 -0
  270. package/resources/chats/messages.mjs.map +1 -0
  271. package/resources/chats/participants.d.mts +68 -0
  272. package/resources/chats/participants.d.mts.map +1 -0
  273. package/resources/chats/participants.d.ts +68 -0
  274. package/resources/chats/participants.d.ts.map +1 -0
  275. package/resources/chats/participants.js +51 -0
  276. package/resources/chats/participants.js.map +1 -0
  277. package/resources/chats/participants.mjs +47 -0
  278. package/resources/chats/participants.mjs.map +1 -0
  279. package/resources/chats/typing.d.mts +35 -0
  280. package/resources/chats/typing.d.mts.map +1 -0
  281. package/resources/chats/typing.d.ts +35 -0
  282. package/resources/chats/typing.d.ts.map +1 -0
  283. package/resources/chats/typing.js +50 -0
  284. package/resources/chats/typing.js.map +1 -0
  285. package/resources/chats/typing.mjs +46 -0
  286. package/resources/chats/typing.mjs.map +1 -0
  287. package/resources/chats.d.mts +2 -0
  288. package/resources/chats.d.mts.map +1 -0
  289. package/resources/chats.d.ts +2 -0
  290. package/resources/chats.d.ts.map +1 -0
  291. package/resources/chats.js +6 -0
  292. package/resources/chats.js.map +1 -0
  293. package/resources/chats.mjs +3 -0
  294. package/resources/chats.mjs.map +1 -0
  295. package/resources/index.d.mts +6 -0
  296. package/resources/index.d.mts.map +1 -0
  297. package/resources/index.d.ts +6 -0
  298. package/resources/index.d.ts.map +1 -0
  299. package/resources/index.js +15 -0
  300. package/resources/index.js.map +1 -0
  301. package/resources/index.mjs +7 -0
  302. package/resources/index.mjs.map +1 -0
  303. package/resources/messages.d.mts +761 -0
  304. package/resources/messages.d.mts.map +1 -0
  305. package/resources/messages.d.ts +761 -0
  306. package/resources/messages.d.ts.map +1 -0
  307. package/resources/messages.js +90 -0
  308. package/resources/messages.js.map +1 -0
  309. package/resources/messages.mjs +86 -0
  310. package/resources/messages.mjs.map +1 -0
  311. package/resources/phone-numbers.d.mts +58 -0
  312. package/resources/phone-numbers.d.mts.map +1 -0
  313. package/resources/phone-numbers.d.ts +58 -0
  314. package/resources/phone-numbers.d.ts.map +1 -0
  315. package/resources/phone-numbers.js +17 -0
  316. package/resources/phone-numbers.js.map +1 -0
  317. package/resources/phone-numbers.mjs +13 -0
  318. package/resources/phone-numbers.mjs.map +1 -0
  319. package/resources/webhooks/events.d.mts +30 -0
  320. package/resources/webhooks/events.d.mts.map +1 -0
  321. package/resources/webhooks/events.d.ts +30 -0
  322. package/resources/webhooks/events.d.ts.map +1 -0
  323. package/resources/webhooks/events.js +22 -0
  324. package/resources/webhooks/events.js.map +1 -0
  325. package/resources/webhooks/events.mjs +18 -0
  326. package/resources/webhooks/events.mjs.map +1 -0
  327. package/resources/webhooks/index.d.mts +4 -0
  328. package/resources/webhooks/index.d.mts.map +1 -0
  329. package/resources/webhooks/index.d.ts +4 -0
  330. package/resources/webhooks/index.d.ts.map +1 -0
  331. package/resources/webhooks/index.js +11 -0
  332. package/resources/webhooks/index.js.map +1 -0
  333. package/resources/webhooks/index.mjs +5 -0
  334. package/resources/webhooks/index.mjs.map +1 -0
  335. package/resources/webhooks/subscriptions.d.mts +237 -0
  336. package/resources/webhooks/subscriptions.d.mts.map +1 -0
  337. package/resources/webhooks/subscriptions.d.ts +237 -0
  338. package/resources/webhooks/subscriptions.d.ts.map +1 -0
  339. package/resources/webhooks/subscriptions.js +107 -0
  340. package/resources/webhooks/subscriptions.js.map +1 -0
  341. package/resources/webhooks/subscriptions.mjs +103 -0
  342. package/resources/webhooks/subscriptions.mjs.map +1 -0
  343. package/resources/webhooks/webhooks.d.mts +14 -0
  344. package/resources/webhooks/webhooks.d.mts.map +1 -0
  345. package/resources/webhooks/webhooks.d.ts +14 -0
  346. package/resources/webhooks/webhooks.d.ts.map +1 -0
  347. package/resources/webhooks/webhooks.js +21 -0
  348. package/resources/webhooks/webhooks.js.map +1 -0
  349. package/resources/webhooks/webhooks.mjs +16 -0
  350. package/resources/webhooks/webhooks.mjs.map +1 -0
  351. package/resources/webhooks.d.mts +2 -0
  352. package/resources/webhooks.d.mts.map +1 -0
  353. package/resources/webhooks.d.ts +2 -0
  354. package/resources/webhooks.d.ts.map +1 -0
  355. package/resources/webhooks.js +6 -0
  356. package/resources/webhooks.js.map +1 -0
  357. package/resources/webhooks.mjs +3 -0
  358. package/resources/webhooks.mjs.map +1 -0
  359. package/resources.d.mts +2 -0
  360. package/resources.d.mts.map +1 -0
  361. package/resources.d.ts +2 -0
  362. package/resources.d.ts.map +1 -0
  363. package/resources.js +5 -0
  364. package/resources.js.map +1 -0
  365. package/resources.mjs +2 -0
  366. package/resources.mjs.map +1 -0
  367. package/src/api-promise.ts +2 -0
  368. package/src/client.ts +801 -0
  369. package/src/core/README.md +3 -0
  370. package/src/core/api-promise.ts +92 -0
  371. package/src/core/error.ts +130 -0
  372. package/src/core/resource.ts +11 -0
  373. package/src/core/uploads.ts +2 -0
  374. package/src/error.ts +2 -0
  375. package/src/index.ts +22 -0
  376. package/src/internal/README.md +3 -0
  377. package/src/internal/builtin-types.ts +93 -0
  378. package/src/internal/detect-platform.ts +196 -0
  379. package/src/internal/errors.ts +33 -0
  380. package/src/internal/headers.ts +97 -0
  381. package/src/internal/parse.ts +56 -0
  382. package/src/internal/request-options.ts +91 -0
  383. package/src/internal/shim-types.ts +26 -0
  384. package/src/internal/shims.ts +107 -0
  385. package/src/internal/to-file.ts +154 -0
  386. package/src/internal/types.ts +95 -0
  387. package/src/internal/uploads.ts +187 -0
  388. package/src/internal/utils/base64.ts +40 -0
  389. package/src/internal/utils/bytes.ts +32 -0
  390. package/src/internal/utils/env.ts +18 -0
  391. package/src/internal/utils/log.ts +126 -0
  392. package/src/internal/utils/path.ts +88 -0
  393. package/src/internal/utils/sleep.ts +3 -0
  394. package/src/internal/utils/uuid.ts +17 -0
  395. package/src/internal/utils/values.ts +105 -0
  396. package/src/internal/utils.ts +8 -0
  397. package/src/lib/.keep +4 -0
  398. package/src/resource.ts +2 -0
  399. package/src/resources/attachments.ts +344 -0
  400. package/src/resources/chats/chats.ts +1285 -0
  401. package/src/resources/chats/index.ts +29 -0
  402. package/src/resources/chats/messages.ts +968 -0
  403. package/src/resources/chats/participants.ts +98 -0
  404. package/src/resources/chats/typing.ts +50 -0
  405. package/src/resources/chats.ts +3 -0
  406. package/src/resources/index.ts +31 -0
  407. package/src/resources/messages.ts +937 -0
  408. package/src/resources/phone-numbers.ts +72 -0
  409. package/src/resources/webhooks/events.ts +55 -0
  410. package/src/resources/webhooks/index.ts +13 -0
  411. package/src/resources/webhooks/subscriptions.ts +409 -0
  412. package/src/resources/webhooks/webhooks.ts +37 -0
  413. package/src/resources/webhooks.ts +3 -0
  414. package/src/resources.ts +1 -0
  415. package/src/tsconfig.json +11 -0
  416. package/src/uploads.ts +2 -0
  417. package/src/version.ts +1 -0
  418. package/uploads.d.mts +2 -0
  419. package/uploads.d.mts.map +1 -0
  420. package/uploads.d.ts +2 -0
  421. package/uploads.d.ts.map +1 -0
  422. package/uploads.js +6 -0
  423. package/uploads.js.map +1 -0
  424. package/uploads.mjs +2 -0
  425. package/uploads.mjs.map +1 -0
  426. package/version.d.mts +2 -0
  427. package/version.d.mts.map +1 -0
  428. package/version.d.ts +2 -0
  429. package/version.d.ts.map +1 -0
  430. package/version.js +5 -0
  431. package/version.js.map +1 -0
  432. package/version.mjs +2 -0
  433. package/version.mjs.map +1 -0
@@ -0,0 +1,1040 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as MessagesAPI from "./messages.js";
3
+ import { MessageListParams, MessageListResponse, MessageSendParams, MessageSendResponse, Messages } from "./messages.js";
4
+ import * as ParticipantsAPI from "./participants.js";
5
+ import { ParticipantAddParams, ParticipantAddResponse, ParticipantRemoveParams, ParticipantRemoveResponse, Participants } from "./participants.js";
6
+ import * as TypingAPI from "./typing.js";
7
+ import { Typing } from "./typing.js";
8
+ import { APIPromise } from "../../core/api-promise.js";
9
+ import { RequestOptions } from "../../internal/request-options.js";
10
+ export declare class Chats extends APIResource {
11
+ participants: ParticipantsAPI.Participants;
12
+ typing: TypingAPI.Typing;
13
+ messages: MessagesAPI.Messages;
14
+ /**
15
+ * Create a new chat with specified participants and send an initial message. The
16
+ * initial message is required when creating a chat.
17
+ *
18
+ * ## Message Effects
19
+ *
20
+ * You can add iMessage effects to make your messages more expressive. Effects are
21
+ * optional and can be either screen effects (full-screen animations) or bubble
22
+ * effects (message bubble animations).
23
+ *
24
+ * **Screen Effects:** `confetti`, `fireworks`, `lasers`, `sparkles`,
25
+ * `celebration`, `hearts`, `love`, `balloons`, `happy_birthday`, `echo`,
26
+ * `spotlight`
27
+ *
28
+ * **Bubble Effects:** `slam`, `loud`, `gentle`, `invisible`
29
+ *
30
+ * Only one effect type can be applied per message.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const chat = await client.chats.create({
35
+ * from: '+12052535597',
36
+ * message: {
37
+ * parts: [
38
+ * {
39
+ * type: 'text',
40
+ * value: 'Hello! How can I help you today?',
41
+ * },
42
+ * ],
43
+ * },
44
+ * to: ['+12052532136'],
45
+ * });
46
+ * ```
47
+ */
48
+ create(body: ChatCreateParams, options?: RequestOptions): APIPromise<ChatCreateResponse>;
49
+ /**
50
+ * Retrieve a chat by its unique identifier.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const chat = await client.chats.retrieve(
55
+ * '550e8400-e29b-41d4-a716-446655440000',
56
+ * );
57
+ * ```
58
+ */
59
+ retrieve(chatID: string, options?: RequestOptions): APIPromise<ChatRetrieveResponse>;
60
+ /**
61
+ * Update chat properties such as display name and group chat icon.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * const chat = await client.chats.update(
66
+ * '550e8400-e29b-41d4-a716-446655440000',
67
+ * { display_name: 'Team Discussion' },
68
+ * );
69
+ * ```
70
+ */
71
+ update(chatID: string, body: ChatUpdateParams, options?: RequestOptions): APIPromise<ChatUpdateResponse>;
72
+ /**
73
+ * Retrieves a paginated list of chats for the authenticated partner filtered by
74
+ * phone number. Returns all chats involving the specified phone number with their
75
+ * participants and recent activity.
76
+ *
77
+ * **Pagination:**
78
+ *
79
+ * - Use `limit` to control page size (default: 20, max: 100)
80
+ * - The response includes `next_cursor` for fetching the next page
81
+ * - When `next_cursor` is `null`, there are no more results to fetch
82
+ * - Pass the `next_cursor` value as the `cursor` parameter for the next request
83
+ *
84
+ * **Example pagination flow:**
85
+ *
86
+ * 1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`
87
+ * 2. Response includes `next_cursor: "20"` (more results exist)
88
+ * 3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`
89
+ * 4. Response includes `next_cursor: null` (no more results)
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * const chats = await client.chats.list({
94
+ * from: '+13343284472',
95
+ * });
96
+ * ```
97
+ */
98
+ list(query: ChatListParams, options?: RequestOptions): APIPromise<ChatListResponse>;
99
+ /**
100
+ * Mark all messages in a chat as read.
101
+ *
102
+ * @example
103
+ * ```ts
104
+ * await client.chats.markAsRead(
105
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
106
+ * );
107
+ * ```
108
+ */
109
+ markAsRead(chatID: string, options?: RequestOptions): APIPromise<void>;
110
+ /**
111
+ * Send an audio file as an **iMessage voice memo bubble** to all participants in a
112
+ * chat. Voice memos appear with iMessage's native inline playback UI, unlike
113
+ * regular audio attachments sent via media parts which appear as downloadable
114
+ * files.
115
+ *
116
+ * **Supported audio formats:**
117
+ *
118
+ * - MP3 (audio/mpeg)
119
+ * - M4A (audio/x-m4a, audio/mp4)
120
+ * - AAC (audio/aac)
121
+ * - CAF (audio/x-caf) - Core Audio Format
122
+ * - WAV (audio/wav)
123
+ * - AIFF (audio/aiff, audio/x-aiff)
124
+ * - AMR (audio/amr)
125
+ *
126
+ * @example
127
+ * ```ts
128
+ * const response = await client.chats.sendVoicememo(
129
+ * 'f19ee7b8-8533-4c5c-83ec-4ef8d6d1ddbd',
130
+ * {
131
+ * from: '+12052535597',
132
+ * voice_memo_url: 'https://example.com/voice-memo.m4a',
133
+ * },
134
+ * );
135
+ * ```
136
+ */
137
+ sendVoicememo(chatID: string, body: ChatSendVoicememoParams, options?: RequestOptions): APIPromise<ChatSendVoicememoResponse>;
138
+ /**
139
+ * Share your contact information (Name and Photo Sharing) with a chat.
140
+ *
141
+ * @example
142
+ * ```ts
143
+ * await client.chats.shareContactCard(
144
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
145
+ * );
146
+ * ```
147
+ */
148
+ shareContactCard(chatID: string, options?: RequestOptions): APIPromise<void>;
149
+ }
150
+ /**
151
+ * Response for creating a new chat with an initial message
152
+ */
153
+ export interface ChatCreateResponse {
154
+ chat: ChatCreateResponse.Chat;
155
+ }
156
+ export declare namespace ChatCreateResponse {
157
+ interface Chat {
158
+ /**
159
+ * Unique identifier for the created chat (UUID)
160
+ */
161
+ id: string;
162
+ /**
163
+ * Display name for the chat. Defaults to a comma-separated list of recipient
164
+ * handles. Can be updated for group chats.
165
+ */
166
+ display_name: string | null;
167
+ /**
168
+ * List of participants in the chat. Always contains at least two handles (your
169
+ * phone number and the other participant).
170
+ */
171
+ handles: Array<Chat.Handle>;
172
+ /**
173
+ * Whether this is a group chat
174
+ */
175
+ is_group: boolean;
176
+ /**
177
+ * A message that was sent (used in CreateChat and SendMessage responses)
178
+ */
179
+ message: Chat.Message;
180
+ /**
181
+ * Messaging service used
182
+ */
183
+ service: string;
184
+ }
185
+ namespace Chat {
186
+ interface Handle {
187
+ /**
188
+ * Unique identifier for this handle
189
+ */
190
+ id: string;
191
+ /**
192
+ * Phone number (E.164) or email address of the participant
193
+ */
194
+ handle: string;
195
+ /**
196
+ * When this participant joined the chat
197
+ */
198
+ joined_at: string;
199
+ /**
200
+ * Service type (iMessage, SMS, RCS, etc.)
201
+ */
202
+ service: 'iMessage' | 'SMS' | 'RCS';
203
+ /**
204
+ * Whether this handle belongs to the sender (your phone number)
205
+ */
206
+ is_me?: boolean | null;
207
+ /**
208
+ * When they left (if applicable)
209
+ */
210
+ left_at?: string | null;
211
+ /**
212
+ * Participant status
213
+ */
214
+ status?: 'active' | 'left' | 'removed' | null;
215
+ }
216
+ /**
217
+ * A message that was sent (used in CreateChat and SendMessage responses)
218
+ */
219
+ interface Message {
220
+ /**
221
+ * Message identifier (UUID)
222
+ */
223
+ id: string;
224
+ /**
225
+ * Current delivery status of a message
226
+ */
227
+ delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'failed';
228
+ /**
229
+ * Whether the message has been read
230
+ */
231
+ is_read: boolean;
232
+ /**
233
+ * Message parts in order (text and media)
234
+ */
235
+ parts: Array<Message.TextPartResponse | Message.MediaPartResponse>;
236
+ /**
237
+ * When the message was sent
238
+ */
239
+ sent_at: string;
240
+ /**
241
+ * When the message was delivered
242
+ */
243
+ delivered_at?: string | null;
244
+ /**
245
+ * iMessage effect applied to a message (screen or bubble effect)
246
+ */
247
+ effect?: Message.Effect | null;
248
+ /**
249
+ * The sender of this message as a full handle object
250
+ */
251
+ from_handle?: Message.FromHandle | null;
252
+ /**
253
+ * Preferred service for sending this message
254
+ */
255
+ preferred_service?: 'iMessage' | 'SMS' | 'RCS' | null;
256
+ /**
257
+ * Indicates this message is a threaded reply to another message
258
+ */
259
+ reply_to?: Message.ReplyTo | null;
260
+ /**
261
+ * Service used to send this message
262
+ */
263
+ service?: 'iMessage' | 'SMS' | 'RCS' | null;
264
+ }
265
+ namespace Message {
266
+ /**
267
+ * A text message part
268
+ */
269
+ interface TextPartResponse {
270
+ /**
271
+ * Reactions on this message part
272
+ */
273
+ reactions: Array<TextPartResponse.Reaction> | null;
274
+ /**
275
+ * Indicates this is a text message part
276
+ */
277
+ type: 'text';
278
+ /**
279
+ * The text content
280
+ */
281
+ value: string;
282
+ }
283
+ namespace TextPartResponse {
284
+ interface Reaction {
285
+ handle: Reaction.Handle;
286
+ /**
287
+ * Whether this reaction is from the current user
288
+ */
289
+ is_me: boolean;
290
+ /**
291
+ * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
292
+ * emphasize, question. Custom emoji reactions have type "custom" with the actual
293
+ * emoji in the custom_emoji field.
294
+ */
295
+ type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
296
+ /**
297
+ * Custom emoji if type is "custom", null otherwise
298
+ */
299
+ custom_emoji?: string | null;
300
+ }
301
+ namespace Reaction {
302
+ interface Handle {
303
+ /**
304
+ * Unique identifier for this handle
305
+ */
306
+ id: string;
307
+ /**
308
+ * Phone number (E.164) or email address of the participant
309
+ */
310
+ handle: string;
311
+ /**
312
+ * When this participant joined the chat
313
+ */
314
+ joined_at: string;
315
+ /**
316
+ * Service type (iMessage, SMS, RCS, etc.)
317
+ */
318
+ service: 'iMessage' | 'SMS' | 'RCS';
319
+ /**
320
+ * Whether this handle belongs to the sender (your phone number)
321
+ */
322
+ is_me?: boolean | null;
323
+ /**
324
+ * When they left (if applicable)
325
+ */
326
+ left_at?: string | null;
327
+ /**
328
+ * Participant status
329
+ */
330
+ status?: 'active' | 'left' | 'removed' | null;
331
+ }
332
+ }
333
+ }
334
+ /**
335
+ * A media attachment part
336
+ */
337
+ interface MediaPartResponse {
338
+ /**
339
+ * Unique attachment identifier
340
+ */
341
+ id: string;
342
+ /**
343
+ * Original filename
344
+ */
345
+ filename: string;
346
+ /**
347
+ * MIME type of the file
348
+ */
349
+ mime_type: string;
350
+ /**
351
+ * Reactions on this message part
352
+ */
353
+ reactions: Array<MediaPartResponse.Reaction> | null;
354
+ /**
355
+ * File size in bytes
356
+ */
357
+ size_bytes: number;
358
+ /**
359
+ * Indicates this is a media attachment part
360
+ */
361
+ type: 'media';
362
+ /**
363
+ * Presigned URL for downloading the attachment (expires in 1 hour).
364
+ */
365
+ url: string;
366
+ }
367
+ namespace MediaPartResponse {
368
+ interface Reaction {
369
+ handle: Reaction.Handle;
370
+ /**
371
+ * Whether this reaction is from the current user
372
+ */
373
+ is_me: boolean;
374
+ /**
375
+ * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
376
+ * emphasize, question. Custom emoji reactions have type "custom" with the actual
377
+ * emoji in the custom_emoji field.
378
+ */
379
+ type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
380
+ /**
381
+ * Custom emoji if type is "custom", null otherwise
382
+ */
383
+ custom_emoji?: string | null;
384
+ }
385
+ namespace Reaction {
386
+ interface Handle {
387
+ /**
388
+ * Unique identifier for this handle
389
+ */
390
+ id: string;
391
+ /**
392
+ * Phone number (E.164) or email address of the participant
393
+ */
394
+ handle: string;
395
+ /**
396
+ * When this participant joined the chat
397
+ */
398
+ joined_at: string;
399
+ /**
400
+ * Service type (iMessage, SMS, RCS, etc.)
401
+ */
402
+ service: 'iMessage' | 'SMS' | 'RCS';
403
+ /**
404
+ * Whether this handle belongs to the sender (your phone number)
405
+ */
406
+ is_me?: boolean | null;
407
+ /**
408
+ * When they left (if applicable)
409
+ */
410
+ left_at?: string | null;
411
+ /**
412
+ * Participant status
413
+ */
414
+ status?: 'active' | 'left' | 'removed' | null;
415
+ }
416
+ }
417
+ }
418
+ /**
419
+ * iMessage effect applied to a message (screen or bubble effect)
420
+ */
421
+ interface Effect {
422
+ /**
423
+ * Name of the effect. Common values:
424
+ *
425
+ * - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
426
+ * love, balloons, happy_birthday, echo, spotlight
427
+ * - Bubble effects: slam, loud, gentle, invisible
428
+ */
429
+ name?: string;
430
+ /**
431
+ * Type of effect
432
+ */
433
+ type?: 'screen' | 'bubble';
434
+ }
435
+ /**
436
+ * The sender of this message as a full handle object
437
+ */
438
+ interface FromHandle {
439
+ /**
440
+ * Unique identifier for this handle
441
+ */
442
+ id: string;
443
+ /**
444
+ * Phone number (E.164) or email address of the participant
445
+ */
446
+ handle: string;
447
+ /**
448
+ * When this participant joined the chat
449
+ */
450
+ joined_at: string;
451
+ /**
452
+ * Service type (iMessage, SMS, RCS, etc.)
453
+ */
454
+ service: 'iMessage' | 'SMS' | 'RCS';
455
+ /**
456
+ * Whether this handle belongs to the sender (your phone number)
457
+ */
458
+ is_me?: boolean | null;
459
+ /**
460
+ * When they left (if applicable)
461
+ */
462
+ left_at?: string | null;
463
+ /**
464
+ * Participant status
465
+ */
466
+ status?: 'active' | 'left' | 'removed' | null;
467
+ }
468
+ /**
469
+ * Indicates this message is a threaded reply to another message
470
+ */
471
+ interface ReplyTo {
472
+ /**
473
+ * The ID of the message to reply to
474
+ */
475
+ message_id: string;
476
+ /**
477
+ * The specific message part to reply to (0-based index). Defaults to 0 (first
478
+ * part) if not provided. Use this when replying to a specific part of a multipart
479
+ * message.
480
+ */
481
+ part_index?: number;
482
+ }
483
+ }
484
+ }
485
+ }
486
+ export interface ChatRetrieveResponse {
487
+ /**
488
+ * Unique identifier for the chat
489
+ */
490
+ id: string;
491
+ /**
492
+ * When the chat was created
493
+ */
494
+ created_at: string;
495
+ /**
496
+ * Display name for the chat. Defaults to a comma-separated list of recipient
497
+ * handles. Can be updated for group chats.
498
+ */
499
+ display_name: string | null;
500
+ /**
501
+ * List of chat participants with full handle details. Always contains at least two
502
+ * handles (your phone number and the other participant).
503
+ */
504
+ handles: Array<ChatRetrieveResponse.Handle>;
505
+ /**
506
+ * Whether the chat is archived
507
+ */
508
+ is_archived: boolean;
509
+ /**
510
+ * Whether this is a group chat
511
+ */
512
+ is_group: boolean;
513
+ /**
514
+ * When the chat was last updated
515
+ */
516
+ updated_at: string;
517
+ /**
518
+ * Service type for the chat
519
+ */
520
+ service?: 'iMessage' | 'SMS' | 'RCS' | null;
521
+ }
522
+ export declare namespace ChatRetrieveResponse {
523
+ interface Handle {
524
+ /**
525
+ * Unique identifier for this handle
526
+ */
527
+ id: string;
528
+ /**
529
+ * Phone number (E.164) or email address of the participant
530
+ */
531
+ handle: string;
532
+ /**
533
+ * When this participant joined the chat
534
+ */
535
+ joined_at: string;
536
+ /**
537
+ * Service type (iMessage, SMS, RCS, etc.)
538
+ */
539
+ service: 'iMessage' | 'SMS' | 'RCS';
540
+ /**
541
+ * Whether this handle belongs to the sender (your phone number)
542
+ */
543
+ is_me?: boolean | null;
544
+ /**
545
+ * When they left (if applicable)
546
+ */
547
+ left_at?: string | null;
548
+ /**
549
+ * Participant status
550
+ */
551
+ status?: 'active' | 'left' | 'removed' | null;
552
+ }
553
+ }
554
+ export interface ChatUpdateResponse {
555
+ /**
556
+ * Unique identifier for the chat
557
+ */
558
+ id: string;
559
+ /**
560
+ * When the chat was created
561
+ */
562
+ created_at: string;
563
+ /**
564
+ * Display name for the chat. Defaults to a comma-separated list of recipient
565
+ * handles. Can be updated for group chats.
566
+ */
567
+ display_name: string | null;
568
+ /**
569
+ * List of chat participants with full handle details. Always contains at least two
570
+ * handles (your phone number and the other participant).
571
+ */
572
+ handles: Array<ChatUpdateResponse.Handle>;
573
+ /**
574
+ * Whether the chat is archived
575
+ */
576
+ is_archived: boolean;
577
+ /**
578
+ * Whether this is a group chat
579
+ */
580
+ is_group: boolean;
581
+ /**
582
+ * When the chat was last updated
583
+ */
584
+ updated_at: string;
585
+ /**
586
+ * Service type for the chat
587
+ */
588
+ service?: 'iMessage' | 'SMS' | 'RCS' | null;
589
+ }
590
+ export declare namespace ChatUpdateResponse {
591
+ interface Handle {
592
+ /**
593
+ * Unique identifier for this handle
594
+ */
595
+ id: string;
596
+ /**
597
+ * Phone number (E.164) or email address of the participant
598
+ */
599
+ handle: string;
600
+ /**
601
+ * When this participant joined the chat
602
+ */
603
+ joined_at: string;
604
+ /**
605
+ * Service type (iMessage, SMS, RCS, etc.)
606
+ */
607
+ service: 'iMessage' | 'SMS' | 'RCS';
608
+ /**
609
+ * Whether this handle belongs to the sender (your phone number)
610
+ */
611
+ is_me?: boolean | null;
612
+ /**
613
+ * When they left (if applicable)
614
+ */
615
+ left_at?: string | null;
616
+ /**
617
+ * Participant status
618
+ */
619
+ status?: 'active' | 'left' | 'removed' | null;
620
+ }
621
+ }
622
+ export interface ChatListResponse {
623
+ /**
624
+ * List of chats
625
+ */
626
+ chats: Array<ChatListResponse.Chat>;
627
+ /**
628
+ * Cursor for fetching the next page of results. Null if there are no more results
629
+ * to fetch. Pass this value as the `cursor` parameter in the next request.
630
+ */
631
+ next_cursor?: string | null;
632
+ }
633
+ export declare namespace ChatListResponse {
634
+ interface Chat {
635
+ /**
636
+ * Unique identifier for the chat
637
+ */
638
+ id: string;
639
+ /**
640
+ * When the chat was created
641
+ */
642
+ created_at: string;
643
+ /**
644
+ * Display name for the chat. Defaults to a comma-separated list of recipient
645
+ * handles. Can be updated for group chats.
646
+ */
647
+ display_name: string | null;
648
+ /**
649
+ * List of chat participants with full handle details. Always contains at least two
650
+ * handles (your phone number and the other participant).
651
+ */
652
+ handles: Array<Chat.Handle>;
653
+ /**
654
+ * Whether the chat is archived
655
+ */
656
+ is_archived: boolean;
657
+ /**
658
+ * Whether this is a group chat
659
+ */
660
+ is_group: boolean;
661
+ /**
662
+ * When the chat was last updated
663
+ */
664
+ updated_at: string;
665
+ /**
666
+ * Service type for the chat
667
+ */
668
+ service?: 'iMessage' | 'SMS' | 'RCS' | null;
669
+ }
670
+ namespace Chat {
671
+ interface Handle {
672
+ /**
673
+ * Unique identifier for this handle
674
+ */
675
+ id: string;
676
+ /**
677
+ * Phone number (E.164) or email address of the participant
678
+ */
679
+ handle: string;
680
+ /**
681
+ * When this participant joined the chat
682
+ */
683
+ joined_at: string;
684
+ /**
685
+ * Service type (iMessage, SMS, RCS, etc.)
686
+ */
687
+ service: 'iMessage' | 'SMS' | 'RCS';
688
+ /**
689
+ * Whether this handle belongs to the sender (your phone number)
690
+ */
691
+ is_me?: boolean | null;
692
+ /**
693
+ * When they left (if applicable)
694
+ */
695
+ left_at?: string | null;
696
+ /**
697
+ * Participant status
698
+ */
699
+ status?: 'active' | 'left' | 'removed' | null;
700
+ }
701
+ }
702
+ }
703
+ /**
704
+ * Response for sending a voice memo to a chat
705
+ */
706
+ export interface ChatSendVoicememoResponse {
707
+ voice_memo: ChatSendVoicememoResponse.VoiceMemo;
708
+ }
709
+ export declare namespace ChatSendVoicememoResponse {
710
+ interface VoiceMemo {
711
+ /**
712
+ * Message identifier
713
+ */
714
+ id: string;
715
+ chat: VoiceMemo.Chat;
716
+ /**
717
+ * When the voice memo was created
718
+ */
719
+ created_at: string;
720
+ /**
721
+ * Sender phone number
722
+ */
723
+ from: string;
724
+ /**
725
+ * Current delivery status
726
+ */
727
+ status: string;
728
+ /**
729
+ * Recipient handles (phone numbers or email addresses)
730
+ */
731
+ to: Array<string>;
732
+ voice_memo: VoiceMemo.VoiceMemo;
733
+ /**
734
+ * Service used to send this voice memo
735
+ */
736
+ service?: 'iMessage' | 'SMS' | 'RCS' | null;
737
+ }
738
+ namespace VoiceMemo {
739
+ interface Chat {
740
+ /**
741
+ * Chat identifier
742
+ */
743
+ id: string;
744
+ /**
745
+ * Chat participants
746
+ */
747
+ handles: Array<Chat.Handle>;
748
+ /**
749
+ * Whether the chat is active
750
+ */
751
+ is_active: boolean;
752
+ /**
753
+ * Whether this is a group chat
754
+ */
755
+ is_group: boolean;
756
+ /**
757
+ * Messaging service
758
+ */
759
+ service: string;
760
+ }
761
+ namespace Chat {
762
+ interface Handle {
763
+ /**
764
+ * Unique identifier for this handle
765
+ */
766
+ id: string;
767
+ /**
768
+ * Phone number (E.164) or email address of the participant
769
+ */
770
+ handle: string;
771
+ /**
772
+ * When this participant joined the chat
773
+ */
774
+ joined_at: string;
775
+ /**
776
+ * Service type (iMessage, SMS, RCS, etc.)
777
+ */
778
+ service: 'iMessage' | 'SMS' | 'RCS';
779
+ /**
780
+ * Whether this handle belongs to the sender (your phone number)
781
+ */
782
+ is_me?: boolean | null;
783
+ /**
784
+ * When they left (if applicable)
785
+ */
786
+ left_at?: string | null;
787
+ /**
788
+ * Participant status
789
+ */
790
+ status?: 'active' | 'left' | 'removed' | null;
791
+ }
792
+ }
793
+ interface VoiceMemo {
794
+ /**
795
+ * Attachment identifier
796
+ */
797
+ id: string;
798
+ /**
799
+ * Original filename
800
+ */
801
+ filename: string;
802
+ /**
803
+ * Audio MIME type
804
+ */
805
+ mime_type: string;
806
+ /**
807
+ * File size in bytes
808
+ */
809
+ size_bytes: number;
810
+ /**
811
+ * CDN URL for downloading the voice memo
812
+ */
813
+ url: string;
814
+ /**
815
+ * Duration in milliseconds
816
+ */
817
+ duration_ms?: number | null;
818
+ }
819
+ }
820
+ }
821
+ export interface ChatCreateParams {
822
+ /**
823
+ * Sender phone number in E.164 format. Must be a phone number that the
824
+ * authenticated partner has permission to send from.
825
+ */
826
+ from: string;
827
+ /**
828
+ * Message content container. Groups all message-related fields together,
829
+ * separating the "what" (message content) from the "where" (routing fields like
830
+ * from/to).
831
+ */
832
+ message: ChatCreateParams.Message;
833
+ /**
834
+ * Array of recipient handles (phone numbers in E.164 format or email addresses).
835
+ * For individual chats, provide one recipient. For group chats, provide multiple.
836
+ */
837
+ to: Array<string>;
838
+ }
839
+ export declare namespace ChatCreateParams {
840
+ /**
841
+ * Message content container. Groups all message-related fields together,
842
+ * separating the "what" (message content) from the "where" (routing fields like
843
+ * from/to).
844
+ */
845
+ interface Message {
846
+ /**
847
+ * Array of message parts. Each part can be either text or media. Parts are
848
+ * displayed in order. Text and media can be mixed.
849
+ *
850
+ * **Supported Media:**
851
+ *
852
+ * - Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp
853
+ * - Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp
854
+ * - Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr
855
+ * - Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx,
856
+ * .pages, .numbers, .key, .epub, .zip, .html, .htm
857
+ * - Contact & Calendar: .vcf, .ics
858
+ *
859
+ * **Audio:**
860
+ *
861
+ * - Audio files (.m4a, .mp3, .aac, .caf, .wav, .aiff, .amr) are fully supported as
862
+ * media parts
863
+ * - To send audio as an **iMessage voice memo bubble** (inline playback UI), use
864
+ * the dedicated `/v3/chats/{chatId}/voicememo` endpoint instead
865
+ *
866
+ * **Validation Rule:** Consecutive text parts are not allowed. Text parts must be
867
+ * separated by media parts. For example, [text, text] is invalid, but [text,
868
+ * media, text] is valid.
869
+ */
870
+ parts: Array<Message.TextPart | Message.MediaPart>;
871
+ /**
872
+ * iMessage effect to apply to this message (screen or bubble effect)
873
+ */
874
+ effect?: Message.Effect;
875
+ /**
876
+ * Optional idempotency key for this message. Use this to prevent duplicate sends
877
+ * of the same message.
878
+ */
879
+ idempotency_key?: string;
880
+ /**
881
+ * Preferred messaging service to use for this message. If not specified, uses
882
+ * default fallback chain: iMessage → RCS → SMS.
883
+ *
884
+ * - iMessage: Enforces iMessage without fallback to RCS or SMS. Message fails if
885
+ * recipient doesn't support iMessage.
886
+ * - RCS: Enforces RCS or SMS (no iMessage). Uses RCS if recipient supports it,
887
+ * otherwise falls back to SMS.
888
+ * - SMS: Enforces SMS (no iMessage). Uses RCS if recipient supports it, otherwise
889
+ * falls back to SMS.
890
+ */
891
+ preferred_service?: 'iMessage' | 'RCS' | 'SMS';
892
+ /**
893
+ * Reply to another message to create a threaded conversation
894
+ */
895
+ reply_to?: Message.ReplyTo;
896
+ }
897
+ namespace Message {
898
+ interface TextPart {
899
+ /**
900
+ * Indicates this is a text message part
901
+ */
902
+ type: 'text';
903
+ /**
904
+ * The text content
905
+ */
906
+ value: string;
907
+ /**
908
+ * Optional idempotency key for this specific message part. Use this to prevent
909
+ * duplicate sends of the same part.
910
+ */
911
+ idempotency_key?: string;
912
+ }
913
+ interface MediaPart {
914
+ /**
915
+ * Indicates this is a media attachment part
916
+ */
917
+ type: 'media';
918
+ /**
919
+ * Reference to a file pre-uploaded via `POST /v3/attachments` (optional). The file
920
+ * is already stored, so sends using this ID skip the download step — useful when
921
+ * sending the same file to many recipients.
922
+ *
923
+ * Either `url` or `attachment_id` must be provided, but not both.
924
+ */
925
+ attachment_id?: string;
926
+ /**
927
+ * Optional idempotency key for this specific message part. Use this to prevent
928
+ * duplicate sends of the same part.
929
+ */
930
+ idempotency_key?: string;
931
+ /**
932
+ * Any publicly accessible HTTPS URL to the media file. The server downloads and
933
+ * sends the file automatically — no pre-upload step required.
934
+ *
935
+ * **Size limit:** 10MB maximum for URL-based downloads. For larger files (up to
936
+ * 100MB), use the pre-upload flow: `POST /v3/attachments` to get a presigned URL,
937
+ * upload directly, then reference by `attachment_id`.
938
+ *
939
+ * **Requirements:**
940
+ *
941
+ * - URL must use HTTPS
942
+ * - File content must be a supported format (the server validates the actual file
943
+ * content)
944
+ *
945
+ * **Supported formats:**
946
+ *
947
+ * - Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp
948
+ * - Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp
949
+ * - Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr
950
+ * - Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx,
951
+ * .pages, .numbers, .key, .epub, .zip, .html, .htm
952
+ * - Contact & Calendar: .vcf, .ics
953
+ *
954
+ * **Tip:** Audio sent here appears as a regular file attachment. To send audio as
955
+ * an iMessage voice memo bubble (with inline playback), use
956
+ * `/v3/chats/{chatId}/voicememo`. For repeated sends of the same file, use
957
+ * `attachment_id` to avoid redundant downloads.
958
+ *
959
+ * Either `url` or `attachment_id` must be provided, but not both.
960
+ */
961
+ url?: string;
962
+ }
963
+ /**
964
+ * iMessage effect to apply to this message (screen or bubble effect)
965
+ */
966
+ interface Effect {
967
+ /**
968
+ * Name of the effect. Common values:
969
+ *
970
+ * - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
971
+ * love, balloons, happy_birthday, echo, spotlight
972
+ * - Bubble effects: slam, loud, gentle, invisible
973
+ */
974
+ name?: string;
975
+ /**
976
+ * Type of effect
977
+ */
978
+ type?: 'screen' | 'bubble';
979
+ }
980
+ /**
981
+ * Reply to another message to create a threaded conversation
982
+ */
983
+ interface ReplyTo {
984
+ /**
985
+ * The ID of the message to reply to
986
+ */
987
+ message_id: string;
988
+ /**
989
+ * The specific message part to reply to (0-based index). Defaults to 0 (first
990
+ * part) if not provided. Use this when replying to a specific part of a multipart
991
+ * message.
992
+ */
993
+ part_index?: number;
994
+ }
995
+ }
996
+ }
997
+ export interface ChatUpdateParams {
998
+ /**
999
+ * New display name for the chat (group chats only)
1000
+ */
1001
+ display_name?: string;
1002
+ /**
1003
+ * URL of an image to set as the group chat icon (group chats only)
1004
+ */
1005
+ group_chat_icon?: string;
1006
+ }
1007
+ export interface ChatListParams {
1008
+ /**
1009
+ * Phone number to filter chats by. Returns all chats made from this phone number.
1010
+ * Must be in E.164 format (e.g., `+13343284472`). The `+` is automatically
1011
+ * URL-encoded by HTTP clients.
1012
+ */
1013
+ from: string;
1014
+ /**
1015
+ * Pagination cursor from the previous response's `next_cursor` field. Omit this
1016
+ * parameter for the first page of results.
1017
+ */
1018
+ cursor?: string;
1019
+ /**
1020
+ * Maximum number of chats to return per page
1021
+ */
1022
+ limit?: number;
1023
+ }
1024
+ export interface ChatSendVoicememoParams {
1025
+ /**
1026
+ * Sender phone number in E.164 format
1027
+ */
1028
+ from: string;
1029
+ /**
1030
+ * URL of the voice memo audio file. Must be a publicly accessible HTTPS URL.
1031
+ */
1032
+ voice_memo_url: string;
1033
+ }
1034
+ export declare namespace Chats {
1035
+ export { type ChatCreateResponse as ChatCreateResponse, type ChatRetrieveResponse as ChatRetrieveResponse, type ChatUpdateResponse as ChatUpdateResponse, type ChatListResponse as ChatListResponse, type ChatSendVoicememoResponse as ChatSendVoicememoResponse, type ChatCreateParams as ChatCreateParams, type ChatUpdateParams as ChatUpdateParams, type ChatListParams as ChatListParams, type ChatSendVoicememoParams as ChatSendVoicememoParams, };
1036
+ export { Participants as Participants, type ParticipantAddResponse as ParticipantAddResponse, type ParticipantRemoveResponse as ParticipantRemoveResponse, type ParticipantAddParams as ParticipantAddParams, type ParticipantRemoveParams as ParticipantRemoveParams, };
1037
+ export { Typing as Typing };
1038
+ export { Messages as Messages, type MessageListResponse as MessageListResponse, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
1039
+ }
1040
+ //# sourceMappingURL=chats.d.ts.map