@unlimited-messaging/sdk 0.1.18 → 0.1.20

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 (441) hide show
  1. package/package.json +1 -1
  2. package/src/api/index.d.ts +1 -0
  3. package/src/api/index.js +1 -0
  4. package/src/api/resources/accounts/client/Client.d.ts +68 -6
  5. package/src/api/resources/accounts/client/Client.js +272 -9
  6. package/src/api/resources/accounts/client/requests/AccountGetGroupRequest.d.ts +9 -0
  7. package/src/api/resources/accounts/client/requests/AccountGetGroupRequest.js +5 -0
  8. package/src/api/resources/accounts/client/requests/AccountLinkAccountRequest.d.ts +3 -0
  9. package/src/api/resources/accounts/client/requests/AccountListGroupsRequest.d.ts +9 -0
  10. package/src/api/resources/accounts/client/requests/AccountListGroupsRequest.js +5 -0
  11. package/src/api/resources/accounts/client/requests/AccountRequestHistoryRequest.d.ts +15 -0
  12. package/src/api/resources/accounts/client/requests/AccountRequestHistoryRequest.js +5 -0
  13. package/src/api/resources/accounts/client/requests/AccountUpdateAccountRequest.d.ts +10 -4
  14. package/src/api/resources/accounts/client/requests/index.d.ts +3 -0
  15. package/src/api/resources/accounts/types/AccountGetAccountResponse.d.ts +8 -0
  16. package/src/api/resources/accounts/types/AccountGetGroupResponse.d.ts +12 -0
  17. package/src/api/resources/accounts/types/AccountGetGroupResponse.js +5 -0
  18. package/src/api/resources/accounts/types/AccountGetGroupResponseMembersItem.d.ts +13 -0
  19. package/src/api/resources/accounts/types/AccountGetGroupResponseMembersItem.js +5 -0
  20. package/src/api/resources/accounts/types/AccountListAccountsResponseItem.d.ts +8 -0
  21. package/src/api/resources/accounts/types/AccountListGroupsResponse.d.ts +7 -0
  22. package/src/api/resources/accounts/types/AccountListGroupsResponse.js +5 -0
  23. package/src/api/resources/accounts/types/AccountListGroupsResponseDataItem.d.ts +9 -0
  24. package/src/api/resources/accounts/types/AccountListGroupsResponseDataItem.js +5 -0
  25. package/src/api/resources/accounts/types/AccountRequestHistoryResponse.d.ts +6 -0
  26. package/src/api/resources/accounts/types/AccountRequestHistoryResponse.js +5 -0
  27. package/src/api/resources/accounts/types/AccountUpdateAccountResponse.d.ts +8 -0
  28. package/src/api/resources/accounts/types/index.d.ts +5 -0
  29. package/src/api/resources/accounts/types/index.js +5 -0
  30. package/src/api/resources/messages/client/Client.d.ts +1 -1
  31. package/src/api/resources/messages/client/Client.js +1 -1
  32. package/src/api/resources/messages/client/requests/MessageSendRequest.d.ts +4 -0
  33. package/src/api/resources/messages/types/MessageFindAllResponseDataItem.d.ts +7 -0
  34. package/src/api/resources/messages/types/MessageFindOneResponse.d.ts +7 -0
  35. package/src/api/resources/messages/types/MessageSendRequestPriority.d.ts +11 -0
  36. package/src/api/resources/messages/types/MessageSendRequestPriority.js +10 -0
  37. package/src/api/resources/messages/types/MessageSendResponse.d.ts +7 -0
  38. package/src/api/resources/messages/types/index.d.ts +1 -0
  39. package/src/api/resources/messages/types/index.js +1 -0
  40. package/src/api/resources/webhooks/client/Client.d.ts +138 -3
  41. package/src/api/resources/webhooks/client/Client.js +138 -3
  42. package/src/api/resources/webhooks/client/requests/WebhookEndpointCreateRequest.d.ts +1 -0
  43. package/src/api/resources/webhooks/client/requests/WebhookEndpointUpdateRequest.d.ts +1 -0
  44. package/src/api/resources/webhooks/types/WebhookEndpointCreateRequestEventTypesItem.d.ts +9 -1
  45. package/src/api/resources/webhooks/types/WebhookEndpointCreateRequestEventTypesItem.js +8 -0
  46. package/src/api/resources/webhooks/types/WebhookEndpointCreateResponse.d.ts +1 -0
  47. package/src/api/resources/webhooks/types/WebhookEndpointCreateResponseEventTypesItem.d.ts +9 -1
  48. package/src/api/resources/webhooks/types/WebhookEndpointCreateResponseEventTypesItem.js +8 -0
  49. package/src/api/resources/webhooks/types/WebhookEndpointFindOneResponse.d.ts +1 -0
  50. package/src/api/resources/webhooks/types/WebhookEndpointFindOneResponseEventTypesItem.d.ts +9 -1
  51. package/src/api/resources/webhooks/types/WebhookEndpointFindOneResponseEventTypesItem.js +8 -0
  52. package/src/api/resources/webhooks/types/WebhookEndpointListResponseDataItem.d.ts +1 -0
  53. package/src/api/resources/webhooks/types/WebhookEndpointListResponseDataItemEventTypesItem.d.ts +9 -1
  54. package/src/api/resources/webhooks/types/WebhookEndpointListResponseDataItemEventTypesItem.js +8 -0
  55. package/src/api/resources/webhooks/types/WebhookEndpointUpdateRequestEventTypesItem.d.ts +9 -1
  56. package/src/api/resources/webhooks/types/WebhookEndpointUpdateRequestEventTypesItem.js +8 -0
  57. package/src/api/resources/webhooks/types/WebhookEndpointUpdateResponse.d.ts +1 -0
  58. package/src/api/resources/webhooks/types/WebhookEndpointUpdateResponseEventTypesItem.d.ts +9 -1
  59. package/src/api/resources/webhooks/types/WebhookEndpointUpdateResponseEventTypesItem.js +8 -0
  60. package/src/api/types/WebhookEventAccountStatusChanged.d.ts +10 -0
  61. package/src/api/types/WebhookEventAccountStatusChanged.js +5 -0
  62. package/src/api/types/WebhookEventAccountStatusChangedData.d.ts +7 -0
  63. package/src/api/types/WebhookEventAccountStatusChangedData.js +5 -0
  64. package/src/api/types/WebhookEventAccountStatusChangedDataAccount.d.ts +14 -0
  65. package/src/api/types/WebhookEventAccountStatusChangedDataAccount.js +5 -0
  66. package/src/api/types/WebhookEventAccountStatusChangedDataAccountPreviousStatus.d.ts +12 -0
  67. package/src/api/types/WebhookEventAccountStatusChangedDataAccountPreviousStatus.js +14 -0
  68. package/src/api/types/WebhookEventAccountStatusChangedDataAccountStatus.d.ts +12 -0
  69. package/src/api/types/WebhookEventAccountStatusChangedDataAccountStatus.js +14 -0
  70. package/src/api/types/WebhookEventAccountStatusChangedType.d.ts +7 -0
  71. package/src/api/types/WebhookEventAccountStatusChangedType.js +9 -0
  72. package/src/api/types/WebhookEventGroupUpdated.d.ts +10 -0
  73. package/src/api/types/WebhookEventGroupUpdated.js +5 -0
  74. package/src/api/types/WebhookEventGroupUpdatedData.d.ts +16 -0
  75. package/src/api/types/WebhookEventGroupUpdatedData.js +5 -0
  76. package/src/api/types/WebhookEventGroupUpdatedDataChannel.d.ts +8 -0
  77. package/src/api/types/WebhookEventGroupUpdatedDataChannel.js +5 -0
  78. package/src/api/types/WebhookEventGroupUpdatedDataChannelAccount.d.ts +7 -0
  79. package/src/api/types/WebhookEventGroupUpdatedDataChannelAccount.js +5 -0
  80. package/src/api/types/WebhookEventGroupUpdatedDataChannelType.d.ts +9 -0
  81. package/src/api/types/WebhookEventGroupUpdatedDataChannelType.js +11 -0
  82. package/src/api/types/WebhookEventGroupUpdatedDataGroup.d.ts +6 -0
  83. package/src/api/types/WebhookEventGroupUpdatedDataGroup.js +5 -0
  84. package/src/api/types/WebhookEventGroupUpdatedType.d.ts +7 -0
  85. package/src/api/types/WebhookEventGroupUpdatedType.js +9 -0
  86. package/src/api/types/WebhookEventMessageDeleted.d.ts +10 -0
  87. package/src/api/types/WebhookEventMessageDeleted.js +5 -0
  88. package/src/api/types/WebhookEventMessageDeletedData.d.ts +8 -0
  89. package/src/api/types/WebhookEventMessageDeletedData.js +5 -0
  90. package/src/api/types/WebhookEventMessageDeletedDataChannel.d.ts +9 -0
  91. package/src/api/types/WebhookEventMessageDeletedDataChannel.js +5 -0
  92. package/src/api/types/WebhookEventMessageDeletedDataChannelAccount.d.ts +7 -0
  93. package/src/api/types/WebhookEventMessageDeletedDataChannelAccount.js +5 -0
  94. package/src/api/types/WebhookEventMessageDeletedDataChannelConversation.d.ts +9 -0
  95. package/src/api/types/WebhookEventMessageDeletedDataChannelConversation.js +5 -0
  96. package/src/api/types/WebhookEventMessageDeletedDataChannelType.d.ts +9 -0
  97. package/src/api/types/WebhookEventMessageDeletedDataChannelType.js +11 -0
  98. package/src/api/types/WebhookEventMessageDeletedDataDeletion.d.ts +12 -0
  99. package/src/api/types/WebhookEventMessageDeletedDataDeletion.js +5 -0
  100. package/src/api/types/WebhookEventMessageDeletedType.d.ts +7 -0
  101. package/src/api/types/WebhookEventMessageDeletedType.js +9 -0
  102. package/src/api/types/WebhookEventMessageEdited.d.ts +10 -0
  103. package/src/api/types/WebhookEventMessageEdited.js +5 -0
  104. package/src/api/types/WebhookEventMessageEditedData.d.ts +8 -0
  105. package/src/api/types/WebhookEventMessageEditedData.js +5 -0
  106. package/src/api/types/WebhookEventMessageEditedDataChannel.d.ts +9 -0
  107. package/src/api/types/WebhookEventMessageEditedDataChannel.js +5 -0
  108. package/src/api/types/WebhookEventMessageEditedDataChannelAccount.d.ts +7 -0
  109. package/src/api/types/WebhookEventMessageEditedDataChannelAccount.js +5 -0
  110. package/src/api/types/WebhookEventMessageEditedDataChannelConversation.d.ts +9 -0
  111. package/src/api/types/WebhookEventMessageEditedDataChannelConversation.js +5 -0
  112. package/src/api/types/WebhookEventMessageEditedDataChannelType.d.ts +9 -0
  113. package/src/api/types/WebhookEventMessageEditedDataChannelType.js +11 -0
  114. package/src/api/types/WebhookEventMessageEditedDataEdit.d.ts +16 -0
  115. package/src/api/types/WebhookEventMessageEditedDataEdit.js +5 -0
  116. package/src/api/types/WebhookEventMessageEditedDataEditError.d.ts +8 -0
  117. package/src/api/types/WebhookEventMessageEditedDataEditError.js +10 -0
  118. package/src/api/types/WebhookEventMessageEditedDataEditKind.d.ts +8 -0
  119. package/src/api/types/WebhookEventMessageEditedDataEditKind.js +10 -0
  120. package/src/api/types/WebhookEventMessageEditedType.d.ts +7 -0
  121. package/src/api/types/WebhookEventMessageEditedType.js +9 -0
  122. package/src/api/types/WebhookEventMessageHistory.d.ts +10 -0
  123. package/src/api/types/WebhookEventMessageHistory.js +5 -0
  124. package/src/api/types/WebhookEventMessageHistoryData.d.ts +12 -0
  125. package/src/api/types/WebhookEventMessageHistoryData.js +5 -0
  126. package/src/api/types/WebhookEventMessageHistoryDataChannel.d.ts +8 -0
  127. package/src/api/types/WebhookEventMessageHistoryDataChannel.js +5 -0
  128. package/src/api/types/WebhookEventMessageHistoryDataChannelAccount.d.ts +7 -0
  129. package/src/api/types/WebhookEventMessageHistoryDataChannelAccount.js +5 -0
  130. package/src/api/types/WebhookEventMessageHistoryDataChannelType.d.ts +9 -0
  131. package/src/api/types/WebhookEventMessageHistoryDataChannelType.js +11 -0
  132. package/src/api/types/WebhookEventMessageHistoryDataMessagesItem.d.ts +27 -0
  133. package/src/api/types/WebhookEventMessageHistoryDataMessagesItem.js +5 -0
  134. package/src/api/types/WebhookEventMessageHistoryDataMessagesItemConversation.d.ts +9 -0
  135. package/src/api/types/WebhookEventMessageHistoryDataMessagesItemConversation.js +5 -0
  136. package/src/api/types/WebhookEventMessageHistoryDataMessagesItemDirection.d.ts +8 -0
  137. package/src/api/types/WebhookEventMessageHistoryDataMessagesItemDirection.js +10 -0
  138. package/src/api/types/WebhookEventMessageHistoryDataMessagesItemReplyTo.d.ts +7 -0
  139. package/src/api/types/WebhookEventMessageHistoryDataMessagesItemReplyTo.js +5 -0
  140. package/src/api/types/WebhookEventMessageHistoryType.d.ts +7 -0
  141. package/src/api/types/WebhookEventMessageHistoryType.js +9 -0
  142. package/src/api/types/WebhookEventMessageReaction.d.ts +10 -0
  143. package/src/api/types/WebhookEventMessageReaction.js +5 -0
  144. package/src/api/types/WebhookEventMessageReactionData.d.ts +8 -0
  145. package/src/api/types/WebhookEventMessageReactionData.js +5 -0
  146. package/src/api/types/WebhookEventMessageReactionDataChannel.d.ts +9 -0
  147. package/src/api/types/WebhookEventMessageReactionDataChannel.js +5 -0
  148. package/src/api/types/WebhookEventMessageReactionDataChannelAccount.d.ts +7 -0
  149. package/src/api/types/WebhookEventMessageReactionDataChannelAccount.js +5 -0
  150. package/src/api/types/WebhookEventMessageReactionDataChannelConversation.d.ts +9 -0
  151. package/src/api/types/WebhookEventMessageReactionDataChannelConversation.js +5 -0
  152. package/src/api/types/WebhookEventMessageReactionDataChannelType.d.ts +9 -0
  153. package/src/api/types/WebhookEventMessageReactionDataChannelType.js +11 -0
  154. package/src/api/types/WebhookEventMessageReactionDataReaction.d.ts +15 -0
  155. package/src/api/types/WebhookEventMessageReactionDataReaction.js +5 -0
  156. package/src/api/types/WebhookEventMessageReactionType.d.ts +7 -0
  157. package/src/api/types/WebhookEventMessageReactionType.js +9 -0
  158. package/src/api/types/WebhookEventMessageReceived.d.ts +10 -0
  159. package/src/api/types/WebhookEventMessageReceived.js +5 -0
  160. package/src/api/types/WebhookEventMessageReceivedData.d.ts +8 -0
  161. package/src/api/types/WebhookEventMessageReceivedData.js +5 -0
  162. package/src/api/types/WebhookEventMessageReceivedDataChannel.d.ts +9 -0
  163. package/src/api/types/WebhookEventMessageReceivedDataChannel.js +5 -0
  164. package/src/api/types/WebhookEventMessageReceivedDataChannelAccount.d.ts +7 -0
  165. package/src/api/types/WebhookEventMessageReceivedDataChannelAccount.js +5 -0
  166. package/src/api/types/WebhookEventMessageReceivedDataChannelConversation.d.ts +9 -0
  167. package/src/api/types/WebhookEventMessageReceivedDataChannelConversation.js +5 -0
  168. package/src/api/types/WebhookEventMessageReceivedDataChannelType.d.ts +9 -0
  169. package/src/api/types/WebhookEventMessageReceivedDataChannelType.js +11 -0
  170. package/src/api/types/WebhookEventMessageReceivedDataMessage.d.ts +26 -0
  171. package/src/api/types/WebhookEventMessageReceivedDataMessage.js +5 -0
  172. package/src/api/types/WebhookEventMessageReceivedDataMessageDirection.d.ts +8 -0
  173. package/src/api/types/WebhookEventMessageReceivedDataMessageDirection.js +10 -0
  174. package/src/api/types/WebhookEventMessageReceivedDataMessageReplyTo.d.ts +7 -0
  175. package/src/api/types/WebhookEventMessageReceivedDataMessageReplyTo.js +5 -0
  176. package/src/api/types/WebhookEventMessageReceivedType.d.ts +7 -0
  177. package/src/api/types/WebhookEventMessageReceivedType.js +9 -0
  178. package/src/api/types/WebhookEventMessageSelfSent.d.ts +10 -0
  179. package/src/api/types/WebhookEventMessageSelfSent.js +5 -0
  180. package/src/api/types/WebhookEventMessageSelfSentData.d.ts +8 -0
  181. package/src/api/types/WebhookEventMessageSelfSentData.js +5 -0
  182. package/src/api/types/WebhookEventMessageSelfSentDataChannel.d.ts +9 -0
  183. package/src/api/types/WebhookEventMessageSelfSentDataChannel.js +5 -0
  184. package/src/api/types/WebhookEventMessageSelfSentDataChannelAccount.d.ts +7 -0
  185. package/src/api/types/WebhookEventMessageSelfSentDataChannelAccount.js +5 -0
  186. package/src/api/types/WebhookEventMessageSelfSentDataChannelConversation.d.ts +9 -0
  187. package/src/api/types/WebhookEventMessageSelfSentDataChannelConversation.js +5 -0
  188. package/src/api/types/WebhookEventMessageSelfSentDataChannelType.d.ts +9 -0
  189. package/src/api/types/WebhookEventMessageSelfSentDataChannelType.js +11 -0
  190. package/src/api/types/WebhookEventMessageSelfSentDataMessage.d.ts +26 -0
  191. package/src/api/types/WebhookEventMessageSelfSentDataMessage.js +5 -0
  192. package/src/api/types/WebhookEventMessageSelfSentDataMessageDirection.d.ts +8 -0
  193. package/src/api/types/WebhookEventMessageSelfSentDataMessageDirection.js +10 -0
  194. package/src/api/types/WebhookEventMessageSelfSentDataMessageReplyTo.d.ts +7 -0
  195. package/src/api/types/WebhookEventMessageSelfSentDataMessageReplyTo.js +5 -0
  196. package/src/api/types/WebhookEventMessageSelfSentType.d.ts +7 -0
  197. package/src/api/types/WebhookEventMessageSelfSentType.js +9 -0
  198. package/src/api/types/WebhookEventMessageStatus.d.ts +10 -0
  199. package/src/api/types/WebhookEventMessageStatus.js +5 -0
  200. package/src/api/types/WebhookEventMessageStatusData.d.ts +8 -0
  201. package/src/api/types/WebhookEventMessageStatusData.js +5 -0
  202. package/src/api/types/WebhookEventMessageStatusDataChannel.d.ts +9 -0
  203. package/src/api/types/WebhookEventMessageStatusDataChannel.js +5 -0
  204. package/src/api/types/WebhookEventMessageStatusDataChannelAccount.d.ts +7 -0
  205. package/src/api/types/WebhookEventMessageStatusDataChannelAccount.js +5 -0
  206. package/src/api/types/WebhookEventMessageStatusDataChannelConversation.d.ts +9 -0
  207. package/src/api/types/WebhookEventMessageStatusDataChannelConversation.js +5 -0
  208. package/src/api/types/WebhookEventMessageStatusDataChannelType.d.ts +9 -0
  209. package/src/api/types/WebhookEventMessageStatusDataChannelType.js +11 -0
  210. package/src/api/types/WebhookEventMessageStatusDataMessage.d.ts +13 -0
  211. package/src/api/types/WebhookEventMessageStatusDataMessage.js +5 -0
  212. package/src/api/types/WebhookEventMessageStatusDataMessagePreviousStatus.d.ts +13 -0
  213. package/src/api/types/WebhookEventMessageStatusDataMessagePreviousStatus.js +15 -0
  214. package/src/api/types/WebhookEventMessageStatusDataMessageStatus.d.ts +13 -0
  215. package/src/api/types/WebhookEventMessageStatusDataMessageStatus.js +15 -0
  216. package/src/api/types/WebhookEventMessageStatusType.d.ts +7 -0
  217. package/src/api/types/WebhookEventMessageStatusType.js +9 -0
  218. package/src/api/types/index.d.ts +79 -0
  219. package/src/api/types/index.js +95 -0
  220. package/src/serialization/index.d.ts +1 -0
  221. package/src/serialization/index.js +1 -0
  222. package/src/serialization/resources/accounts/client/requests/AccountRequestHistoryRequest.d.ts +13 -0
  223. package/src/serialization/resources/accounts/client/requests/AccountRequestHistoryRequest.js +44 -0
  224. package/src/serialization/resources/accounts/client/requests/AccountUpdateAccountRequest.d.ts +5 -1
  225. package/src/serialization/resources/accounts/client/requests/AccountUpdateAccountRequest.js +5 -1
  226. package/src/serialization/resources/accounts/client/requests/index.d.ts +1 -0
  227. package/src/serialization/resources/accounts/client/requests/index.js +3 -1
  228. package/src/serialization/resources/accounts/types/AccountGetAccountResponse.d.ts +4 -0
  229. package/src/serialization/resources/accounts/types/AccountGetAccountResponse.js +4 -0
  230. package/src/serialization/resources/accounts/types/AccountGetGroupResponse.d.ts +17 -0
  231. package/src/serialization/resources/accounts/types/AccountGetGroupResponse.js +48 -0
  232. package/src/serialization/resources/accounts/types/AccountGetGroupResponseMembersItem.d.ts +17 -0
  233. package/src/serialization/resources/accounts/types/AccountGetGroupResponseMembersItem.js +48 -0
  234. package/src/serialization/resources/accounts/types/AccountListAccountsResponseItem.d.ts +4 -0
  235. package/src/serialization/resources/accounts/types/AccountListAccountsResponseItem.js +4 -0
  236. package/src/serialization/resources/accounts/types/AccountListGroupsResponse.d.ts +13 -0
  237. package/src/serialization/resources/accounts/types/AccountListGroupsResponse.js +44 -0
  238. package/src/serialization/resources/accounts/types/AccountListGroupsResponseDataItem.d.ts +14 -0
  239. package/src/serialization/resources/accounts/types/AccountListGroupsResponseDataItem.js +45 -0
  240. package/src/serialization/resources/accounts/types/AccountRequestHistoryResponse.d.ts +12 -0
  241. package/src/serialization/resources/accounts/types/AccountRequestHistoryResponse.js +43 -0
  242. package/src/serialization/resources/accounts/types/AccountUpdateAccountResponse.d.ts +4 -0
  243. package/src/serialization/resources/accounts/types/AccountUpdateAccountResponse.js +4 -0
  244. package/src/serialization/resources/accounts/types/index.d.ts +5 -0
  245. package/src/serialization/resources/accounts/types/index.js +5 -0
  246. package/src/serialization/resources/messages/client/requests/MessageSendRequest.d.ts +3 -0
  247. package/src/serialization/resources/messages/client/requests/MessageSendRequest.js +3 -0
  248. package/src/serialization/resources/messages/types/MessageFindAllResponseDataItem.d.ts +3 -0
  249. package/src/serialization/resources/messages/types/MessageFindAllResponseDataItem.js +3 -0
  250. package/src/serialization/resources/messages/types/MessageFindOneResponse.d.ts +3 -0
  251. package/src/serialization/resources/messages/types/MessageFindOneResponse.js +3 -0
  252. package/src/serialization/resources/messages/types/MessageSendRequestPriority.d.ts +10 -0
  253. package/src/serialization/resources/messages/types/MessageSendRequestPriority.js +41 -0
  254. package/src/serialization/resources/messages/types/MessageSendResponse.d.ts +3 -0
  255. package/src/serialization/resources/messages/types/MessageSendResponse.js +3 -0
  256. package/src/serialization/resources/messages/types/index.d.ts +1 -0
  257. package/src/serialization/resources/messages/types/index.js +1 -0
  258. package/src/serialization/resources/webhooks/client/requests/WebhookEndpointCreateRequest.d.ts +1 -0
  259. package/src/serialization/resources/webhooks/client/requests/WebhookEndpointCreateRequest.js +1 -0
  260. package/src/serialization/resources/webhooks/client/requests/WebhookEndpointUpdateRequest.d.ts +1 -0
  261. package/src/serialization/resources/webhooks/client/requests/WebhookEndpointUpdateRequest.js +1 -0
  262. package/src/serialization/resources/webhooks/types/WebhookEndpointCreateRequestEventTypesItem.d.ts +1 -1
  263. package/src/serialization/resources/webhooks/types/WebhookEndpointCreateRequestEventTypesItem.js +11 -1
  264. package/src/serialization/resources/webhooks/types/WebhookEndpointCreateResponse.d.ts +1 -0
  265. package/src/serialization/resources/webhooks/types/WebhookEndpointCreateResponse.js +1 -0
  266. package/src/serialization/resources/webhooks/types/WebhookEndpointCreateResponseEventTypesItem.d.ts +1 -1
  267. package/src/serialization/resources/webhooks/types/WebhookEndpointCreateResponseEventTypesItem.js +11 -1
  268. package/src/serialization/resources/webhooks/types/WebhookEndpointFindOneResponse.d.ts +1 -0
  269. package/src/serialization/resources/webhooks/types/WebhookEndpointFindOneResponse.js +1 -0
  270. package/src/serialization/resources/webhooks/types/WebhookEndpointFindOneResponseEventTypesItem.d.ts +1 -1
  271. package/src/serialization/resources/webhooks/types/WebhookEndpointFindOneResponseEventTypesItem.js +11 -1
  272. package/src/serialization/resources/webhooks/types/WebhookEndpointListResponseDataItem.d.ts +1 -0
  273. package/src/serialization/resources/webhooks/types/WebhookEndpointListResponseDataItem.js +1 -0
  274. package/src/serialization/resources/webhooks/types/WebhookEndpointListResponseDataItemEventTypesItem.d.ts +1 -1
  275. package/src/serialization/resources/webhooks/types/WebhookEndpointListResponseDataItemEventTypesItem.js +11 -1
  276. package/src/serialization/resources/webhooks/types/WebhookEndpointUpdateRequestEventTypesItem.d.ts +1 -1
  277. package/src/serialization/resources/webhooks/types/WebhookEndpointUpdateRequestEventTypesItem.js +11 -1
  278. package/src/serialization/resources/webhooks/types/WebhookEndpointUpdateResponse.d.ts +1 -0
  279. package/src/serialization/resources/webhooks/types/WebhookEndpointUpdateResponse.js +1 -0
  280. package/src/serialization/resources/webhooks/types/WebhookEndpointUpdateResponseEventTypesItem.d.ts +1 -1
  281. package/src/serialization/resources/webhooks/types/WebhookEndpointUpdateResponseEventTypesItem.js +11 -1
  282. package/src/serialization/types/WebhookEventAccountStatusChanged.d.ts +17 -0
  283. package/src/serialization/types/WebhookEventAccountStatusChanged.js +48 -0
  284. package/src/serialization/types/WebhookEventAccountStatusChangedData.d.ts +13 -0
  285. package/src/serialization/types/WebhookEventAccountStatusChangedData.js +44 -0
  286. package/src/serialization/types/WebhookEventAccountStatusChangedDataAccount.d.ts +21 -0
  287. package/src/serialization/types/WebhookEventAccountStatusChangedDataAccount.js +52 -0
  288. package/src/serialization/types/WebhookEventAccountStatusChangedDataAccountPreviousStatus.d.ts +10 -0
  289. package/src/serialization/types/WebhookEventAccountStatusChangedDataAccountPreviousStatus.js +41 -0
  290. package/src/serialization/types/WebhookEventAccountStatusChangedDataAccountStatus.d.ts +10 -0
  291. package/src/serialization/types/WebhookEventAccountStatusChangedDataAccountStatus.js +41 -0
  292. package/src/serialization/types/WebhookEventAccountStatusChangedType.d.ts +10 -0
  293. package/src/serialization/types/WebhookEventAccountStatusChangedType.js +41 -0
  294. package/src/serialization/types/WebhookEventGroupUpdated.d.ts +17 -0
  295. package/src/serialization/types/WebhookEventGroupUpdated.js +48 -0
  296. package/src/serialization/types/WebhookEventGroupUpdatedData.d.ts +23 -0
  297. package/src/serialization/types/WebhookEventGroupUpdatedData.js +54 -0
  298. package/src/serialization/types/WebhookEventGroupUpdatedDataChannel.d.ts +15 -0
  299. package/src/serialization/types/WebhookEventGroupUpdatedDataChannel.js +46 -0
  300. package/src/serialization/types/WebhookEventGroupUpdatedDataChannelAccount.d.ts +13 -0
  301. package/src/serialization/types/WebhookEventGroupUpdatedDataChannelAccount.js +44 -0
  302. package/src/serialization/types/WebhookEventGroupUpdatedDataChannelType.d.ts +10 -0
  303. package/src/serialization/types/WebhookEventGroupUpdatedDataChannelType.js +41 -0
  304. package/src/serialization/types/WebhookEventGroupUpdatedDataGroup.d.ts +12 -0
  305. package/src/serialization/types/WebhookEventGroupUpdatedDataGroup.js +43 -0
  306. package/src/serialization/types/WebhookEventGroupUpdatedType.d.ts +10 -0
  307. package/src/serialization/types/WebhookEventGroupUpdatedType.js +41 -0
  308. package/src/serialization/types/WebhookEventMessageDeleted.d.ts +17 -0
  309. package/src/serialization/types/WebhookEventMessageDeleted.js +48 -0
  310. package/src/serialization/types/WebhookEventMessageDeletedData.d.ts +15 -0
  311. package/src/serialization/types/WebhookEventMessageDeletedData.js +46 -0
  312. package/src/serialization/types/WebhookEventMessageDeletedDataChannel.d.ts +17 -0
  313. package/src/serialization/types/WebhookEventMessageDeletedDataChannel.js +48 -0
  314. package/src/serialization/types/WebhookEventMessageDeletedDataChannelAccount.d.ts +13 -0
  315. package/src/serialization/types/WebhookEventMessageDeletedDataChannelAccount.js +44 -0
  316. package/src/serialization/types/WebhookEventMessageDeletedDataChannelConversation.d.ts +15 -0
  317. package/src/serialization/types/WebhookEventMessageDeletedDataChannelConversation.js +46 -0
  318. package/src/serialization/types/WebhookEventMessageDeletedDataChannelType.d.ts +10 -0
  319. package/src/serialization/types/WebhookEventMessageDeletedDataChannelType.js +41 -0
  320. package/src/serialization/types/WebhookEventMessageDeletedDataDeletion.d.ts +18 -0
  321. package/src/serialization/types/WebhookEventMessageDeletedDataDeletion.js +49 -0
  322. package/src/serialization/types/WebhookEventMessageDeletedType.d.ts +10 -0
  323. package/src/serialization/types/WebhookEventMessageDeletedType.js +41 -0
  324. package/src/serialization/types/WebhookEventMessageEdited.d.ts +17 -0
  325. package/src/serialization/types/WebhookEventMessageEdited.js +48 -0
  326. package/src/serialization/types/WebhookEventMessageEditedData.d.ts +15 -0
  327. package/src/serialization/types/WebhookEventMessageEditedData.js +46 -0
  328. package/src/serialization/types/WebhookEventMessageEditedDataChannel.d.ts +17 -0
  329. package/src/serialization/types/WebhookEventMessageEditedDataChannel.js +48 -0
  330. package/src/serialization/types/WebhookEventMessageEditedDataChannelAccount.d.ts +13 -0
  331. package/src/serialization/types/WebhookEventMessageEditedDataChannelAccount.js +44 -0
  332. package/src/serialization/types/WebhookEventMessageEditedDataChannelConversation.d.ts +15 -0
  333. package/src/serialization/types/WebhookEventMessageEditedDataChannelConversation.js +46 -0
  334. package/src/serialization/types/WebhookEventMessageEditedDataChannelType.d.ts +10 -0
  335. package/src/serialization/types/WebhookEventMessageEditedDataChannelType.js +41 -0
  336. package/src/serialization/types/WebhookEventMessageEditedDataEdit.d.ts +23 -0
  337. package/src/serialization/types/WebhookEventMessageEditedDataEdit.js +54 -0
  338. package/src/serialization/types/WebhookEventMessageEditedDataEditError.d.ts +10 -0
  339. package/src/serialization/types/WebhookEventMessageEditedDataEditError.js +41 -0
  340. package/src/serialization/types/WebhookEventMessageEditedDataEditKind.d.ts +10 -0
  341. package/src/serialization/types/WebhookEventMessageEditedDataEditKind.js +41 -0
  342. package/src/serialization/types/WebhookEventMessageEditedType.d.ts +10 -0
  343. package/src/serialization/types/WebhookEventMessageEditedType.js +41 -0
  344. package/src/serialization/types/WebhookEventMessageHistory.d.ts +17 -0
  345. package/src/serialization/types/WebhookEventMessageHistory.js +48 -0
  346. package/src/serialization/types/WebhookEventMessageHistoryData.d.ts +19 -0
  347. package/src/serialization/types/WebhookEventMessageHistoryData.js +50 -0
  348. package/src/serialization/types/WebhookEventMessageHistoryDataChannel.d.ts +15 -0
  349. package/src/serialization/types/WebhookEventMessageHistoryDataChannel.js +46 -0
  350. package/src/serialization/types/WebhookEventMessageHistoryDataChannelAccount.d.ts +13 -0
  351. package/src/serialization/types/WebhookEventMessageHistoryDataChannelAccount.js +44 -0
  352. package/src/serialization/types/WebhookEventMessageHistoryDataChannelType.d.ts +10 -0
  353. package/src/serialization/types/WebhookEventMessageHistoryDataChannelType.js +41 -0
  354. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItem.d.ts +35 -0
  355. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItem.js +66 -0
  356. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItemConversation.d.ts +15 -0
  357. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItemConversation.js +46 -0
  358. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItemDirection.d.ts +10 -0
  359. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItemDirection.js +41 -0
  360. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItemReplyTo.d.ts +13 -0
  361. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItemReplyTo.js +44 -0
  362. package/src/serialization/types/WebhookEventMessageHistoryType.d.ts +10 -0
  363. package/src/serialization/types/WebhookEventMessageHistoryType.js +41 -0
  364. package/src/serialization/types/WebhookEventMessageReaction.d.ts +17 -0
  365. package/src/serialization/types/WebhookEventMessageReaction.js +48 -0
  366. package/src/serialization/types/WebhookEventMessageReactionData.d.ts +15 -0
  367. package/src/serialization/types/WebhookEventMessageReactionData.js +46 -0
  368. package/src/serialization/types/WebhookEventMessageReactionDataChannel.d.ts +17 -0
  369. package/src/serialization/types/WebhookEventMessageReactionDataChannel.js +48 -0
  370. package/src/serialization/types/WebhookEventMessageReactionDataChannelAccount.d.ts +13 -0
  371. package/src/serialization/types/WebhookEventMessageReactionDataChannelAccount.js +44 -0
  372. package/src/serialization/types/WebhookEventMessageReactionDataChannelConversation.d.ts +15 -0
  373. package/src/serialization/types/WebhookEventMessageReactionDataChannelConversation.js +46 -0
  374. package/src/serialization/types/WebhookEventMessageReactionDataChannelType.d.ts +10 -0
  375. package/src/serialization/types/WebhookEventMessageReactionDataChannelType.js +41 -0
  376. package/src/serialization/types/WebhookEventMessageReactionDataReaction.d.ts +21 -0
  377. package/src/serialization/types/WebhookEventMessageReactionDataReaction.js +52 -0
  378. package/src/serialization/types/WebhookEventMessageReactionType.d.ts +10 -0
  379. package/src/serialization/types/WebhookEventMessageReactionType.js +41 -0
  380. package/src/serialization/types/WebhookEventMessageReceived.d.ts +17 -0
  381. package/src/serialization/types/WebhookEventMessageReceived.js +48 -0
  382. package/src/serialization/types/WebhookEventMessageReceivedData.d.ts +15 -0
  383. package/src/serialization/types/WebhookEventMessageReceivedData.js +46 -0
  384. package/src/serialization/types/WebhookEventMessageReceivedDataChannel.d.ts +17 -0
  385. package/src/serialization/types/WebhookEventMessageReceivedDataChannel.js +48 -0
  386. package/src/serialization/types/WebhookEventMessageReceivedDataChannelAccount.d.ts +13 -0
  387. package/src/serialization/types/WebhookEventMessageReceivedDataChannelAccount.js +44 -0
  388. package/src/serialization/types/WebhookEventMessageReceivedDataChannelConversation.d.ts +15 -0
  389. package/src/serialization/types/WebhookEventMessageReceivedDataChannelConversation.js +46 -0
  390. package/src/serialization/types/WebhookEventMessageReceivedDataChannelType.d.ts +10 -0
  391. package/src/serialization/types/WebhookEventMessageReceivedDataChannelType.js +41 -0
  392. package/src/serialization/types/WebhookEventMessageReceivedDataMessage.d.ts +33 -0
  393. package/src/serialization/types/WebhookEventMessageReceivedDataMessage.js +64 -0
  394. package/src/serialization/types/WebhookEventMessageReceivedDataMessageDirection.d.ts +10 -0
  395. package/src/serialization/types/WebhookEventMessageReceivedDataMessageDirection.js +41 -0
  396. package/src/serialization/types/WebhookEventMessageReceivedDataMessageReplyTo.d.ts +13 -0
  397. package/src/serialization/types/WebhookEventMessageReceivedDataMessageReplyTo.js +44 -0
  398. package/src/serialization/types/WebhookEventMessageReceivedType.d.ts +10 -0
  399. package/src/serialization/types/WebhookEventMessageReceivedType.js +41 -0
  400. package/src/serialization/types/WebhookEventMessageSelfSent.d.ts +17 -0
  401. package/src/serialization/types/WebhookEventMessageSelfSent.js +48 -0
  402. package/src/serialization/types/WebhookEventMessageSelfSentData.d.ts +15 -0
  403. package/src/serialization/types/WebhookEventMessageSelfSentData.js +46 -0
  404. package/src/serialization/types/WebhookEventMessageSelfSentDataChannel.d.ts +17 -0
  405. package/src/serialization/types/WebhookEventMessageSelfSentDataChannel.js +48 -0
  406. package/src/serialization/types/WebhookEventMessageSelfSentDataChannelAccount.d.ts +13 -0
  407. package/src/serialization/types/WebhookEventMessageSelfSentDataChannelAccount.js +44 -0
  408. package/src/serialization/types/WebhookEventMessageSelfSentDataChannelConversation.d.ts +15 -0
  409. package/src/serialization/types/WebhookEventMessageSelfSentDataChannelConversation.js +46 -0
  410. package/src/serialization/types/WebhookEventMessageSelfSentDataChannelType.d.ts +10 -0
  411. package/src/serialization/types/WebhookEventMessageSelfSentDataChannelType.js +41 -0
  412. package/src/serialization/types/WebhookEventMessageSelfSentDataMessage.d.ts +33 -0
  413. package/src/serialization/types/WebhookEventMessageSelfSentDataMessage.js +64 -0
  414. package/src/serialization/types/WebhookEventMessageSelfSentDataMessageDirection.d.ts +10 -0
  415. package/src/serialization/types/WebhookEventMessageSelfSentDataMessageDirection.js +41 -0
  416. package/src/serialization/types/WebhookEventMessageSelfSentDataMessageReplyTo.d.ts +13 -0
  417. package/src/serialization/types/WebhookEventMessageSelfSentDataMessageReplyTo.js +44 -0
  418. package/src/serialization/types/WebhookEventMessageSelfSentType.d.ts +10 -0
  419. package/src/serialization/types/WebhookEventMessageSelfSentType.js +41 -0
  420. package/src/serialization/types/WebhookEventMessageStatus.d.ts +17 -0
  421. package/src/serialization/types/WebhookEventMessageStatus.js +48 -0
  422. package/src/serialization/types/WebhookEventMessageStatusData.d.ts +15 -0
  423. package/src/serialization/types/WebhookEventMessageStatusData.js +46 -0
  424. package/src/serialization/types/WebhookEventMessageStatusDataChannel.d.ts +17 -0
  425. package/src/serialization/types/WebhookEventMessageStatusDataChannel.js +48 -0
  426. package/src/serialization/types/WebhookEventMessageStatusDataChannelAccount.d.ts +13 -0
  427. package/src/serialization/types/WebhookEventMessageStatusDataChannelAccount.js +44 -0
  428. package/src/serialization/types/WebhookEventMessageStatusDataChannelConversation.d.ts +15 -0
  429. package/src/serialization/types/WebhookEventMessageStatusDataChannelConversation.js +46 -0
  430. package/src/serialization/types/WebhookEventMessageStatusDataChannelType.d.ts +10 -0
  431. package/src/serialization/types/WebhookEventMessageStatusDataChannelType.js +41 -0
  432. package/src/serialization/types/WebhookEventMessageStatusDataMessage.d.ts +20 -0
  433. package/src/serialization/types/WebhookEventMessageStatusDataMessage.js +51 -0
  434. package/src/serialization/types/WebhookEventMessageStatusDataMessagePreviousStatus.d.ts +10 -0
  435. package/src/serialization/types/WebhookEventMessageStatusDataMessagePreviousStatus.js +41 -0
  436. package/src/serialization/types/WebhookEventMessageStatusDataMessageStatus.d.ts +10 -0
  437. package/src/serialization/types/WebhookEventMessageStatusDataMessageStatus.js +41 -0
  438. package/src/serialization/types/WebhookEventMessageStatusType.d.ts +10 -0
  439. package/src/serialization/types/WebhookEventMessageStatusType.js +41 -0
  440. package/src/serialization/types/index.d.ts +79 -0
  441. package/src/serialization/types/index.js +95 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface AccountListGroupsResponseDataItem {
5
+ /** The group id on the channel (a WhatsApp group JID, `...@g.us`). Pass it as `recipient` to POST /message to write to the group. */
6
+ id: string;
7
+ name: string;
8
+ memberCount: number;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface AccountRequestHistoryResponse {
5
+ requested: boolean;
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,7 +9,15 @@ export interface AccountUpdateAccountResponse {
9
9
  status: UnlimitedMessagingApi.AccountUpdateAccountResponseStatus;
10
10
  phone: string | null;
11
11
  name: string | null;
12
+ /** Your own reference for this account, as set at linking or with PATCH. */
13
+ externalRef: string | null;
12
14
  blockedUntil: Date | null;
15
+ /** Whether fetching a stored media also requires authenticating as its owner. */
16
+ mediaUrlRequiresAuth: boolean;
17
+ /** Whether the account's message history is stored and announced. */
18
+ syncHistory: boolean;
19
+ /** The pause this account keeps between two sends, in seconds. */
20
+ sendIntervalSeconds: number;
13
21
  createdAt: Date;
14
22
  updatedAt: Date;
15
23
  }
@@ -10,6 +10,11 @@ export * from "./AccountGetChallengeResponseChallengeNone";
10
10
  export * from "./AccountGetChallengeResponseChallenge";
11
11
  export * from "./AccountGetChallengeResponse";
12
12
  export * from "./AccountGetQrCodeResponse";
13
+ export * from "./AccountRequestHistoryResponse";
14
+ export * from "./AccountListGroupsResponseDataItem";
15
+ export * from "./AccountListGroupsResponse";
16
+ export * from "./AccountGetGroupResponseMembersItem";
17
+ export * from "./AccountGetGroupResponse";
13
18
  export * from "./AccountGetAccountResponseChannel";
14
19
  export * from "./AccountGetAccountResponseStatus";
15
20
  export * from "./AccountGetAccountResponse";
@@ -26,6 +26,11 @@ __exportStar(require("./AccountGetChallengeResponseChallengeNone"), exports);
26
26
  __exportStar(require("./AccountGetChallengeResponseChallenge"), exports);
27
27
  __exportStar(require("./AccountGetChallengeResponse"), exports);
28
28
  __exportStar(require("./AccountGetQrCodeResponse"), exports);
29
+ __exportStar(require("./AccountRequestHistoryResponse"), exports);
30
+ __exportStar(require("./AccountListGroupsResponseDataItem"), exports);
31
+ __exportStar(require("./AccountListGroupsResponse"), exports);
32
+ __exportStar(require("./AccountGetGroupResponseMembersItem"), exports);
33
+ __exportStar(require("./AccountGetGroupResponse"), exports);
29
34
  __exportStar(require("./AccountGetAccountResponseChannel"), exports);
30
35
  __exportStar(require("./AccountGetAccountResponseStatus"), exports);
31
36
  __exportStar(require("./AccountGetAccountResponse"), exports);
@@ -48,7 +48,7 @@ export declare class Messages {
48
48
  /**
49
49
  * **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:WRITE
50
50
  *
51
- * Queues a WhatsApp message for delivery to the specified `recipient`: a phone number (E.164 format) for a 1:1 chat, or a WhatsApp group id (numeric, with or without its `@g.us` suffix) to address a group directly. If `accountId` is omitted, the platform resolves an account automatically using this priority order: (1) if the caller has exactly one active account, it is used; (2) if the caller has no account, the shared system account is used as fallback; (3) if the caller has multiple active accounts, a `400` is returned asking to specify `accountId`. Returns `404` if no account is available at all. Message text is limited to 1 600 characters. Provide `replyToMessageId` instead of `recipient` to send a quoted reply to a message already in the account's history: the conversation (a group included) and the account used are both derived from that message, and `accountId` is ignored. Beta (whatsmeow) WhatsApp accounts only for now. `simId` is a deprecated alias for `accountId`, removed 2026-12-16. To send a media file, upload it first with `POST /media` to get a temp URL, then pass that URL as `mediaUrl` with the matching `mediaType` (`image`, `document`, or `audio`) in this body.
51
+ * Queues a WhatsApp message for delivery to the specified `recipient`: a phone number (E.164 format) for a 1:1 chat, or a WhatsApp group id (numeric, with or without its `@g.us` suffix) to address a group directly. If `accountId` is omitted, the platform resolves an account automatically using this priority order: (1) if the caller has exactly one active account, it is used; (2) if the caller has no account, the shared system account is used as fallback; (3) if the caller has multiple active accounts, a `400` is returned asking to specify `accountId`. Returns `404` if no account is available at all. Message text is limited to 1 600 characters. Provide `replyToMessageId` instead of `recipient` to send a quoted reply to a message already in the account's history: the conversation (a group included) and the account used are both derived from that message, and `accountId` is ignored. Beta (whatsmeow) WhatsApp accounts only for now. `simId` is a deprecated alias for `accountId`, removed 2026-12-16. To send a media file, upload it first with `POST /media` to get a temp URL, then pass that URL as `mediaUrl` with the matching `mediaType` (`image`, `document`, or `audio`) in this body. Watermark: on the paid plans (Medium, Max) nothing is ever added to your messages. On the Free plan, a text message ends with a "Sent with UnlimitedMessaging.app" line; media and product messages never do. `watermarked` on the message says whether it was added.
52
52
  *
53
53
  * @param {UnlimitedMessagingApi.MessageSendRequest} request
54
54
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
@@ -174,7 +174,7 @@ class Messages {
174
174
  /**
175
175
  * **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:WRITE
176
176
  *
177
- * Queues a WhatsApp message for delivery to the specified `recipient`: a phone number (E.164 format) for a 1:1 chat, or a WhatsApp group id (numeric, with or without its `@g.us` suffix) to address a group directly. If `accountId` is omitted, the platform resolves an account automatically using this priority order: (1) if the caller has exactly one active account, it is used; (2) if the caller has no account, the shared system account is used as fallback; (3) if the caller has multiple active accounts, a `400` is returned asking to specify `accountId`. Returns `404` if no account is available at all. Message text is limited to 1 600 characters. Provide `replyToMessageId` instead of `recipient` to send a quoted reply to a message already in the account's history: the conversation (a group included) and the account used are both derived from that message, and `accountId` is ignored. Beta (whatsmeow) WhatsApp accounts only for now. `simId` is a deprecated alias for `accountId`, removed 2026-12-16. To send a media file, upload it first with `POST /media` to get a temp URL, then pass that URL as `mediaUrl` with the matching `mediaType` (`image`, `document`, or `audio`) in this body.
177
+ * Queues a WhatsApp message for delivery to the specified `recipient`: a phone number (E.164 format) for a 1:1 chat, or a WhatsApp group id (numeric, with or without its `@g.us` suffix) to address a group directly. If `accountId` is omitted, the platform resolves an account automatically using this priority order: (1) if the caller has exactly one active account, it is used; (2) if the caller has no account, the shared system account is used as fallback; (3) if the caller has multiple active accounts, a `400` is returned asking to specify `accountId`. Returns `404` if no account is available at all. Message text is limited to 1 600 characters. Provide `replyToMessageId` instead of `recipient` to send a quoted reply to a message already in the account's history: the conversation (a group included) and the account used are both derived from that message, and `accountId` is ignored. Beta (whatsmeow) WhatsApp accounts only for now. `simId` is a deprecated alias for `accountId`, removed 2026-12-16. To send a media file, upload it first with `POST /media` to get a temp URL, then pass that URL as `mediaUrl` with the matching `mediaType` (`image`, `document`, or `audio`) in this body. Watermark: on the paid plans (Medium, Max) nothing is ever added to your messages. On the Free plan, a text message ends with a "Sent with UnlimitedMessaging.app" line; media and product messages never do. `watermarked` on the message says whether it was added.
178
178
  *
179
179
  * @param {UnlimitedMessagingApi.MessageSendRequest} request
180
180
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
@@ -13,6 +13,10 @@ export interface MessageSendRequest {
13
13
  mediaType?: UnlimitedMessagingApi.MessageSendRequestMediaType;
14
14
  mimeType?: string;
15
15
  filename?: string;
16
+ /** `transactional` (an invoice, a reminder) is sent before any `normal` message already waiting in the queue, so a bulk send does not delay it. The pause between two sends of an account still applies. Defaults to `normal`. */
17
+ priority?: UnlimitedMessagingApi.MessageSendRequestPriority;
18
+ /** Images are always delivered to WhatsApp as uploaded. The copy UnlimitedMessaging keeps (what `mediaUrl` serves back) is resized and converted to WebP by default; set `false` to keep it byte-for-byte, e.g. for images with fine text. PNGs under 1 MB are always kept as is. */
19
+ compress?: boolean;
16
20
  productData?: UnlimitedMessagingApi.MessageSendRequestProductData;
17
21
  accountId?: string | null;
18
22
  simId?: string | null;
@@ -23,12 +23,19 @@ export interface MessageFindAllResponseDataItem {
23
23
  status: UnlimitedMessagingApi.MessageFindAllResponseDataItemStatus;
24
24
  channel: UnlimitedMessagingApi.MessageFindAllResponseDataItemChannel;
25
25
  accountChannel: UnlimitedMessagingApi.MessageFindAllResponseDataItemAccountChannel;
26
+ /** Whether the "Sent with UnlimitedMessaging.app" line was appended. Never on the paid plans (Medium, Max), nor on media and product messages; on the Free plan, text messages only. */
26
27
  watermarked: boolean;
27
28
  mediaUrl: string | null;
28
29
  mediaType: string | null;
29
30
  mimeType: string | null;
30
31
  mediaFilename: string | null;
32
+ /** Text extracted from the media: OCR of an image or a scanned PDF, the text of a PDF, a voice note's transcription. Not produced yet: always null for now. */
33
+ transcript: string | null;
31
34
  productData: Record<string, unknown> | null;
35
+ /** When the message was sent, per the channel: WhatsApp's own timestamp for a received message or one typed on the phone, the moment it went out for one sent through the API. Order conversations on this rather than createdAt. Null until an API send goes out. */
36
+ sentAt: Date | null;
37
+ /** When the message was deleted for everyone, null if it was not. */
38
+ deletedAt: Date | null;
32
39
  createdAt: Date;
33
40
  updatedAt: Date;
34
41
  }
@@ -23,12 +23,19 @@ export interface MessageFindOneResponse {
23
23
  status: UnlimitedMessagingApi.MessageFindOneResponseStatus;
24
24
  channel: UnlimitedMessagingApi.MessageFindOneResponseChannel;
25
25
  accountChannel: UnlimitedMessagingApi.MessageFindOneResponseAccountChannel;
26
+ /** Whether the "Sent with UnlimitedMessaging.app" line was appended. Never on the paid plans (Medium, Max), nor on media and product messages; on the Free plan, text messages only. */
26
27
  watermarked: boolean;
27
28
  mediaUrl: string | null;
28
29
  mediaType: string | null;
29
30
  mimeType: string | null;
30
31
  mediaFilename: string | null;
32
+ /** Text extracted from the media: OCR of an image or a scanned PDF, the text of a PDF, a voice note's transcription. Not produced yet: always null for now. */
33
+ transcript: string | null;
31
34
  productData: Record<string, unknown> | null;
35
+ /** When the message was sent, per the channel: WhatsApp's own timestamp for a received message or one typed on the phone, the moment it went out for one sent through the API. Order conversations on this rather than createdAt. Null until an API send goes out. */
36
+ sentAt: Date | null;
37
+ /** When the message was deleted for everyone, null if it was not. */
38
+ deletedAt: Date | null;
32
39
  createdAt: Date;
33
40
  updatedAt: Date;
34
41
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * `transactional` (an invoice, a reminder) is sent before any `normal` message already waiting in the queue, so a bulk send does not delay it. The pause between two sends of an account still applies. Defaults to `normal`.
6
+ */
7
+ export type MessageSendRequestPriority = "normal" | "transactional";
8
+ export declare const MessageSendRequestPriority: {
9
+ readonly Normal: "normal";
10
+ readonly Transactional: "transactional";
11
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MessageSendRequestPriority = void 0;
7
+ exports.MessageSendRequestPriority = {
8
+ Normal: "normal",
9
+ Transactional: "transactional",
10
+ };
@@ -23,12 +23,19 @@ export interface MessageSendResponse {
23
23
  status: UnlimitedMessagingApi.MessageSendResponseStatus;
24
24
  channel: UnlimitedMessagingApi.MessageSendResponseChannel;
25
25
  accountChannel: UnlimitedMessagingApi.MessageSendResponseAccountChannel;
26
+ /** Whether the "Sent with UnlimitedMessaging.app" line was appended. Never on the paid plans (Medium, Max), nor on media and product messages; on the Free plan, text messages only. */
26
27
  watermarked: boolean;
27
28
  mediaUrl: string | null;
28
29
  mediaType: string | null;
29
30
  mimeType: string | null;
30
31
  mediaFilename: string | null;
32
+ /** Text extracted from the media: OCR of an image or a scanned PDF, the text of a PDF, a voice note's transcription. Not produced yet: always null for now. */
33
+ transcript: string | null;
31
34
  productData: Record<string, unknown> | null;
35
+ /** When the message was sent, per the channel: WhatsApp's own timestamp for a received message or one typed on the phone, the moment it went out for one sent through the API. Order conversations on this rather than createdAt. Null until an API send goes out. */
36
+ sentAt: Date | null;
37
+ /** When the message was deleted for everyone, null if it was not. */
38
+ deletedAt: Date | null;
32
39
  createdAt: Date;
33
40
  updatedAt: Date;
34
41
  }
@@ -8,6 +8,7 @@ export * from "./MessageFindAllResponseDataItemAccountChannel";
8
8
  export * from "./MessageFindAllResponseDataItem";
9
9
  export * from "./MessageFindAllResponse";
10
10
  export * from "./MessageSendRequestMediaType";
11
+ export * from "./MessageSendRequestPriority";
11
12
  export * from "./MessageSendRequestProductData";
12
13
  export * from "./MessageSendResponseDirection";
13
14
  export * from "./MessageSendResponseStatus";
@@ -24,6 +24,7 @@ __exportStar(require("./MessageFindAllResponseDataItemAccountChannel"), exports)
24
24
  __exportStar(require("./MessageFindAllResponseDataItem"), exports);
25
25
  __exportStar(require("./MessageFindAllResponse"), exports);
26
26
  __exportStar(require("./MessageSendRequestMediaType"), exports);
27
+ __exportStar(require("./MessageSendRequestPriority"), exports);
27
28
  __exportStar(require("./MessageSendRequestProductData"), exports);
28
29
  __exportStar(require("./MessageSendResponseDirection"), exports);
29
30
  __exportStar(require("./MessageSendResponseStatus"), exports);
@@ -22,13 +22,148 @@ export declare namespace Webhooks {
22
22
  headers?: Record<string, string>;
23
23
  }
24
24
  }
25
+ /**
26
+ * Receive events as they happen instead of polling. Register an endpoint with `POST /webhooks`,
27
+ * choosing its `eventTypes` and, optionally, the `accountIds` it covers (by default every account
28
+ * you have, including ones linked later). Requires a Medium or Max plan.
29
+ *
30
+ * ### Delivery
31
+ *
32
+ * Each event is an HTTP `POST` with a JSON body:
33
+ *
34
+ * ```json
35
+ * { "type": "message.received", "eventId": "whd_...", "occurredAt": "2026-09-27T10:00:01.000Z", "data": { } }
36
+ * ```
37
+ *
38
+ * Answer with any `2xx` within 10 seconds, and do the work afterwards.
39
+ *
40
+ * ### Verifying the signature
41
+ *
42
+ * Deliveries are signed per [Standard Webhooks](https://www.standardwebhooks.com), so its libraries
43
+ * verify them as they are. Three headers come with every request:
44
+ *
45
+ * | Header | Content |
46
+ * | ------ | ------- |
47
+ * | `webhook-id` | The delivery id, equal to the body's `eventId`. Stable across retries. |
48
+ * | `webhook-timestamp` | Unix seconds when this attempt was sent. |
49
+ * | `webhook-signature` | `v1,` followed by the base64 HMAC-SHA256 of `{webhook-id}.{webhook-timestamp}.{raw body}`. Several space-separated entries may appear during a secret rotation: accept the request if one matches. |
50
+ *
51
+ * The HMAC key is your secret (returned once, by `POST /webhooks`) with its `whsec_` prefix removed,
52
+ * base64-decoded. Compute it over the raw body exactly as received, compare in constant time, and
53
+ * reject a timestamp more than 5 minutes away from your clock.
54
+ *
55
+ * ```js
56
+ * const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
57
+ * const expected = crypto.createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest('base64');
58
+ * const valid = signatureHeader.split(' ').some((s) => s === `v1,${expected}`);
59
+ * ```
60
+ *
61
+ * ### Retries
62
+ *
63
+ * A `2xx` marks the delivery done. A `429`, a `5xx`, a timeout or a network error is retried
64
+ * after 30 s, 2 min, 10 min, 1 h, 6 h, 1 day, 2 days: 8 attempts in all, over a little more than 3 days. Any other
65
+ * `4xx` is final and never retried. Delivery attempts are kept for 30 days.
66
+ *
67
+ * ### Ordering and duplicates
68
+ *
69
+ * Delivery is at least once: the same event can arrive twice, so deduplicate on `eventId` (a message
70
+ * is also never announced twice: `message.externalId` is unique per account).
71
+ *
72
+ * **Events are not delivered in the order things happened.** Retries reorder them, and a message with
73
+ * media is only announced once its media is stored, a few seconds after it arrived: a text sent right
74
+ * after a photo usually reaches you first. Never order on arrival. Every event carries the channel's
75
+ * own timestamp to order on:
76
+ *
77
+ * | Event | Order on |
78
+ * | ----- | -------- |
79
+ * | `message.received`, `message.self_sent` | `data.message.sentAt` (WhatsApp's timestamp) |
80
+ * | `message.status` | `data.message.at`, and `previousStatus` to ignore a stale one |
81
+ * | `message.reaction` | `data.reaction.sentAt` |
82
+ * | `message.edited` | `data.edit.editedAt` |
83
+ * | `message.deleted` | `data.deletion.deletedAt` |
84
+ * | `account.status_changed` | `data.account.at` |
85
+ *
86
+ * `GET /message` returns the same `sentAt`.
87
+ *
88
+ * **A change can arrive before the message it changes.** A reaction, an edit or a deletion names its
89
+ * target by `externalId` (`reactedToExternalId`, `edit.externalId`, `deletion.externalId`), and
90
+ * by UnlimitedMessaging id (`reactedToMessageId`, `messageId`) only when that message was already
91
+ * stored. A reaction to a photo typically beats the photo, which is announced once its media is stored:
92
+ * the id is then `null`. Keep such an event and link it later by `externalId`, which the message
93
+ * carries when it arrives (`message.externalId`).
94
+ *
95
+ * ### Events
96
+ *
97
+ * | Type | When |
98
+ * | ---- | ---- |
99
+ * | `message.received` | A message arrived. |
100
+ * | `message.self_sent` | The account's own phone sent a message by hand, outside the API. Same shape as `message.received`, with `direction: "OUT"` and `fromMe: true`. |
101
+ * | `message.status` | A message you sent changed status: `SENT`, `DELIVERED`, `READ`, `FAILED` or `UNDELIVERABLE`. Only effective changes fire: a late `DELIVERED` after `READ` does not. |
102
+ * | `message.reaction` | Someone reacted to a message, or took their reaction back (`removed: true`, empty `emoji`). |
103
+ * | `message.edited` | A message was edited. Carries its `externalId`, `newContent`, and `kind`: `text`, or `caption` for the caption of an image, video or document. Phones encrypt an edit with the original message's key: when it cannot be opened (`error`: `original_secret_missing` for a message the account received before it was linked, `decryption_failed` otherwise), the edit is still announced, with `newContent` and `kind` null, and the stored content is left as it was. |
104
+ * | `message.deleted` | A message was deleted for everyone, by its author or a group admin (`deletedBy`). The stored message is kept, with `deletedAt` set. |
105
+ * | `message.history` | Past messages, in batches, for an account linked with `syncHistory` (see below). |
106
+ * | `group.updated` | A group the account is in changed: members `added`, `removed`, `promoted` or `demoted`, a new `name` or `topic`. |
107
+ * | `account.status_changed` | An account's status changed: disconnected, logged out, restricted by WhatsApp (`BLOCKED`, with `blockedUntil`), reconnected... `reason` is a machine-readable code (`device_removed` when the device was removed from the phone, `logged_out` when WhatsApp refused the session), `transportCode` WhatsApp's own numeric code for diagnosis. |
108
+ *
109
+ * The schema of each payload is published with this reference, under `WebhookEvent*`.
110
+ *
111
+ * **Identifiers.** `message.externalId` is the message's id on WhatsApp: reactions
112
+ * (`reactedToExternalId`), edits and quoted replies (`replyTo.externalId`) refer to it.
113
+ * `sender` is a phone number in E.164 format, or `null` when WhatsApp hides it, in which case
114
+ * `senderId` (always set, a LID then) identifies the person. In a group, `participant` names who
115
+ * posted, `channel.conversation.id` is the group and `channel.conversation.participants` lists its
116
+ * members (+E164, or an id when the number is hidden). That list is kept in a cache refreshed when the
117
+ * group changes, so reading it on every message costs nothing: no need to call
118
+ * `GET /account/{accountId}/groups/{groupId}` per message. History batches do not carry it.
119
+ *
120
+ * **Media.** A media message carries `mediaType` (`image`, `video`, `document`, `audio`,
121
+ * `ptt` for a voice note, `sticker`), `mimeType`, `mediaFilename`, `mediaSize`, `durationSec`,
122
+ * and a `mediaUrl` serving the file UnlimitedMessaging stored. If it could not be stored,
123
+ * `mediaError` says why (`too_large` above 64 MB, `download_failed`) and there is no `mediaUrl`.
124
+ * The media is kept as long as its message: there is no automatic expiry. By default the URL alone
125
+ * gives access (its token is unguessable, so keep it private). For sensitive media, turn on
126
+ * `mediaUrlRequiresAuth` with `PATCH /account/{accountId}`: the URL then also requires
127
+ * `Authorization: Bearer ak_...` of a user the message belongs to (or their dashboard session),
128
+ * and answers `401` otherwise.
129
+ * `transcript` will hold the text extracted from the media (OCR, PDF text, voice transcription);
130
+ * it is `null` for now.
131
+ *
132
+ * ### History
133
+ *
134
+ * Link an account with `syncHistory=true` (`GET /account/link`, beta accounts) to receive its past
135
+ * conversations: the phone uploads its history once linked, and each part of it reaches you as
136
+ * `message.history` batches of up to 100 messages, each shaped like `message.received` (with
137
+ * `direction: "OUT"` for the account's own) plus its own `conversation`. `syncType` says which
138
+ * part it is (`initial_bootstrap` and `recent` first, then `full`), `progress` how far along, and
139
+ * `isLatest` that no more of that part is coming. A large history takes a while: expect batches for
140
+ * minutes after the link.
141
+ *
142
+ * Only messages stored for the first time are announced, so linking the same number again, or history
143
+ * overlapping live traffic, never repeats a message. History media is described (`mediaType`,
144
+ * `mimeType`, `mediaFilename`) but not stored: there is no `mediaUrl`. Subscribe to
145
+ * `message.history` only if you want it: endpoints that do not are never sent it.
146
+ *
147
+ * To go further back in one conversation, `POST /account/{accountId}/history` with the
148
+ * `externalId` of the oldest message you hold: the earlier messages arrive as a
149
+ * `message.history` batch with `syncType: "on_demand"`. `PATCH /account/{accountId}` turns
150
+ * `syncHistory` on or off for what WhatsApp sends from then on.
151
+ *
152
+ * ### Sending pace
153
+ *
154
+ * Each account keeps a pause between two sends, 5 seconds by default, which protects the number from
155
+ * being flagged by WhatsApp for bursts. Tune it per account with `PATCH /account/{accountId}`
156
+ * (`sendIntervalSeconds`, 2 to 120). Send invoices and reminders with
157
+ * `priority: "transactional"` on `POST /message`: they are taken before normal messages already
158
+ * waiting. Messages sent on a paid plan never carry a watermark.
159
+ */
25
160
  export declare class Webhooks {
26
161
  protected readonly _options: Webhooks.Options;
27
162
  constructor(_options: Webhooks.Options);
28
163
  /**
29
164
  * **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:READ
30
165
  *
31
- * Returns every webhook endpoint registered by the authenticated user, with the event types each one is subscribed to. Never includes the secret.
166
+ * Returns every webhook endpoint registered by the authenticated user, with the event types each one is subscribed to and the accounts it is scoped to (`accountIds`, empty for every account). Never includes the secret.
32
167
  *
33
168
  * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
34
169
  *
@@ -43,7 +178,7 @@ export declare class Webhooks {
43
178
  /**
44
179
  * **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:WRITE
45
180
  *
46
- * Registers a URL to receive signed HTTP POST requests for the given event types. The `secret` used to verify deliveries is only returned once, here - store it securely. Requires a Medium or Max plan.
181
+ * Registers a URL to receive signed HTTP POST requests for the given event types. Pass `accountIds` to only receive events about those accounts (by default, and with an empty list, events from every account you have are delivered, including accounts linked later). The `secret` used to verify deliveries is only returned once, here - store it securely. Requires a Medium or Max plan.
47
182
  *
48
183
  * @param {UnlimitedMessagingApi.WebhookEndpointCreateRequest} request
49
184
  * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
@@ -99,7 +234,7 @@ export declare class Webhooks {
99
234
  /**
100
235
  * **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:WRITE
101
236
  *
102
- * Updates the URL, description, enabled state, and/or subscribed event types. Omit a field to leave it unchanged.
237
+ * Updates the URL, description, enabled state, subscribed event types and/or account scope. Omit a field to leave it unchanged. `accountIds` replaces the scope; `null` or `[]` clears it so every account is delivered again.
103
238
  *
104
239
  * @param {string} id
105
240
  * @param {UnlimitedMessagingApi.WebhookEndpointUpdateRequest} request
@@ -55,6 +55,141 @@ const UnlimitedMessagingApi = __importStar(require("../../../index"));
55
55
  const url_join_1 = __importDefault(require("url-join"));
56
56
  const serializers = __importStar(require("../../../../serialization/index"));
57
57
  const errors = __importStar(require("../../../../errors/index"));
58
+ /**
59
+ * Receive events as they happen instead of polling. Register an endpoint with `POST /webhooks`,
60
+ * choosing its `eventTypes` and, optionally, the `accountIds` it covers (by default every account
61
+ * you have, including ones linked later). Requires a Medium or Max plan.
62
+ *
63
+ * ### Delivery
64
+ *
65
+ * Each event is an HTTP `POST` with a JSON body:
66
+ *
67
+ * ```json
68
+ * { "type": "message.received", "eventId": "whd_...", "occurredAt": "2026-09-27T10:00:01.000Z", "data": { } }
69
+ * ```
70
+ *
71
+ * Answer with any `2xx` within 10 seconds, and do the work afterwards.
72
+ *
73
+ * ### Verifying the signature
74
+ *
75
+ * Deliveries are signed per [Standard Webhooks](https://www.standardwebhooks.com), so its libraries
76
+ * verify them as they are. Three headers come with every request:
77
+ *
78
+ * | Header | Content |
79
+ * | ------ | ------- |
80
+ * | `webhook-id` | The delivery id, equal to the body's `eventId`. Stable across retries. |
81
+ * | `webhook-timestamp` | Unix seconds when this attempt was sent. |
82
+ * | `webhook-signature` | `v1,` followed by the base64 HMAC-SHA256 of `{webhook-id}.{webhook-timestamp}.{raw body}`. Several space-separated entries may appear during a secret rotation: accept the request if one matches. |
83
+ *
84
+ * The HMAC key is your secret (returned once, by `POST /webhooks`) with its `whsec_` prefix removed,
85
+ * base64-decoded. Compute it over the raw body exactly as received, compare in constant time, and
86
+ * reject a timestamp more than 5 minutes away from your clock.
87
+ *
88
+ * ```js
89
+ * const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
90
+ * const expected = crypto.createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest('base64');
91
+ * const valid = signatureHeader.split(' ').some((s) => s === `v1,${expected}`);
92
+ * ```
93
+ *
94
+ * ### Retries
95
+ *
96
+ * A `2xx` marks the delivery done. A `429`, a `5xx`, a timeout or a network error is retried
97
+ * after 30 s, 2 min, 10 min, 1 h, 6 h, 1 day, 2 days: 8 attempts in all, over a little more than 3 days. Any other
98
+ * `4xx` is final and never retried. Delivery attempts are kept for 30 days.
99
+ *
100
+ * ### Ordering and duplicates
101
+ *
102
+ * Delivery is at least once: the same event can arrive twice, so deduplicate on `eventId` (a message
103
+ * is also never announced twice: `message.externalId` is unique per account).
104
+ *
105
+ * **Events are not delivered in the order things happened.** Retries reorder them, and a message with
106
+ * media is only announced once its media is stored, a few seconds after it arrived: a text sent right
107
+ * after a photo usually reaches you first. Never order on arrival. Every event carries the channel's
108
+ * own timestamp to order on:
109
+ *
110
+ * | Event | Order on |
111
+ * | ----- | -------- |
112
+ * | `message.received`, `message.self_sent` | `data.message.sentAt` (WhatsApp's timestamp) |
113
+ * | `message.status` | `data.message.at`, and `previousStatus` to ignore a stale one |
114
+ * | `message.reaction` | `data.reaction.sentAt` |
115
+ * | `message.edited` | `data.edit.editedAt` |
116
+ * | `message.deleted` | `data.deletion.deletedAt` |
117
+ * | `account.status_changed` | `data.account.at` |
118
+ *
119
+ * `GET /message` returns the same `sentAt`.
120
+ *
121
+ * **A change can arrive before the message it changes.** A reaction, an edit or a deletion names its
122
+ * target by `externalId` (`reactedToExternalId`, `edit.externalId`, `deletion.externalId`), and
123
+ * by UnlimitedMessaging id (`reactedToMessageId`, `messageId`) only when that message was already
124
+ * stored. A reaction to a photo typically beats the photo, which is announced once its media is stored:
125
+ * the id is then `null`. Keep such an event and link it later by `externalId`, which the message
126
+ * carries when it arrives (`message.externalId`).
127
+ *
128
+ * ### Events
129
+ *
130
+ * | Type | When |
131
+ * | ---- | ---- |
132
+ * | `message.received` | A message arrived. |
133
+ * | `message.self_sent` | The account's own phone sent a message by hand, outside the API. Same shape as `message.received`, with `direction: "OUT"` and `fromMe: true`. |
134
+ * | `message.status` | A message you sent changed status: `SENT`, `DELIVERED`, `READ`, `FAILED` or `UNDELIVERABLE`. Only effective changes fire: a late `DELIVERED` after `READ` does not. |
135
+ * | `message.reaction` | Someone reacted to a message, or took their reaction back (`removed: true`, empty `emoji`). |
136
+ * | `message.edited` | A message was edited. Carries its `externalId`, `newContent`, and `kind`: `text`, or `caption` for the caption of an image, video or document. Phones encrypt an edit with the original message's key: when it cannot be opened (`error`: `original_secret_missing` for a message the account received before it was linked, `decryption_failed` otherwise), the edit is still announced, with `newContent` and `kind` null, and the stored content is left as it was. |
137
+ * | `message.deleted` | A message was deleted for everyone, by its author or a group admin (`deletedBy`). The stored message is kept, with `deletedAt` set. |
138
+ * | `message.history` | Past messages, in batches, for an account linked with `syncHistory` (see below). |
139
+ * | `group.updated` | A group the account is in changed: members `added`, `removed`, `promoted` or `demoted`, a new `name` or `topic`. |
140
+ * | `account.status_changed` | An account's status changed: disconnected, logged out, restricted by WhatsApp (`BLOCKED`, with `blockedUntil`), reconnected... `reason` is a machine-readable code (`device_removed` when the device was removed from the phone, `logged_out` when WhatsApp refused the session), `transportCode` WhatsApp's own numeric code for diagnosis. |
141
+ *
142
+ * The schema of each payload is published with this reference, under `WebhookEvent*`.
143
+ *
144
+ * **Identifiers.** `message.externalId` is the message's id on WhatsApp: reactions
145
+ * (`reactedToExternalId`), edits and quoted replies (`replyTo.externalId`) refer to it.
146
+ * `sender` is a phone number in E.164 format, or `null` when WhatsApp hides it, in which case
147
+ * `senderId` (always set, a LID then) identifies the person. In a group, `participant` names who
148
+ * posted, `channel.conversation.id` is the group and `channel.conversation.participants` lists its
149
+ * members (+E164, or an id when the number is hidden). That list is kept in a cache refreshed when the
150
+ * group changes, so reading it on every message costs nothing: no need to call
151
+ * `GET /account/{accountId}/groups/{groupId}` per message. History batches do not carry it.
152
+ *
153
+ * **Media.** A media message carries `mediaType` (`image`, `video`, `document`, `audio`,
154
+ * `ptt` for a voice note, `sticker`), `mimeType`, `mediaFilename`, `mediaSize`, `durationSec`,
155
+ * and a `mediaUrl` serving the file UnlimitedMessaging stored. If it could not be stored,
156
+ * `mediaError` says why (`too_large` above 64 MB, `download_failed`) and there is no `mediaUrl`.
157
+ * The media is kept as long as its message: there is no automatic expiry. By default the URL alone
158
+ * gives access (its token is unguessable, so keep it private). For sensitive media, turn on
159
+ * `mediaUrlRequiresAuth` with `PATCH /account/{accountId}`: the URL then also requires
160
+ * `Authorization: Bearer ak_...` of a user the message belongs to (or their dashboard session),
161
+ * and answers `401` otherwise.
162
+ * `transcript` will hold the text extracted from the media (OCR, PDF text, voice transcription);
163
+ * it is `null` for now.
164
+ *
165
+ * ### History
166
+ *
167
+ * Link an account with `syncHistory=true` (`GET /account/link`, beta accounts) to receive its past
168
+ * conversations: the phone uploads its history once linked, and each part of it reaches you as
169
+ * `message.history` batches of up to 100 messages, each shaped like `message.received` (with
170
+ * `direction: "OUT"` for the account's own) plus its own `conversation`. `syncType` says which
171
+ * part it is (`initial_bootstrap` and `recent` first, then `full`), `progress` how far along, and
172
+ * `isLatest` that no more of that part is coming. A large history takes a while: expect batches for
173
+ * minutes after the link.
174
+ *
175
+ * Only messages stored for the first time are announced, so linking the same number again, or history
176
+ * overlapping live traffic, never repeats a message. History media is described (`mediaType`,
177
+ * `mimeType`, `mediaFilename`) but not stored: there is no `mediaUrl`. Subscribe to
178
+ * `message.history` only if you want it: endpoints that do not are never sent it.
179
+ *
180
+ * To go further back in one conversation, `POST /account/{accountId}/history` with the
181
+ * `externalId` of the oldest message you hold: the earlier messages arrive as a
182
+ * `message.history` batch with `syncType: "on_demand"`. `PATCH /account/{accountId}` turns
183
+ * `syncHistory` on or off for what WhatsApp sends from then on.
184
+ *
185
+ * ### Sending pace
186
+ *
187
+ * Each account keeps a pause between two sends, 5 seconds by default, which protects the number from
188
+ * being flagged by WhatsApp for bursts. Tune it per account with `PATCH /account/{accountId}`
189
+ * (`sendIntervalSeconds`, 2 to 120). Send invoices and reminders with
190
+ * `priority: "transactional"` on `POST /message`: they are taken before normal messages already
191
+ * waiting. Messages sent on a paid plan never carry a watermark.
192
+ */
58
193
  class Webhooks {
59
194
  constructor(_options) {
60
195
  this._options = _options;
@@ -62,7 +197,7 @@ class Webhooks {
62
197
  /**
63
198
  * **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:READ
64
199
  *
65
- * Returns every webhook endpoint registered by the authenticated user, with the event types each one is subscribed to. Never includes the secret.
200
+ * Returns every webhook endpoint registered by the authenticated user, with the event types each one is subscribed to and the accounts it is scoped to (`accountIds`, empty for every account). Never includes the secret.
66
201
  *
67
202
  * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
68
203
  *
@@ -134,7 +269,7 @@ class Webhooks {
134
269
  /**
135
270
  * **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:WRITE
136
271
  *
137
- * Registers a URL to receive signed HTTP POST requests for the given event types. The `secret` used to verify deliveries is only returned once, here - store it securely. Requires a Medium or Max plan.
272
+ * Registers a URL to receive signed HTTP POST requests for the given event types. Pass `accountIds` to only receive events about those accounts (by default, and with an empty list, events from every account you have are delivered, including accounts linked later). The `secret` used to verify deliveries is only returned once, here - store it securely. Requires a Medium or Max plan.
138
273
  *
139
274
  * @param {UnlimitedMessagingApi.WebhookEndpointCreateRequest} request
140
275
  * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
@@ -360,7 +495,7 @@ class Webhooks {
360
495
  /**
361
496
  * **Protection**: Protected endpoint. Allowed roles: USER, ADMIN. Required scopes: OTHER:WRITE
362
497
  *
363
- * Updates the URL, description, enabled state, and/or subscribed event types. Omit a field to leave it unchanged.
498
+ * Updates the URL, description, enabled state, subscribed event types and/or account scope. Omit a field to leave it unchanged. `accountIds` replaces the scope; `null` or `[]` clears it so every account is delivered again.
364
499
  *
365
500
  * @param {string} id
366
501
  * @param {UnlimitedMessagingApi.WebhookEndpointUpdateRequest} request
@@ -13,4 +13,5 @@ export interface WebhookEndpointCreateRequest {
13
13
  url: string;
14
14
  description?: string;
15
15
  eventTypes: UnlimitedMessagingApi.WebhookEndpointCreateRequestEventTypesItem[];
16
+ accountIds?: string[];
16
17
  }
@@ -11,4 +11,5 @@ export interface WebhookEndpointUpdateRequest {
11
11
  description?: string | null;
12
12
  enabled?: boolean;
13
13
  eventTypes?: UnlimitedMessagingApi.WebhookEndpointUpdateRequestEventTypesItem[];
14
+ accountIds?: string[] | null;
14
15
  }
@@ -1,7 +1,15 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type WebhookEndpointCreateRequestEventTypesItem = "message.received";
4
+ export type WebhookEndpointCreateRequestEventTypesItem = "message.received" | "message.self_sent" | "message.status" | "message.reaction" | "message.edited" | "account.status_changed" | "message.history" | "group.updated" | "message.deleted";
5
5
  export declare const WebhookEndpointCreateRequestEventTypesItem: {
6
6
  readonly MessageReceived: "message.received";
7
+ readonly MessageSelfSent: "message.self_sent";
8
+ readonly MessageStatus: "message.status";
9
+ readonly MessageReaction: "message.reaction";
10
+ readonly MessageEdited: "message.edited";
11
+ readonly AccountStatusChanged: "account.status_changed";
12
+ readonly MessageHistory: "message.history";
13
+ readonly GroupUpdated: "group.updated";
14
+ readonly MessageDeleted: "message.deleted";
7
15
  };
@@ -6,4 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.WebhookEndpointCreateRequestEventTypesItem = void 0;
7
7
  exports.WebhookEndpointCreateRequestEventTypesItem = {
8
8
  MessageReceived: "message.received",
9
+ MessageSelfSent: "message.self_sent",
10
+ MessageStatus: "message.status",
11
+ MessageReaction: "message.reaction",
12
+ MessageEdited: "message.edited",
13
+ AccountStatusChanged: "account.status_changed",
14
+ MessageHistory: "message.history",
15
+ GroupUpdated: "group.updated",
16
+ MessageDeleted: "message.deleted",
9
17
  };
@@ -9,6 +9,7 @@ export interface WebhookEndpointCreateResponse {
9
9
  secretPrefix: string;
10
10
  enabled: boolean;
11
11
  eventTypes: UnlimitedMessagingApi.WebhookEndpointCreateResponseEventTypesItem[];
12
+ accountIds: string[];
12
13
  createdAt: Date;
13
14
  updatedAt: Date;
14
15
  secret: string;