@unlimited-messaging/sdk 0.1.19 → 0.1.21

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 (131) hide show
  1. package/package.json +1 -1
  2. package/src/api/resources/accounts/types/AccountGetAccountResponse.d.ts +3 -0
  3. package/src/api/resources/accounts/types/AccountGetAccountResponseOwner.d.ts +11 -0
  4. package/src/api/resources/accounts/types/AccountGetAccountResponseOwner.js +10 -0
  5. package/src/api/resources/accounts/types/AccountListAccountsResponseItem.d.ts +3 -0
  6. package/src/api/resources/accounts/types/AccountListAccountsResponseItemOwner.d.ts +11 -0
  7. package/src/api/resources/accounts/types/AccountListAccountsResponseItemOwner.js +10 -0
  8. package/src/api/resources/accounts/types/AccountUpdateAccountResponse.d.ts +3 -0
  9. package/src/api/resources/accounts/types/AccountUpdateAccountResponseOwner.d.ts +11 -0
  10. package/src/api/resources/accounts/types/AccountUpdateAccountResponseOwner.js +10 -0
  11. package/src/api/resources/accounts/types/index.d.ts +3 -0
  12. package/src/api/resources/accounts/types/index.js +3 -0
  13. package/src/api/resources/messages/client/Client.d.ts +13 -1
  14. package/src/api/resources/messages/client/Client.js +13 -1
  15. package/src/api/resources/messages/client/requests/MessageSendRequest.d.ts +10 -0
  16. package/src/api/resources/messages/types/MessageFindAllResponseDataItem.d.ts +12 -1
  17. package/src/api/resources/messages/types/MessageFindAllResponseDataItemAttachmentsItem.d.ts +11 -0
  18. package/src/api/resources/messages/types/MessageFindAllResponseDataItemAttachmentsItem.js +5 -0
  19. package/src/api/resources/messages/types/MessageFindOneResponse.d.ts +12 -1
  20. package/src/api/resources/messages/types/MessageFindOneResponseAttachmentsItem.d.ts +11 -0
  21. package/src/api/resources/messages/types/MessageFindOneResponseAttachmentsItem.js +5 -0
  22. package/src/api/resources/messages/types/MessageSendRequestAttachmentsItem.d.ts +9 -0
  23. package/src/api/resources/messages/types/MessageSendRequestAttachmentsItem.js +5 -0
  24. package/src/api/resources/messages/types/MessageSendRequestChannelsItem.d.ts +11 -0
  25. package/src/api/resources/messages/types/MessageSendRequestChannelsItem.js +5 -0
  26. package/src/api/resources/messages/types/MessageSendRequestChannelsItemChannel.d.ts +8 -0
  27. package/src/api/resources/messages/types/MessageSendRequestChannelsItemChannel.js +10 -0
  28. package/src/api/resources/messages/types/MessageSendRequestMediaType.d.ts +3 -0
  29. package/src/api/resources/messages/types/MessageSendRequestTo.d.ts +7 -0
  30. package/src/api/resources/messages/types/MessageSendRequestTo.js +5 -0
  31. package/src/api/resources/messages/types/MessageSendResponse.d.ts +13 -1
  32. package/src/api/resources/messages/types/MessageSendResponseAttachmentsItem.d.ts +11 -0
  33. package/src/api/resources/messages/types/MessageSendResponseAttachmentsItem.js +5 -0
  34. package/src/api/resources/messages/types/MessageSendResponseMessagesItem.d.ts +52 -0
  35. package/src/api/resources/messages/types/MessageSendResponseMessagesItem.js +5 -0
  36. package/src/api/resources/messages/types/MessageSendResponseMessagesItemAccountChannel.d.ts +10 -0
  37. package/src/api/resources/messages/types/MessageSendResponseMessagesItemAccountChannel.js +12 -0
  38. package/src/api/resources/messages/types/MessageSendResponseMessagesItemAttachmentsItem.d.ts +11 -0
  39. package/src/api/resources/messages/types/MessageSendResponseMessagesItemAttachmentsItem.js +5 -0
  40. package/src/api/resources/messages/types/MessageSendResponseMessagesItemChannel.d.ts +9 -0
  41. package/src/api/resources/messages/types/MessageSendResponseMessagesItemChannel.js +11 -0
  42. package/src/api/resources/messages/types/MessageSendResponseMessagesItemDirection.d.ts +8 -0
  43. package/src/api/resources/messages/types/MessageSendResponseMessagesItemDirection.js +10 -0
  44. package/src/api/resources/messages/types/MessageSendResponseMessagesItemStatus.d.ts +13 -0
  45. package/src/api/resources/messages/types/MessageSendResponseMessagesItemStatus.js +15 -0
  46. package/src/api/resources/messages/types/index.d.ts +13 -0
  47. package/src/api/resources/messages/types/index.js +13 -0
  48. package/src/api/resources/webhooks/client/Client.d.ts +8 -1
  49. package/src/api/resources/webhooks/client/Client.js +8 -1
  50. package/src/api/types/WebhookEventMessageEditedDataEdit.d.ts +2 -1
  51. package/src/api/types/WebhookEventMessageEditedDataEditError.d.ts +8 -0
  52. package/src/api/types/WebhookEventMessageEditedDataEditError.js +10 -0
  53. package/src/api/types/WebhookEventMessageHistoryDataMessagesItem.d.ts +3 -0
  54. package/src/api/types/WebhookEventMessageHistoryDataMessagesItemAttachmentsItem.d.ts +10 -0
  55. package/src/api/types/WebhookEventMessageHistoryDataMessagesItemAttachmentsItem.js +5 -0
  56. package/src/api/types/WebhookEventMessageReceivedDataMessage.d.ts +3 -0
  57. package/src/api/types/WebhookEventMessageReceivedDataMessageAttachmentsItem.d.ts +10 -0
  58. package/src/api/types/WebhookEventMessageReceivedDataMessageAttachmentsItem.js +5 -0
  59. package/src/api/types/WebhookEventMessageSelfSentDataMessage.d.ts +3 -0
  60. package/src/api/types/WebhookEventMessageSelfSentDataMessageAttachmentsItem.d.ts +10 -0
  61. package/src/api/types/WebhookEventMessageSelfSentDataMessageAttachmentsItem.js +5 -0
  62. package/src/api/types/index.d.ts +4 -0
  63. package/src/api/types/index.js +4 -0
  64. package/src/serialization/resources/accounts/types/AccountGetAccountResponse.d.ts +2 -0
  65. package/src/serialization/resources/accounts/types/AccountGetAccountResponse.js +2 -0
  66. package/src/serialization/resources/accounts/types/AccountGetAccountResponseOwner.d.ts +10 -0
  67. package/src/serialization/resources/accounts/types/AccountGetAccountResponseOwner.js +41 -0
  68. package/src/serialization/resources/accounts/types/AccountListAccountsResponseItem.d.ts +2 -0
  69. package/src/serialization/resources/accounts/types/AccountListAccountsResponseItem.js +2 -0
  70. package/src/serialization/resources/accounts/types/AccountListAccountsResponseItemOwner.d.ts +10 -0
  71. package/src/serialization/resources/accounts/types/AccountListAccountsResponseItemOwner.js +41 -0
  72. package/src/serialization/resources/accounts/types/AccountUpdateAccountResponse.d.ts +2 -0
  73. package/src/serialization/resources/accounts/types/AccountUpdateAccountResponse.js +2 -0
  74. package/src/serialization/resources/accounts/types/AccountUpdateAccountResponseOwner.d.ts +10 -0
  75. package/src/serialization/resources/accounts/types/AccountUpdateAccountResponseOwner.js +41 -0
  76. package/src/serialization/resources/accounts/types/index.d.ts +3 -0
  77. package/src/serialization/resources/accounts/types/index.js +3 -0
  78. package/src/serialization/resources/messages/client/requests/MessageSendRequest.d.ts +8 -0
  79. package/src/serialization/resources/messages/client/requests/MessageSendRequest.js +8 -0
  80. package/src/serialization/resources/messages/types/MessageFindAllResponseDataItem.d.ts +5 -0
  81. package/src/serialization/resources/messages/types/MessageFindAllResponseDataItem.js +5 -0
  82. package/src/serialization/resources/messages/types/MessageFindAllResponseDataItemAttachmentsItem.d.ts +16 -0
  83. package/src/serialization/resources/messages/types/MessageFindAllResponseDataItemAttachmentsItem.js +47 -0
  84. package/src/serialization/resources/messages/types/MessageFindOneResponse.d.ts +5 -0
  85. package/src/serialization/resources/messages/types/MessageFindOneResponse.js +5 -0
  86. package/src/serialization/resources/messages/types/MessageFindOneResponseAttachmentsItem.d.ts +16 -0
  87. package/src/serialization/resources/messages/types/MessageFindOneResponseAttachmentsItem.js +47 -0
  88. package/src/serialization/resources/messages/types/MessageSendRequestAttachmentsItem.d.ts +15 -0
  89. package/src/serialization/resources/messages/types/MessageSendRequestAttachmentsItem.js +46 -0
  90. package/src/serialization/resources/messages/types/MessageSendRequestChannelsItem.d.ts +17 -0
  91. package/src/serialization/resources/messages/types/MessageSendRequestChannelsItem.js +48 -0
  92. package/src/serialization/resources/messages/types/MessageSendRequestChannelsItemChannel.d.ts +10 -0
  93. package/src/serialization/resources/messages/types/MessageSendRequestChannelsItemChannel.js +41 -0
  94. package/src/serialization/resources/messages/types/MessageSendRequestTo.d.ts +13 -0
  95. package/src/serialization/resources/messages/types/MessageSendRequestTo.js +44 -0
  96. package/src/serialization/resources/messages/types/MessageSendResponse.d.ts +7 -0
  97. package/src/serialization/resources/messages/types/MessageSendResponse.js +7 -0
  98. package/src/serialization/resources/messages/types/MessageSendResponseAttachmentsItem.d.ts +16 -0
  99. package/src/serialization/resources/messages/types/MessageSendResponseAttachmentsItem.js +47 -0
  100. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItem.d.ts +47 -0
  101. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItem.js +78 -0
  102. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItemAccountChannel.d.ts +10 -0
  103. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItemAccountChannel.js +41 -0
  104. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItemAttachmentsItem.d.ts +16 -0
  105. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItemAttachmentsItem.js +47 -0
  106. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItemChannel.d.ts +10 -0
  107. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItemChannel.js +41 -0
  108. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItemDirection.d.ts +10 -0
  109. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItemDirection.js +41 -0
  110. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItemStatus.d.ts +10 -0
  111. package/src/serialization/resources/messages/types/MessageSendResponseMessagesItemStatus.js +41 -0
  112. package/src/serialization/resources/messages/types/index.d.ts +13 -0
  113. package/src/serialization/resources/messages/types/index.js +13 -0
  114. package/src/serialization/types/WebhookEventMessageEditedDataEdit.d.ts +3 -1
  115. package/src/serialization/types/WebhookEventMessageEditedDataEdit.js +3 -1
  116. package/src/serialization/types/WebhookEventMessageEditedDataEditError.d.ts +10 -0
  117. package/src/serialization/types/WebhookEventMessageEditedDataEditError.js +41 -0
  118. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItem.d.ts +4 -0
  119. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItem.js +4 -0
  120. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItemAttachmentsItem.d.ts +16 -0
  121. package/src/serialization/types/WebhookEventMessageHistoryDataMessagesItemAttachmentsItem.js +47 -0
  122. package/src/serialization/types/WebhookEventMessageReceivedDataMessage.d.ts +4 -0
  123. package/src/serialization/types/WebhookEventMessageReceivedDataMessage.js +4 -0
  124. package/src/serialization/types/WebhookEventMessageReceivedDataMessageAttachmentsItem.d.ts +16 -0
  125. package/src/serialization/types/WebhookEventMessageReceivedDataMessageAttachmentsItem.js +47 -0
  126. package/src/serialization/types/WebhookEventMessageSelfSentDataMessage.d.ts +4 -0
  127. package/src/serialization/types/WebhookEventMessageSelfSentDataMessage.js +4 -0
  128. package/src/serialization/types/WebhookEventMessageSelfSentDataMessageAttachmentsItem.d.ts +16 -0
  129. package/src/serialization/types/WebhookEventMessageSelfSentDataMessageAttachmentsItem.js +47 -0
  130. package/src/serialization/types/index.d.ts +4 -0
  131. package/src/serialization/types/index.js +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unlimited-messaging/sdk",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "TypeScript / Node.js SDK for the Unlimited Messaging API — send and receive WhatsApp messages programmatically",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -5,6 +5,9 @@ import * as UnlimitedMessagingApi from "../../../index";
5
5
  export interface AccountGetAccountResponse {
6
6
  id: string;
7
7
  channel: UnlimitedMessagingApi.AccountGetAccountResponseChannel;
8
+ /** Who provides the account: USER when you connected it with your own credentials, SYSTEM when UnlimitedMessaging provides it. */
9
+ owner: UnlimitedMessagingApi.AccountGetAccountResponseOwner;
10
+ /** Deprecated: use `owner` instead (true when owner is SYSTEM). */
8
11
  isSystem: boolean;
9
12
  status: UnlimitedMessagingApi.AccountGetAccountResponseStatus;
10
13
  phone: string | null;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Who provides the account: USER when you connected it with your own credentials, SYSTEM when UnlimitedMessaging provides it.
6
+ */
7
+ export type AccountGetAccountResponseOwner = "USER" | "SYSTEM";
8
+ export declare const AccountGetAccountResponseOwner: {
9
+ readonly User: "USER";
10
+ readonly System: "SYSTEM";
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.AccountGetAccountResponseOwner = void 0;
7
+ exports.AccountGetAccountResponseOwner = {
8
+ User: "USER",
9
+ System: "SYSTEM",
10
+ };
@@ -5,6 +5,9 @@ import * as UnlimitedMessagingApi from "../../../index";
5
5
  export interface AccountListAccountsResponseItem {
6
6
  id: string;
7
7
  channel: UnlimitedMessagingApi.AccountListAccountsResponseItemChannel;
8
+ /** Who provides the account: USER when you connected it with your own credentials, SYSTEM when UnlimitedMessaging provides it. */
9
+ owner: UnlimitedMessagingApi.AccountListAccountsResponseItemOwner;
10
+ /** Deprecated: use `owner` instead (true when owner is SYSTEM). */
8
11
  isSystem: boolean;
9
12
  status: UnlimitedMessagingApi.AccountListAccountsResponseItemStatus;
10
13
  phone: string | null;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Who provides the account: USER when you connected it with your own credentials, SYSTEM when UnlimitedMessaging provides it.
6
+ */
7
+ export type AccountListAccountsResponseItemOwner = "USER" | "SYSTEM";
8
+ export declare const AccountListAccountsResponseItemOwner: {
9
+ readonly User: "USER";
10
+ readonly System: "SYSTEM";
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.AccountListAccountsResponseItemOwner = void 0;
7
+ exports.AccountListAccountsResponseItemOwner = {
8
+ User: "USER",
9
+ System: "SYSTEM",
10
+ };
@@ -5,6 +5,9 @@ import * as UnlimitedMessagingApi from "../../../index";
5
5
  export interface AccountUpdateAccountResponse {
6
6
  id: string;
7
7
  channel: UnlimitedMessagingApi.AccountUpdateAccountResponseChannel;
8
+ /** Who provides the account: USER when you connected it with your own credentials, SYSTEM when UnlimitedMessaging provides it. */
9
+ owner: UnlimitedMessagingApi.AccountUpdateAccountResponseOwner;
10
+ /** Deprecated: use `owner` instead (true when owner is SYSTEM). */
8
11
  isSystem: boolean;
9
12
  status: UnlimitedMessagingApi.AccountUpdateAccountResponseStatus;
10
13
  phone: string | null;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Who provides the account: USER when you connected it with your own credentials, SYSTEM when UnlimitedMessaging provides it.
6
+ */
7
+ export type AccountUpdateAccountResponseOwner = "USER" | "SYSTEM";
8
+ export declare const AccountUpdateAccountResponseOwner: {
9
+ readonly User: "USER";
10
+ readonly System: "SYSTEM";
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.AccountUpdateAccountResponseOwner = void 0;
7
+ exports.AccountUpdateAccountResponseOwner = {
8
+ User: "USER",
9
+ System: "SYSTEM",
10
+ };
@@ -1,4 +1,5 @@
1
1
  export * from "./AccountListAccountsResponseItemChannel";
2
+ export * from "./AccountListAccountsResponseItemOwner";
2
3
  export * from "./AccountListAccountsResponseItemStatus";
3
4
  export * from "./AccountListAccountsResponseItem";
4
5
  export * from "./AccountLinkAccountRequestMode";
@@ -16,8 +17,10 @@ export * from "./AccountListGroupsResponse";
16
17
  export * from "./AccountGetGroupResponseMembersItem";
17
18
  export * from "./AccountGetGroupResponse";
18
19
  export * from "./AccountGetAccountResponseChannel";
20
+ export * from "./AccountGetAccountResponseOwner";
19
21
  export * from "./AccountGetAccountResponseStatus";
20
22
  export * from "./AccountGetAccountResponse";
21
23
  export * from "./AccountUpdateAccountResponseChannel";
24
+ export * from "./AccountUpdateAccountResponseOwner";
22
25
  export * from "./AccountUpdateAccountResponseStatus";
23
26
  export * from "./AccountUpdateAccountResponse";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./AccountListAccountsResponseItemChannel"), exports);
18
+ __exportStar(require("./AccountListAccountsResponseItemOwner"), exports);
18
19
  __exportStar(require("./AccountListAccountsResponseItemStatus"), exports);
19
20
  __exportStar(require("./AccountListAccountsResponseItem"), exports);
20
21
  __exportStar(require("./AccountLinkAccountRequestMode"), exports);
@@ -32,8 +33,10 @@ __exportStar(require("./AccountListGroupsResponse"), exports);
32
33
  __exportStar(require("./AccountGetGroupResponseMembersItem"), exports);
33
34
  __exportStar(require("./AccountGetGroupResponse"), exports);
34
35
  __exportStar(require("./AccountGetAccountResponseChannel"), exports);
36
+ __exportStar(require("./AccountGetAccountResponseOwner"), exports);
35
37
  __exportStar(require("./AccountGetAccountResponseStatus"), exports);
36
38
  __exportStar(require("./AccountGetAccountResponse"), exports);
37
39
  __exportStar(require("./AccountUpdateAccountResponseChannel"), exports);
40
+ __exportStar(require("./AccountUpdateAccountResponseOwner"), exports);
38
41
  __exportStar(require("./AccountUpdateAccountResponseStatus"), exports);
39
42
  __exportStar(require("./AccountUpdateAccountResponse"), exports);
@@ -48,7 +48,19 @@ 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. 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.
51
+ * **One channel:** set `recipient` to a phone number (E.164), a WhatsApp group id, or an email address. The channel follows from it (or from `accountId`). An email needs a `subject`.
52
+ *
53
+ * **Several channels at once:** set `to` (`phone`, `email`) and `channels`, e.g. `[{ "channel": "WHATSAPP" }, { "channel": "EMAIL", "subject": "Your code" }]`. One message is created per channel, each with its own status, all sharing the returned `dispatchId`; `messages` lists them all. A channel entry may override `text`, `html` and `subject`. WhatsApp gets `text`, or the `html` converted to plain text.
54
+ *
55
+ * **Accounts:** without `accountId` (or `channels[].accountId`), your only active account on that channel is used. With several, a `400` asks you to choose; with none, `404`.
56
+ *
57
+ * **Files:** upload with `POST /media` (or use any public URL) and list them in `attachments`. Email takes up to 20 (25 MB in total), WhatsApp one. `mediaUrl`/`mediaType`/`mimeType`/`filename` are deprecated in favour of `attachments`.
58
+ *
59
+ * **Replies:** `replyToMessageId` instead of `recipient` answers a message in the account's history, threaded on its conversation (WhatsApp beta accounts and email accounts).
60
+ *
61
+ * WhatsApp text is limited to 1 600 characters. `simId` is a deprecated alias for `accountId`, removed 2026-12-16.
62
+ *
63
+ * Watermark: on the paid plans (Medium, Max) nothing is ever added to your messages. On the Free plan, a text message (WhatsApp) or an email ends with a "Sent with UnlimitedMessaging.app" line; media and product messages never do. `watermarked` on the message says whether it was added.
52
64
  *
53
65
  * @param {UnlimitedMessagingApi.MessageSendRequest} request
54
66
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
@@ -174,7 +174,19 @@ 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. 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.
177
+ * **One channel:** set `recipient` to a phone number (E.164), a WhatsApp group id, or an email address. The channel follows from it (or from `accountId`). An email needs a `subject`.
178
+ *
179
+ * **Several channels at once:** set `to` (`phone`, `email`) and `channels`, e.g. `[{ "channel": "WHATSAPP" }, { "channel": "EMAIL", "subject": "Your code" }]`. One message is created per channel, each with its own status, all sharing the returned `dispatchId`; `messages` lists them all. A channel entry may override `text`, `html` and `subject`. WhatsApp gets `text`, or the `html` converted to plain text.
180
+ *
181
+ * **Accounts:** without `accountId` (or `channels[].accountId`), your only active account on that channel is used. With several, a `400` asks you to choose; with none, `404`.
182
+ *
183
+ * **Files:** upload with `POST /media` (or use any public URL) and list them in `attachments`. Email takes up to 20 (25 MB in total), WhatsApp one. `mediaUrl`/`mediaType`/`mimeType`/`filename` are deprecated in favour of `attachments`.
184
+ *
185
+ * **Replies:** `replyToMessageId` instead of `recipient` answers a message in the account's history, threaded on its conversation (WhatsApp beta accounts and email accounts).
186
+ *
187
+ * WhatsApp text is limited to 1 600 characters. `simId` is a deprecated alias for `accountId`, removed 2026-12-16.
188
+ *
189
+ * Watermark: on the paid plans (Medium, Max) nothing is ever added to your messages. On the Free plan, a text message (WhatsApp) or an email ends with a "Sent with UnlimitedMessaging.app" line; media and product messages never do. `watermarked` on the message says whether it was added.
178
190
  *
179
191
  * @param {UnlimitedMessagingApi.MessageSendRequest} request
180
192
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
@@ -7,11 +7,21 @@ import * as UnlimitedMessagingApi from "../../../../index";
7
7
  * {}
8
8
  */
9
9
  export interface MessageSendRequest {
10
+ /** Single-channel send: an email address, a phone number (E.164) or a WhatsApp group id. Use `to` with `channels` to send on several channels at once. */
10
11
  recipient?: string;
11
12
  text?: string;
13
+ html?: string;
14
+ subject?: string;
15
+ attachments?: UnlimitedMessagingApi.MessageSendRequestAttachmentsItem[];
16
+ to?: UnlimitedMessagingApi.MessageSendRequestTo;
17
+ channels?: UnlimitedMessagingApi.MessageSendRequestChannelsItem[];
18
+ /** Deprecated: use `attachments` instead. */
12
19
  mediaUrl?: string;
20
+ /** Deprecated: use `attachments` instead (the type is derived from the MIME type). */
13
21
  mediaType?: UnlimitedMessagingApi.MessageSendRequestMediaType;
22
+ /** Deprecated: use `attachments[].mimeType` instead. */
14
23
  mimeType?: string;
24
+ /** Deprecated: use `attachments[].filename` instead. */
15
25
  filename?: string;
16
26
  /** `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
27
  priority?: UnlimitedMessagingApi.MessageSendRequestPriority;
@@ -23,11 +23,22 @@ 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
+ /** 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 and emails only. */
27
27
  watermarked: boolean;
28
+ /** The email subject. Null on channels without one. */
29
+ subject: string | null;
30
+ /** The rich body, as sent or received. Untrusted for an inbound message: sanitise before rendering. */
31
+ contentHtml: string | null;
32
+ /** Ties together the messages one send request created, one per channel. Null for inbound messages. */
33
+ dispatchId: string | null;
34
+ attachments: UnlimitedMessagingApi.MessageFindAllResponseDataItemAttachmentsItem[];
35
+ /** Deprecated: use `attachments` instead (this is the first one). */
28
36
  mediaUrl: string | null;
37
+ /** Deprecated: use `attachments` instead (this is the first one). */
29
38
  mediaType: string | null;
39
+ /** Deprecated: use `attachments` instead (this is the first one). */
30
40
  mimeType: string | null;
41
+ /** Deprecated: use `attachments` instead (this is the first one). */
31
42
  mediaFilename: string | null;
32
43
  /** 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
44
  transcript: string | null;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface MessageFindAllResponseDataItemAttachmentsItem {
5
+ url: string;
6
+ filename: string | null;
7
+ mimeType: string;
8
+ size: number;
9
+ /** Set for an inline image the HTML body references as cid:<contentId>. */
10
+ contentId: string | null;
11
+ }
@@ -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 });
@@ -23,11 +23,22 @@ 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
+ /** 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 and emails only. */
27
27
  watermarked: boolean;
28
+ /** The email subject. Null on channels without one. */
29
+ subject: string | null;
30
+ /** The rich body, as sent or received. Untrusted for an inbound message: sanitise before rendering. */
31
+ contentHtml: string | null;
32
+ /** Ties together the messages one send request created, one per channel. Null for inbound messages. */
33
+ dispatchId: string | null;
34
+ attachments: UnlimitedMessagingApi.MessageFindOneResponseAttachmentsItem[];
35
+ /** Deprecated: use `attachments` instead (this is the first one). */
28
36
  mediaUrl: string | null;
37
+ /** Deprecated: use `attachments` instead (this is the first one). */
29
38
  mediaType: string | null;
39
+ /** Deprecated: use `attachments` instead (this is the first one). */
30
40
  mimeType: string | null;
41
+ /** Deprecated: use `attachments` instead (this is the first one). */
31
42
  mediaFilename: string | null;
32
43
  /** 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
44
  transcript: string | null;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface MessageFindOneResponseAttachmentsItem {
5
+ url: string;
6
+ filename: string | null;
7
+ mimeType: string;
8
+ size: number;
9
+ /** Set for an inline image the HTML body references as cid:<contentId>. */
10
+ contentId: string | null;
11
+ }
@@ -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,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface MessageSendRequestAttachmentsItem {
5
+ url: string;
6
+ filename?: string;
7
+ mimeType?: string;
8
+ contentId?: string;
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,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as UnlimitedMessagingApi from "../../../index";
5
+ export interface MessageSendRequestChannelsItem {
6
+ channel: UnlimitedMessagingApi.MessageSendRequestChannelsItemChannel;
7
+ accountId?: string;
8
+ text?: string;
9
+ html?: string;
10
+ subject?: string;
11
+ }
@@ -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,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type MessageSendRequestChannelsItemChannel = "WHATSAPP" | "EMAIL";
5
+ export declare const MessageSendRequestChannelsItemChannel: {
6
+ readonly Whatsapp: "WHATSAPP";
7
+ readonly Email: "EMAIL";
8
+ };
@@ -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.MessageSendRequestChannelsItemChannel = void 0;
7
+ exports.MessageSendRequestChannelsItemChannel = {
8
+ Whatsapp: "WHATSAPP",
9
+ Email: "EMAIL",
10
+ };
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ /**
5
+ * Deprecated: use `attachments` instead (the type is derived from the MIME type).
6
+ */
4
7
  export type MessageSendRequestMediaType = "image" | "document" | "audio";
5
8
  export declare const MessageSendRequestMediaType: {
6
9
  readonly Image: "image";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface MessageSendRequestTo {
5
+ phone?: string;
6
+ email?: string;
7
+ }
@@ -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 });
@@ -23,11 +23,21 @@ 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
+ /** 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 and emails only. */
27
27
  watermarked: boolean;
28
+ /** The email subject. Null on channels without one. */
29
+ subject: string | null;
30
+ /** The rich body, as sent or received. Untrusted for an inbound message: sanitise before rendering. */
31
+ contentHtml: string | null;
32
+ dispatchId: string;
33
+ attachments: UnlimitedMessagingApi.MessageSendResponseAttachmentsItem[];
34
+ /** Deprecated: use `attachments` instead (this is the first one). */
28
35
  mediaUrl: string | null;
36
+ /** Deprecated: use `attachments` instead (this is the first one). */
29
37
  mediaType: string | null;
38
+ /** Deprecated: use `attachments` instead (this is the first one). */
30
39
  mimeType: string | null;
40
+ /** Deprecated: use `attachments` instead (this is the first one). */
31
41
  mediaFilename: string | null;
32
42
  /** 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
43
  transcript: string | null;
@@ -38,4 +48,6 @@ export interface MessageSendResponse {
38
48
  deletedAt: Date | null;
39
49
  createdAt: Date;
40
50
  updatedAt: Date;
51
+ /** Every message this request created, one per channel, in the order of `channels`. */
52
+ messages: UnlimitedMessagingApi.MessageSendResponseMessagesItem[];
41
53
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface MessageSendResponseAttachmentsItem {
5
+ url: string;
6
+ filename: string | null;
7
+ mimeType: string;
8
+ size: number;
9
+ /** Set for an inline image the HTML body references as cid:<contentId>. */
10
+ contentId: string | null;
11
+ }
@@ -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,52 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as UnlimitedMessagingApi from "../../../index";
5
+ export interface MessageSendResponseMessagesItem {
6
+ id: string;
7
+ content: string | null;
8
+ direction: UnlimitedMessagingApi.MessageSendResponseMessagesItemDirection;
9
+ /** True when the account holder sent this message (direction OUT), false when they received it (direction IN). Redundant with direction, but spares the client from having to know which enum value means "we sent it" - the same convention as WhatsApp's own fromMe. */
10
+ fromMe: boolean;
11
+ externalId: string | null;
12
+ error: string | null;
13
+ /** Meaning depends on direction and isGroup. 1:1 chat: the other party's phone number, both directions. Group + direction IN: the participant who posted the message. Group + direction OUT: the group's own bare id, since an outbound message's author is always the account holder (never the account holder's own number). For who a reply specifically targets, see replyToParticipant instead. */
14
+ interlocutor: string;
15
+ conversationId: string | null;
16
+ isGroup: boolean;
17
+ /** The externalId of the message this one quotes as a reply, or null if it isn't a reply. */
18
+ replyToExternalId: string | null;
19
+ /** For a reply to a group message, the phone number of whoever posted the message being replied to - not necessarily the same as interlocutor. Null outside that case. */
20
+ replyToParticipant: string | null;
21
+ retryCount: number;
22
+ messagingAccountId: string;
23
+ status: UnlimitedMessagingApi.MessageSendResponseMessagesItemStatus;
24
+ channel: UnlimitedMessagingApi.MessageSendResponseMessagesItemChannel;
25
+ accountChannel: UnlimitedMessagingApi.MessageSendResponseMessagesItemAccountChannel;
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 and emails only. */
27
+ watermarked: boolean;
28
+ /** The email subject. Null on channels without one. */
29
+ subject: string | null;
30
+ /** The rich body, as sent or received. Untrusted for an inbound message: sanitise before rendering. */
31
+ contentHtml: string | null;
32
+ /** Ties together the messages one send request created, one per channel. Null for inbound messages. */
33
+ dispatchId: string | null;
34
+ attachments: UnlimitedMessagingApi.MessageSendResponseMessagesItemAttachmentsItem[];
35
+ /** Deprecated: use `attachments` instead (this is the first one). */
36
+ mediaUrl: string | null;
37
+ /** Deprecated: use `attachments` instead (this is the first one). */
38
+ mediaType: string | null;
39
+ /** Deprecated: use `attachments` instead (this is the first one). */
40
+ mimeType: string | null;
41
+ /** Deprecated: use `attachments` instead (this is the first one). */
42
+ mediaFilename: string | null;
43
+ /** 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. */
44
+ transcript: string | null;
45
+ productData: Record<string, unknown> | null;
46
+ /** 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. */
47
+ sentAt: Date | null;
48
+ /** When the message was deleted for everyone, null if it was not. */
49
+ deletedAt: Date | null;
50
+ createdAt: Date;
51
+ updatedAt: Date;
52
+ }
@@ -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,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type MessageSendResponseMessagesItemAccountChannel = "WHATSAPP_BAILYES" | "EMAIL" | "SMS" | "WHATSAPP_WHATSMEOW";
5
+ export declare const MessageSendResponseMessagesItemAccountChannel: {
6
+ readonly WhatsappBailyes: "WHATSAPP_BAILYES";
7
+ readonly Email: "EMAIL";
8
+ readonly Sms: "SMS";
9
+ readonly WhatsappWhatsmeow: "WHATSAPP_WHATSMEOW";
10
+ };
@@ -0,0 +1,12 @@
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.MessageSendResponseMessagesItemAccountChannel = void 0;
7
+ exports.MessageSendResponseMessagesItemAccountChannel = {
8
+ WhatsappBailyes: "WHATSAPP_BAILYES",
9
+ Email: "EMAIL",
10
+ Sms: "SMS",
11
+ WhatsappWhatsmeow: "WHATSAPP_WHATSMEOW",
12
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface MessageSendResponseMessagesItemAttachmentsItem {
5
+ url: string;
6
+ filename: string | null;
7
+ mimeType: string;
8
+ size: number;
9
+ /** Set for an inline image the HTML body references as cid:<contentId>. */
10
+ contentId: string | null;
11
+ }
@@ -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,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type MessageSendResponseMessagesItemChannel = "WHATSAPP" | "SMS" | "EMAIL";
5
+ export declare const MessageSendResponseMessagesItemChannel: {
6
+ readonly Whatsapp: "WHATSAPP";
7
+ readonly Sms: "SMS";
8
+ readonly Email: "EMAIL";
9
+ };
@@ -0,0 +1,11 @@
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.MessageSendResponseMessagesItemChannel = void 0;
7
+ exports.MessageSendResponseMessagesItemChannel = {
8
+ Whatsapp: "WHATSAPP",
9
+ Sms: "SMS",
10
+ Email: "EMAIL",
11
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type MessageSendResponseMessagesItemDirection = "IN" | "OUT";
5
+ export declare const MessageSendResponseMessagesItemDirection: {
6
+ readonly In: "IN";
7
+ readonly Out: "OUT";
8
+ };
@@ -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.MessageSendResponseMessagesItemDirection = void 0;
7
+ exports.MessageSendResponseMessagesItemDirection = {
8
+ In: "IN",
9
+ Out: "OUT",
10
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type MessageSendResponseMessagesItemStatus = "PENDING" | "SENDING" | "SENT" | "DELIVERED" | "READ" | "FAILED" | "UNDELIVERABLE";
5
+ export declare const MessageSendResponseMessagesItemStatus: {
6
+ readonly Pending: "PENDING";
7
+ readonly Sending: "SENDING";
8
+ readonly Sent: "SENT";
9
+ readonly Delivered: "DELIVERED";
10
+ readonly Read: "READ";
11
+ readonly Failed: "FAILED";
12
+ readonly Undeliverable: "UNDELIVERABLE";
13
+ };