sendblue 3.15.0 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +1 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/groups.d.mts +1 -1
  12. package/resources/groups.d.mts.map +1 -1
  13. package/resources/groups.d.ts +1 -1
  14. package/resources/groups.d.ts.map +1 -1
  15. package/resources/index.d.mts +1 -1
  16. package/resources/index.d.mts.map +1 -1
  17. package/resources/index.d.ts +1 -1
  18. package/resources/index.d.ts.map +1 -1
  19. package/resources/index.js +1 -1
  20. package/resources/index.js.map +1 -1
  21. package/resources/index.mjs +1 -1
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/messages/index.d.mts +3 -0
  24. package/resources/messages/index.d.mts.map +1 -0
  25. package/resources/messages/index.d.ts +3 -0
  26. package/resources/messages/index.d.ts.map +1 -0
  27. package/resources/messages/index.js +9 -0
  28. package/resources/messages/index.js.map +1 -0
  29. package/resources/messages/index.mjs +4 -0
  30. package/resources/messages/index.mjs.map +1 -0
  31. package/resources/messages/messages.d.mts +1071 -0
  32. package/resources/messages/messages.d.mts.map +1 -0
  33. package/resources/messages/messages.d.ts +1071 -0
  34. package/resources/messages/messages.d.ts.map +1 -0
  35. package/resources/messages/messages.js +105 -0
  36. package/resources/messages/messages.js.map +1 -0
  37. package/resources/messages/messages.mjs +100 -0
  38. package/resources/messages/messages.mjs.map +1 -0
  39. package/resources/messages/v2/index.d.mts +3 -0
  40. package/resources/messages/v2/index.d.mts.map +1 -0
  41. package/resources/messages/v2/index.d.ts +3 -0
  42. package/resources/messages/v2/index.d.ts.map +1 -0
  43. package/resources/{v2/groups → messages/v2}/index.js +3 -3
  44. package/resources/messages/v2/index.js.map +1 -0
  45. package/resources/{v2/groups → messages/v2}/index.mjs +1 -1
  46. package/resources/messages/v2/index.mjs.map +1 -0
  47. package/resources/messages/v2/v2.d.mts +10 -0
  48. package/resources/messages/v2/v2.d.mts.map +1 -0
  49. package/resources/messages/v2/v2.d.ts +10 -0
  50. package/resources/messages/v2/v2.d.ts.map +1 -0
  51. package/resources/messages/v2/v2.js +17 -0
  52. package/resources/messages/v2/v2.js.map +1 -0
  53. package/resources/messages/v2/v2.mjs +12 -0
  54. package/resources/messages/v2/v2.mjs.map +1 -0
  55. package/resources/messages/v2/verify/index.d.mts.map +1 -0
  56. package/resources/messages/v2/verify/index.d.ts.map +1 -0
  57. package/resources/messages/v2/verify/index.js.map +1 -0
  58. package/resources/messages/v2/verify/index.mjs.map +1 -0
  59. package/resources/messages/v2/verify/services/index.d.mts.map +1 -0
  60. package/resources/messages/v2/verify/services/index.d.ts.map +1 -0
  61. package/resources/messages/v2/verify/services/index.js.map +1 -0
  62. package/resources/messages/v2/verify/services/index.mjs.map +1 -0
  63. package/resources/messages/v2/verify/services/services.d.mts.map +1 -0
  64. package/resources/messages/v2/verify/services/services.d.ts.map +1 -0
  65. package/resources/messages/v2/verify/services/services.js.map +1 -0
  66. package/resources/messages/v2/verify/services/services.mjs.map +1 -0
  67. package/resources/{v2/groups → messages/v2}/verify/services/verifications.d.mts +2 -2
  68. package/resources/messages/v2/verify/services/verifications.d.mts.map +1 -0
  69. package/resources/{v2/groups → messages/v2}/verify/services/verifications.d.ts +2 -2
  70. package/resources/messages/v2/verify/services/verifications.d.ts.map +1 -0
  71. package/resources/{v2/groups → messages/v2}/verify/services/verifications.js +2 -2
  72. package/resources/messages/v2/verify/services/verifications.js.map +1 -0
  73. package/resources/{v2/groups → messages/v2}/verify/services/verifications.mjs +2 -2
  74. package/resources/messages/v2/verify/services/verifications.mjs.map +1 -0
  75. package/resources/messages/v2/verify/services.d.mts.map +1 -0
  76. package/resources/messages/v2/verify/services.d.ts.map +1 -0
  77. package/resources/messages/v2/verify/services.js.map +1 -0
  78. package/resources/messages/v2/verify/services.mjs.map +1 -0
  79. package/resources/messages/v2/verify/verify.d.mts.map +1 -0
  80. package/resources/messages/v2/verify/verify.d.ts.map +1 -0
  81. package/resources/messages/v2/verify/verify.js.map +1 -0
  82. package/resources/messages/v2/verify/verify.mjs.map +1 -0
  83. package/resources/messages/v2/verify.d.mts.map +1 -0
  84. package/resources/messages/v2/verify.d.ts.map +1 -0
  85. package/resources/messages/v2/verify.js.map +1 -0
  86. package/resources/messages/v2/verify.mjs.map +1 -0
  87. package/resources/messages/v2.d.mts +2 -0
  88. package/resources/messages/v2.d.mts.map +1 -0
  89. package/resources/messages/v2.d.ts +2 -0
  90. package/resources/messages/v2.d.ts.map +1 -0
  91. package/resources/messages/v2.js +6 -0
  92. package/resources/messages/v2.js.map +1 -0
  93. package/resources/messages/v2.mjs +3 -0
  94. package/resources/messages/v2.mjs.map +1 -0
  95. package/resources/messages.d.mts +1 -1066
  96. package/resources/messages.d.mts.map +1 -1
  97. package/resources/messages.d.ts +1 -1066
  98. package/resources/messages.d.ts.map +1 -1
  99. package/resources/messages.js +2 -93
  100. package/resources/messages.js.map +1 -1
  101. package/resources/messages.mjs +1 -91
  102. package/resources/messages.mjs.map +1 -1
  103. package/resources/v2/groups.d.mts +119 -1
  104. package/resources/v2/groups.d.mts.map +1 -1
  105. package/resources/v2/groups.d.ts +119 -1
  106. package/resources/v2/groups.d.ts.map +1 -1
  107. package/resources/v2/groups.js +43 -2
  108. package/resources/v2/groups.js.map +1 -1
  109. package/resources/v2/groups.mjs +41 -1
  110. package/resources/v2/groups.mjs.map +1 -1
  111. package/resources/v2/index.d.mts +1 -1
  112. package/resources/v2/index.d.mts.map +1 -1
  113. package/resources/v2/index.d.ts +1 -1
  114. package/resources/v2/index.d.ts.map +1 -1
  115. package/resources/v2/index.js +4 -4
  116. package/resources/v2/index.js.map +1 -1
  117. package/resources/v2/index.mjs +1 -1
  118. package/resources/v2/index.mjs.map +1 -1
  119. package/resources/v2/v2.d.mts +3 -3
  120. package/resources/v2/v2.d.mts.map +1 -1
  121. package/resources/v2/v2.d.ts +3 -3
  122. package/resources/v2/v2.d.ts.map +1 -1
  123. package/resources/v2/v2.js +2 -2
  124. package/resources/v2/v2.js.map +1 -1
  125. package/resources/v2/v2.mjs +2 -2
  126. package/resources/v2/v2.mjs.map +1 -1
  127. package/src/client.ts +11 -11
  128. package/src/resources/groups.ts +1 -1
  129. package/src/resources/index.ts +1 -1
  130. package/src/resources/messages/index.ts +14 -0
  131. package/src/resources/messages/messages.ts +1444 -0
  132. package/src/resources/{v2/groups → messages/v2}/index.ts +1 -1
  133. package/src/resources/messages/v2/v2.ts +15 -0
  134. package/src/resources/{v2/groups → messages/v2}/verify/services/verifications.ts +2 -2
  135. package/src/resources/messages/v2.ts +3 -0
  136. package/src/resources/messages.ts +1 -1434
  137. package/src/resources/v2/groups.ts +159 -1
  138. package/src/resources/v2/index.ts +6 -1
  139. package/src/resources/v2/v2.ts +8 -3
  140. package/src/version.ts +1 -1
  141. package/version.d.mts +1 -1
  142. package/version.d.ts +1 -1
  143. package/version.js +1 -1
  144. package/version.mjs +1 -1
  145. package/resources/v2/groups/groups.d.mts +0 -86
  146. package/resources/v2/groups/groups.d.mts.map +0 -1
  147. package/resources/v2/groups/groups.d.ts +0 -86
  148. package/resources/v2/groups/groups.d.ts.map +0 -1
  149. package/resources/v2/groups/groups.js +0 -35
  150. package/resources/v2/groups/groups.js.map +0 -1
  151. package/resources/v2/groups/groups.mjs +0 -30
  152. package/resources/v2/groups/groups.mjs.map +0 -1
  153. package/resources/v2/groups/index.d.mts +0 -3
  154. package/resources/v2/groups/index.d.mts.map +0 -1
  155. package/resources/v2/groups/index.d.ts +0 -3
  156. package/resources/v2/groups/index.d.ts.map +0 -1
  157. package/resources/v2/groups/index.js.map +0 -1
  158. package/resources/v2/groups/index.mjs.map +0 -1
  159. package/resources/v2/groups/verify/index.d.mts.map +0 -1
  160. package/resources/v2/groups/verify/index.d.ts.map +0 -1
  161. package/resources/v2/groups/verify/index.js.map +0 -1
  162. package/resources/v2/groups/verify/index.mjs.map +0 -1
  163. package/resources/v2/groups/verify/services/index.d.mts.map +0 -1
  164. package/resources/v2/groups/verify/services/index.d.ts.map +0 -1
  165. package/resources/v2/groups/verify/services/index.js.map +0 -1
  166. package/resources/v2/groups/verify/services/index.mjs.map +0 -1
  167. package/resources/v2/groups/verify/services/services.d.mts.map +0 -1
  168. package/resources/v2/groups/verify/services/services.d.ts.map +0 -1
  169. package/resources/v2/groups/verify/services/services.js.map +0 -1
  170. package/resources/v2/groups/verify/services/services.mjs.map +0 -1
  171. package/resources/v2/groups/verify/services/verifications.d.mts.map +0 -1
  172. package/resources/v2/groups/verify/services/verifications.d.ts.map +0 -1
  173. package/resources/v2/groups/verify/services/verifications.js.map +0 -1
  174. package/resources/v2/groups/verify/services/verifications.mjs.map +0 -1
  175. package/resources/v2/groups/verify/services.d.mts.map +0 -1
  176. package/resources/v2/groups/verify/services.d.ts.map +0 -1
  177. package/resources/v2/groups/verify/services.js.map +0 -1
  178. package/resources/v2/groups/verify/services.mjs.map +0 -1
  179. package/resources/v2/groups/verify/verify.d.mts.map +0 -1
  180. package/resources/v2/groups/verify/verify.d.ts.map +0 -1
  181. package/resources/v2/groups/verify/verify.js.map +0 -1
  182. package/resources/v2/groups/verify/verify.mjs.map +0 -1
  183. package/resources/v2/groups/verify.d.mts.map +0 -1
  184. package/resources/v2/groups/verify.d.ts.map +0 -1
  185. package/resources/v2/groups/verify.js.map +0 -1
  186. package/resources/v2/groups/verify.mjs.map +0 -1
  187. package/src/resources/v2/groups/groups.ts +0 -114
  188. /package/resources/{v2/groups → messages/v2}/verify/index.d.mts +0 -0
  189. /package/resources/{v2/groups → messages/v2}/verify/index.d.ts +0 -0
  190. /package/resources/{v2/groups → messages/v2}/verify/index.js +0 -0
  191. /package/resources/{v2/groups → messages/v2}/verify/index.mjs +0 -0
  192. /package/resources/{v2/groups → messages/v2}/verify/services/index.d.mts +0 -0
  193. /package/resources/{v2/groups → messages/v2}/verify/services/index.d.ts +0 -0
  194. /package/resources/{v2/groups → messages/v2}/verify/services/index.js +0 -0
  195. /package/resources/{v2/groups → messages/v2}/verify/services/index.mjs +0 -0
  196. /package/resources/{v2/groups → messages/v2}/verify/services/services.d.mts +0 -0
  197. /package/resources/{v2/groups → messages/v2}/verify/services/services.d.ts +0 -0
  198. /package/resources/{v2/groups → messages/v2}/verify/services/services.js +0 -0
  199. /package/resources/{v2/groups → messages/v2}/verify/services/services.mjs +0 -0
  200. /package/resources/{v2/groups → messages/v2}/verify/services.d.mts +0 -0
  201. /package/resources/{v2/groups → messages/v2}/verify/services.d.ts +0 -0
  202. /package/resources/{v2/groups → messages/v2}/verify/services.js +0 -0
  203. /package/resources/{v2/groups → messages/v2}/verify/services.mjs +0 -0
  204. /package/resources/{v2/groups → messages/v2}/verify/verify.d.mts +0 -0
  205. /package/resources/{v2/groups → messages/v2}/verify/verify.d.ts +0 -0
  206. /package/resources/{v2/groups → messages/v2}/verify/verify.js +0 -0
  207. /package/resources/{v2/groups → messages/v2}/verify/verify.mjs +0 -0
  208. /package/resources/{v2/groups → messages/v2}/verify.d.mts +0 -0
  209. /package/resources/{v2/groups → messages/v2}/verify.d.ts +0 -0
  210. /package/resources/{v2/groups → messages/v2}/verify.js +0 -0
  211. /package/resources/{v2/groups → messages/v2}/verify.mjs +0 -0
  212. /package/src/resources/{v2/groups → messages/v2}/verify/index.ts +0 -0
  213. /package/src/resources/{v2/groups → messages/v2}/verify/services/index.ts +0 -0
  214. /package/src/resources/{v2/groups → messages/v2}/verify/services/services.ts +0 -0
  215. /package/src/resources/{v2/groups → messages/v2}/verify/services.ts +0 -0
  216. /package/src/resources/{v2/groups → messages/v2}/verify/verify.ts +0 -0
  217. /package/src/resources/{v2/groups → messages/v2}/verify.ts +0 -0
@@ -0,0 +1,1444 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as V2API from './v2/v2';
5
+ import { V2 } from './v2/v2';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+ import { path } from '../../internal/utils/path';
9
+
10
+ /**
11
+ * Operations for sending and managing messages
12
+ */
13
+ export class Messages extends APIResource {
14
+ v2: V2API.V2 = new V2API.V2(this._client);
15
+
16
+ /**
17
+ * Retrieve details of a specific message by its ID
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const message = await client.messages.retrieve(
22
+ * 'msg_abc123def456',
23
+ * );
24
+ * ```
25
+ */
26
+ retrieve(messageID: string, options?: RequestOptions): APIPromise<MessageRetrieveResponse> {
27
+ return this._client.get(path`/api/v2/messages/${messageID}`, options);
28
+ }
29
+
30
+ /**
31
+ * Retrieve a list of messages for the authenticated account with comprehensive
32
+ * filtering capabilities. Rate limited to 100 requests per 10 seconds per account.
33
+ *
34
+ * ## Common Use Cases
35
+ *
36
+ * **Polling for inbound messages (no webhooks):**
37
+ *
38
+ * ```
39
+ * GET /api/v2/messages?is_outbound=false&sendblue_number=+16292925296&order_by=createdAt&order_direction=desc&limit=50
40
+ * ```
41
+ *
42
+ * Track processed message IDs to avoid duplicates.
43
+ *
44
+ * **Get conversation with a specific contact:**
45
+ *
46
+ * ```
47
+ * GET /api/v2/messages?number=+15551234567&order_by=createdAt&order_direction=desc
48
+ * ```
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const messages = await client.messages.list();
53
+ * ```
54
+ */
55
+ list(
56
+ query: MessageListParams | null | undefined = {},
57
+ options?: RequestOptions,
58
+ ): APIPromise<MessageListResponse> {
59
+ return this._client.get('/api/v2/messages', { query, ...options });
60
+ }
61
+
62
+ /**
63
+ * Retrieve the current status of a message using its message handle. Useful for
64
+ * resolving pending message statuses and avoiding duplicate messages.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const messageResponse = await client.messages.getStatus({
69
+ * handle: 'msg_abc123def456',
70
+ * });
71
+ * ```
72
+ */
73
+ getStatus(query: MessageGetStatusParams, options?: RequestOptions): APIPromise<MessageResponse> {
74
+ return this._client.get('/api/status', { query, ...options });
75
+ }
76
+
77
+ /**
78
+ * Send an iMessage, SMS, MMS, or Sendblue App Card to a single recipient
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * const messageResponse = await client.messages.send({
83
+ * from_number: '+19998887777',
84
+ * number: '+19998887777',
85
+ * });
86
+ * ```
87
+ */
88
+ send(body: MessageSendParams, options?: RequestOptions): APIPromise<MessageResponse> {
89
+ return this._client.post('/api/send-message', { body, ...options });
90
+ }
91
+
92
+ /**
93
+ * Continues an existing App Card by sending a new Apple message in the same
94
+ * iMessage session, from the same sender line and inline-reply context. The
95
+ * continuation receives its own message handle and delivery/read status updates.
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * const messageResponse = await client.messages.updateAppCard(
100
+ * 'message_handle',
101
+ * );
102
+ * ```
103
+ */
104
+ updateAppCard(
105
+ messageHandle: string,
106
+ body: MessageUpdateAppCardParams,
107
+ options?: RequestOptions,
108
+ ): APIPromise<MessageResponse> {
109
+ return this._client.post(path`/api/messages/${messageHandle}/update-app-card`, { body, ...options });
110
+ }
111
+ }
112
+
113
+ export interface MessageContent {
114
+ /**
115
+ * Email of the account
116
+ */
117
+ account_email?: string;
118
+
119
+ /**
120
+ * Message content
121
+ */
122
+ content?: string;
123
+
124
+ /**
125
+ * When the message was created
126
+ */
127
+ date_created?: string;
128
+
129
+ /**
130
+ * When the message was sent
131
+ */
132
+ date_sent?: string;
133
+
134
+ /**
135
+ * When the message was last updated
136
+ */
137
+ date_updated?: string;
138
+
139
+ /**
140
+ * Sender phone number
141
+ */
142
+ from_number?: string;
143
+
144
+ /**
145
+ * Whether this is an outbound message
146
+ */
147
+ is_outbound?: boolean;
148
+
149
+ /**
150
+ * URL of attached media
151
+ */
152
+ media_url?: string;
153
+
154
+ /**
155
+ * Unique message identifier
156
+ */
157
+ message_handle?: string;
158
+
159
+ /**
160
+ * Immediate parent of an iMessage inline reply. The target must belong to the same
161
+ * account, conversation, and sending line.
162
+ */
163
+ reply_to?: MessageContent.ReplyTo;
164
+
165
+ /**
166
+ * UUID of the seat that sent the message. Present when `seat_id` was provided on
167
+ * send, or for dashboard-originated group messages.
168
+ */
169
+ seat_id?: string | null;
170
+
171
+ send_style?:
172
+ | 'celebration'
173
+ | 'shooting_star'
174
+ | 'fireworks'
175
+ | 'lasers'
176
+ | 'love'
177
+ | 'confetti'
178
+ | 'balloons'
179
+ | 'spotlight'
180
+ | 'echo'
181
+ | 'invisible'
182
+ | 'gentle'
183
+ | 'loud'
184
+ | 'slam';
185
+
186
+ /**
187
+ * Email of the seat (user) that sent the message. Auto-populated when a `seat_id`
188
+ * is provided on send. `null` for messages sent without a `seat_id`.
189
+ */
190
+ sender_email?: string | null;
191
+
192
+ status?: 'QUEUED' | 'SENT' | 'DELIVERED' | 'ERROR' | 'RECEIVED';
193
+
194
+ /**
195
+ * Message that originated an iMessage inline-reply thread.
196
+ */
197
+ thread_originator?: MessageContent.ThreadOriginator;
198
+
199
+ /**
200
+ * Recipient phone number
201
+ */
202
+ to_number?: string;
203
+ }
204
+
205
+ export namespace MessageContent {
206
+ /**
207
+ * Immediate parent of an iMessage inline reply. The target must belong to the same
208
+ * account, conversation, and sending line.
209
+ */
210
+ export interface ReplyTo {
211
+ /**
212
+ * Public handle of the immediate parent message
213
+ */
214
+ message_handle: string;
215
+
216
+ /**
217
+ * Advanced override for a known part of a multipart target. Omit this in normal
218
+ * reply requests and never guess it; requests default to 0. When replying to an
219
+ * attachment represented by its own webhook, use that webhook's `message_handle`
220
+ * and omit `part_index` so Sendblue can use the stored authoritative part.
221
+ * Responses omit it when no authoritative immediate-parent part is available.
222
+ */
223
+ part_index?: number;
224
+ }
225
+
226
+ /**
227
+ * Message that originated an iMessage inline-reply thread.
228
+ */
229
+ export interface ThreadOriginator {
230
+ /**
231
+ * Public handle of the thread's root message
232
+ */
233
+ message_handle: string;
234
+
235
+ /**
236
+ * Opaque Apple thread-originator part descriptor
237
+ */
238
+ part?: string;
239
+ }
240
+ }
241
+
242
+ export interface MessageResponse {
243
+ /**
244
+ * Email of the account that sent the message
245
+ */
246
+ account_email?: string;
247
+
248
+ /**
249
+ * App Card data sent or received with this message.
250
+ */
251
+ app_card?: MessageResponse.AppCard | MessageResponse.InboundAppCard;
252
+
253
+ /**
254
+ * Message content
255
+ */
256
+ content?: string;
257
+
258
+ /**
259
+ * When the message was created
260
+ */
261
+ date_created?: string;
262
+
263
+ /**
264
+ * When the message was last updated
265
+ */
266
+ date_updated?: string;
267
+
268
+ /**
269
+ * Numeric error code if message failed
270
+ */
271
+ error_code?: number;
272
+
273
+ /**
274
+ * Error message if message failed
275
+ */
276
+ error_message?: string;
277
+
278
+ /**
279
+ * Sending phone number
280
+ */
281
+ from_number?: string;
282
+
283
+ /**
284
+ * Whether this is an outbound message
285
+ */
286
+ is_outbound?: boolean;
287
+
288
+ /**
289
+ * Decoded Find My location share coordinates.
290
+ */
291
+ location?: MessageResponse.Location;
292
+
293
+ /**
294
+ * URL of attached media
295
+ */
296
+ media_url?: string;
297
+
298
+ /**
299
+ * Unique identifier for tracking the message
300
+ */
301
+ message_handle?: string;
302
+
303
+ message_type?: 'message' | 'group' | 'location';
304
+
305
+ /**
306
+ * Recipient phone number
307
+ */
308
+ number?: string;
309
+
310
+ /**
311
+ * Immediate parent of an iMessage inline reply. The target must belong to the same
312
+ * account, conversation, and sending line.
313
+ */
314
+ reply_to?: MessageResponse.ReplyTo;
315
+
316
+ /**
317
+ * UUID of the seat that sent the message. Present when `seat_id` was provided on
318
+ * send, or for dashboard-originated group messages.
319
+ */
320
+ seat_id?: string | null;
321
+
322
+ /**
323
+ * The iMessage expressive message style
324
+ */
325
+ send_style?:
326
+ | 'celebration'
327
+ | 'shooting_star'
328
+ | 'fireworks'
329
+ | 'lasers'
330
+ | 'love'
331
+ | 'confetti'
332
+ | 'balloons'
333
+ | 'spotlight'
334
+ | 'echo'
335
+ | 'invisible'
336
+ | 'gentle'
337
+ | 'loud'
338
+ | 'slam';
339
+
340
+ /**
341
+ * Email of the seat (user) that sent the message. Auto-populated when a `seat_id`
342
+ * is provided on send. `null` for messages sent without a `seat_id`.
343
+ */
344
+ sender_email?: string | null;
345
+
346
+ status?: 'QUEUED' | 'SENT' | 'DELIVERED' | 'ERROR';
347
+
348
+ /**
349
+ * Message that originated an iMessage inline-reply thread.
350
+ */
351
+ thread_originator?: MessageResponse.ThreadOriginator;
352
+ }
353
+
354
+ export namespace MessageResponse {
355
+ /**
356
+ * A Sendblue App Card rendered with Apple's Messages framework. App Cards require
357
+ * a V2 Mac line and an iMessage-capable recipient; they never fall back to SMS.
358
+ * The URL is delivered to the identified Messages extension when the recipient
359
+ * taps the card. An initial App Card may include `reply_to` to create an inline
360
+ * reply. Later state changes use the update endpoint, which sends a new Apple
361
+ * message in the same App Card session. The feature is unavailable on the free
362
+ * plan.
363
+ */
364
+ export interface AppCard {
365
+ appName: string;
366
+
367
+ extensionBundleId: string;
368
+
369
+ /**
370
+ * Visible card fields mirroring Apple's MSMessageTemplateLayout.
371
+ */
372
+ layout: AppCard.Layout;
373
+
374
+ teamId: string;
375
+
376
+ /**
377
+ * URL delivered to the iMessage extension on tap. HTTPS URLs are limited to 2048
378
+ * characters; data URLs carrying inline app state are limited to 16384.
379
+ */
380
+ url: string;
381
+
382
+ /**
383
+ * Optional numeric App Store ID for recipients without the extension.
384
+ */
385
+ appStoreId?: number;
386
+
387
+ /**
388
+ * Fallback text for notifications and surfaces that cannot render the card.
389
+ */
390
+ fallbackText?: string;
391
+
392
+ /**
393
+ * Use Apple's live layout when the extension is installed; false always sends the
394
+ * static template layout.
395
+ */
396
+ interactive?: boolean;
397
+
398
+ /**
399
+ * Optional caller-supplied App Card session UUID. Generated automatically when
400
+ * omitted.
401
+ */
402
+ sessionIdentifier?: string;
403
+
404
+ /**
405
+ * Original message handle for an App Card continuation returned by the update
406
+ * endpoint.
407
+ */
408
+ updateMessageHandle?: string;
409
+ }
410
+
411
+ export namespace AppCard {
412
+ /**
413
+ * Visible card fields mirroring Apple's MSMessageTemplateLayout.
414
+ */
415
+ export interface Layout {
416
+ caption?: string;
417
+
418
+ /**
419
+ * Secondary text overlaid on the preview image. Requires imageUrl.
420
+ */
421
+ imageSubtitle?: string;
422
+
423
+ /**
424
+ * Text overlaid on the preview image. Requires imageUrl.
425
+ */
426
+ imageTitle?: string;
427
+
428
+ /**
429
+ * HTTPS preview image fetched by the worker and sent as a hidden card attachment.
430
+ * JPEG, PNG, HEIC, HEIF, and WebP are supported up to 10 MB.
431
+ */
432
+ imageUrl?: string;
433
+
434
+ subcaption?: string;
435
+
436
+ /**
437
+ * Fallback text used in notifications and non-rendering surfaces.
438
+ */
439
+ summary?: string;
440
+
441
+ trailingCaption?: string;
442
+
443
+ trailingSubcaption?: string;
444
+ }
445
+ }
446
+
447
+ /**
448
+ * App Card session metadata received from an iMessage contact.
449
+ */
450
+ export interface InboundAppCard {
451
+ balloonBundleId: string;
452
+
453
+ extensionBundleId: string;
454
+
455
+ /**
456
+ * Retry-stable occurrence revision assigned to this inbound App Card state.
457
+ */
458
+ revision: number;
459
+
460
+ sessionIdentifier: string;
461
+
462
+ teamId: string;
463
+
464
+ url: string;
465
+ }
466
+
467
+ /**
468
+ * Decoded Find My location share coordinates.
469
+ */
470
+ export interface Location {
471
+ latitude: number;
472
+
473
+ longitude: number;
474
+
475
+ /**
476
+ * Horizontal accuracy in meters
477
+ */
478
+ accuracy?: number;
479
+
480
+ /**
481
+ * Altitude in meters
482
+ */
483
+ altitude?: number;
484
+
485
+ /**
486
+ * Share duration selected by the recipient
487
+ */
488
+ duration?: string;
489
+
490
+ timestamp?: string;
491
+ }
492
+
493
+ /**
494
+ * Immediate parent of an iMessage inline reply. The target must belong to the same
495
+ * account, conversation, and sending line.
496
+ */
497
+ export interface ReplyTo {
498
+ /**
499
+ * Public handle of the immediate parent message
500
+ */
501
+ message_handle: string;
502
+
503
+ /**
504
+ * Advanced override for a known part of a multipart target. Omit this in normal
505
+ * reply requests and never guess it; requests default to 0. When replying to an
506
+ * attachment represented by its own webhook, use that webhook's `message_handle`
507
+ * and omit `part_index` so Sendblue can use the stored authoritative part.
508
+ * Responses omit it when no authoritative immediate-parent part is available.
509
+ */
510
+ part_index?: number;
511
+ }
512
+
513
+ /**
514
+ * Message that originated an iMessage inline-reply thread.
515
+ */
516
+ export interface ThreadOriginator {
517
+ /**
518
+ * Public handle of the thread's root message
519
+ */
520
+ message_handle: string;
521
+
522
+ /**
523
+ * Opaque Apple thread-originator part descriptor
524
+ */
525
+ part?: string;
526
+ }
527
+ }
528
+
529
+ export interface MessageRetrieveResponse {
530
+ data?: MessageRetrieveResponse.Data;
531
+
532
+ status?: string;
533
+ }
534
+
535
+ export namespace MessageRetrieveResponse {
536
+ export interface Data {
537
+ /**
538
+ * Email of the account
539
+ */
540
+ accountEmail?: string;
541
+
542
+ /**
543
+ * Message content
544
+ */
545
+ content?: string;
546
+
547
+ /**
548
+ * When the message was sent
549
+ */
550
+ date_sent?: string;
551
+
552
+ /**
553
+ * When the message was last updated
554
+ */
555
+ date_updated?: string;
556
+
557
+ /**
558
+ * Numeric error code if message failed
559
+ */
560
+ error_code?: number | null;
561
+
562
+ /**
563
+ * Detailed error information
564
+ */
565
+ error_detail?: string | null;
566
+
567
+ /**
568
+ * Error message if message failed
569
+ */
570
+ error_message?: string | null;
571
+
572
+ /**
573
+ * Error reason if message failed
574
+ */
575
+ error_reason?: string | null;
576
+
577
+ /**
578
+ * Sender phone number
579
+ */
580
+ from_number?: string;
581
+
582
+ /**
583
+ * Display name for group messages
584
+ */
585
+ group_display_name?: string | null;
586
+
587
+ /**
588
+ * Group ID for group messages
589
+ */
590
+ group_id?: string | null;
591
+
592
+ /**
593
+ * Whether this is an outbound message
594
+ */
595
+ is_outbound?: boolean;
596
+
597
+ /**
598
+ * Decoded Find My location share coordinates.
599
+ */
600
+ location?: Data.Location;
601
+
602
+ /**
603
+ * URL of attached media
604
+ */
605
+ media_url?: string | null;
606
+
607
+ /**
608
+ * Unique message identifier
609
+ */
610
+ message_handle?: string;
611
+
612
+ message_type?: 'message' | 'group' | 'location';
613
+
614
+ /**
615
+ * Primary phone number (to_number for outbound, from_number for inbound)
616
+ */
617
+ number?: string;
618
+
619
+ /**
620
+ * Whether the recipient has opted out
621
+ */
622
+ opted_out?: boolean;
623
+
624
+ /**
625
+ * List of participants for group messages
626
+ */
627
+ participants?: Array<string>;
628
+
629
+ /**
630
+ * Account plan used for this message
631
+ */
632
+ plan?: string;
633
+
634
+ /**
635
+ * Immediate parent of an iMessage inline reply. The target must belong to the same
636
+ * account, conversation, and sending line.
637
+ */
638
+ reply_to?: Data.ReplyTo;
639
+
640
+ /**
641
+ * UUID of the seat that sent the message. Present when `seat_id` was provided on
642
+ * send, or for dashboard-originated group messages.
643
+ */
644
+ seat_id?: string | null;
645
+
646
+ /**
647
+ * The iMessage expressive message style
648
+ */
649
+ send_style?:
650
+ | 'celebration'
651
+ | 'shooting_star'
652
+ | 'fireworks'
653
+ | 'lasers'
654
+ | 'love'
655
+ | 'confetti'
656
+ | 'balloons'
657
+ | 'spotlight'
658
+ | 'echo'
659
+ | 'invisible'
660
+ | 'gentle'
661
+ | 'loud'
662
+ | 'slam';
663
+
664
+ /**
665
+ * Sendblue phone number used
666
+ */
667
+ sendblue_number?: string | null;
668
+
669
+ /**
670
+ * Email of the seat (user) that sent the message. Auto-populated when a `seat_id`
671
+ * is provided on send. `null` for messages sent without a `seat_id`.
672
+ */
673
+ sender_email?: string | null;
674
+
675
+ /**
676
+ * The messaging service used
677
+ */
678
+ service?: 'iMessage' | 'SMS' | 'RCS';
679
+
680
+ status?:
681
+ | 'REGISTERED'
682
+ | 'PENDING'
683
+ | 'SENT'
684
+ | 'DELIVERED'
685
+ | 'RECEIVED'
686
+ | 'QUEUED'
687
+ | 'ERROR'
688
+ | 'DECLINED'
689
+ | 'ACCEPTED'
690
+ | 'SUCCESS';
691
+
692
+ /**
693
+ * Message that originated an iMessage inline-reply thread.
694
+ */
695
+ thread_originator?: Data.ThreadOriginator;
696
+
697
+ /**
698
+ * Recipient phone number
699
+ */
700
+ to_number?: string;
701
+
702
+ /**
703
+ * Whether the message was downgraded from iMessage to SMS
704
+ */
705
+ was_downgraded?: boolean;
706
+ }
707
+
708
+ export namespace Data {
709
+ /**
710
+ * Decoded Find My location share coordinates.
711
+ */
712
+ export interface Location {
713
+ latitude: number;
714
+
715
+ longitude: number;
716
+
717
+ /**
718
+ * Horizontal accuracy in meters
719
+ */
720
+ accuracy?: number;
721
+
722
+ /**
723
+ * Altitude in meters
724
+ */
725
+ altitude?: number;
726
+
727
+ /**
728
+ * Share duration selected by the recipient
729
+ */
730
+ duration?: string;
731
+
732
+ timestamp?: string;
733
+ }
734
+
735
+ /**
736
+ * Immediate parent of an iMessage inline reply. The target must belong to the same
737
+ * account, conversation, and sending line.
738
+ */
739
+ export interface ReplyTo {
740
+ /**
741
+ * Public handle of the immediate parent message
742
+ */
743
+ message_handle: string;
744
+
745
+ /**
746
+ * Advanced override for a known part of a multipart target. Omit this in normal
747
+ * reply requests and never guess it; requests default to 0. When replying to an
748
+ * attachment represented by its own webhook, use that webhook's `message_handle`
749
+ * and omit `part_index` so Sendblue can use the stored authoritative part.
750
+ * Responses omit it when no authoritative immediate-parent part is available.
751
+ */
752
+ part_index?: number;
753
+ }
754
+
755
+ /**
756
+ * Message that originated an iMessage inline-reply thread.
757
+ */
758
+ export interface ThreadOriginator {
759
+ /**
760
+ * Public handle of the thread's root message
761
+ */
762
+ message_handle: string;
763
+
764
+ /**
765
+ * Opaque Apple thread-originator part descriptor
766
+ */
767
+ part?: string;
768
+ }
769
+ }
770
+ }
771
+
772
+ export interface MessageListResponse {
773
+ data?: Array<MessageListResponse.Data>;
774
+
775
+ pagination?: MessageListResponse.Pagination;
776
+
777
+ status?: string;
778
+ }
779
+
780
+ export namespace MessageListResponse {
781
+ export interface Data {
782
+ /**
783
+ * Email of the account
784
+ */
785
+ accountEmail?: string;
786
+
787
+ /**
788
+ * Message content
789
+ */
790
+ content?: string;
791
+
792
+ /**
793
+ * When the message was sent
794
+ */
795
+ date_sent?: string;
796
+
797
+ /**
798
+ * When the message was last updated
799
+ */
800
+ date_updated?: string;
801
+
802
+ /**
803
+ * Numeric error code if message failed
804
+ */
805
+ error_code?: number | null;
806
+
807
+ /**
808
+ * Detailed error information
809
+ */
810
+ error_detail?: string | null;
811
+
812
+ /**
813
+ * Error message if message failed
814
+ */
815
+ error_message?: string | null;
816
+
817
+ /**
818
+ * Error reason if message failed
819
+ */
820
+ error_reason?: string | null;
821
+
822
+ /**
823
+ * Sender phone number
824
+ */
825
+ from_number?: string;
826
+
827
+ /**
828
+ * Display name for group messages
829
+ */
830
+ group_display_name?: string | null;
831
+
832
+ /**
833
+ * Group ID for group messages
834
+ */
835
+ group_id?: string | null;
836
+
837
+ /**
838
+ * Whether this is an outbound message
839
+ */
840
+ is_outbound?: boolean;
841
+
842
+ /**
843
+ * Decoded Find My location share coordinates.
844
+ */
845
+ location?: Data.Location;
846
+
847
+ /**
848
+ * URL of attached media
849
+ */
850
+ media_url?: string | null;
851
+
852
+ /**
853
+ * Unique message identifier
854
+ */
855
+ message_handle?: string;
856
+
857
+ message_type?: 'message' | 'group' | 'location';
858
+
859
+ /**
860
+ * Primary phone number (to_number for outbound, from_number for inbound)
861
+ */
862
+ number?: string;
863
+
864
+ /**
865
+ * Whether the recipient has opted out
866
+ */
867
+ opted_out?: boolean;
868
+
869
+ /**
870
+ * List of participants for group messages
871
+ */
872
+ participants?: Array<string>;
873
+
874
+ /**
875
+ * Account plan used for this message
876
+ */
877
+ plan?: string;
878
+
879
+ /**
880
+ * Immediate parent of an iMessage inline reply. The target must belong to the same
881
+ * account, conversation, and sending line.
882
+ */
883
+ reply_to?: Data.ReplyTo;
884
+
885
+ /**
886
+ * UUID of the seat that sent the message. Present when `seat_id` was provided on
887
+ * send, or for dashboard-originated group messages.
888
+ */
889
+ seat_id?: string | null;
890
+
891
+ /**
892
+ * The iMessage expressive message style
893
+ */
894
+ send_style?:
895
+ | 'celebration'
896
+ | 'shooting_star'
897
+ | 'fireworks'
898
+ | 'lasers'
899
+ | 'love'
900
+ | 'confetti'
901
+ | 'balloons'
902
+ | 'spotlight'
903
+ | 'echo'
904
+ | 'invisible'
905
+ | 'gentle'
906
+ | 'loud'
907
+ | 'slam';
908
+
909
+ /**
910
+ * Sendblue phone number used
911
+ */
912
+ sendblue_number?: string | null;
913
+
914
+ /**
915
+ * Email of the seat (user) that sent the message. Auto-populated when a `seat_id`
916
+ * is provided on send. `null` for messages sent without a `seat_id`.
917
+ */
918
+ sender_email?: string | null;
919
+
920
+ /**
921
+ * The messaging service used
922
+ */
923
+ service?: 'iMessage' | 'SMS' | 'RCS';
924
+
925
+ status?:
926
+ | 'REGISTERED'
927
+ | 'PENDING'
928
+ | 'SENT'
929
+ | 'DELIVERED'
930
+ | 'RECEIVED'
931
+ | 'QUEUED'
932
+ | 'ERROR'
933
+ | 'DECLINED'
934
+ | 'ACCEPTED'
935
+ | 'SUCCESS';
936
+
937
+ /**
938
+ * Message that originated an iMessage inline-reply thread.
939
+ */
940
+ thread_originator?: Data.ThreadOriginator;
941
+
942
+ /**
943
+ * Recipient phone number
944
+ */
945
+ to_number?: string;
946
+
947
+ /**
948
+ * Whether the message was downgraded from iMessage to SMS
949
+ */
950
+ was_downgraded?: boolean;
951
+ }
952
+
953
+ export namespace Data {
954
+ /**
955
+ * Decoded Find My location share coordinates.
956
+ */
957
+ export interface Location {
958
+ latitude: number;
959
+
960
+ longitude: number;
961
+
962
+ /**
963
+ * Horizontal accuracy in meters
964
+ */
965
+ accuracy?: number;
966
+
967
+ /**
968
+ * Altitude in meters
969
+ */
970
+ altitude?: number;
971
+
972
+ /**
973
+ * Share duration selected by the recipient
974
+ */
975
+ duration?: string;
976
+
977
+ timestamp?: string;
978
+ }
979
+
980
+ /**
981
+ * Immediate parent of an iMessage inline reply. The target must belong to the same
982
+ * account, conversation, and sending line.
983
+ */
984
+ export interface ReplyTo {
985
+ /**
986
+ * Public handle of the immediate parent message
987
+ */
988
+ message_handle: string;
989
+
990
+ /**
991
+ * Advanced override for a known part of a multipart target. Omit this in normal
992
+ * reply requests and never guess it; requests default to 0. When replying to an
993
+ * attachment represented by its own webhook, use that webhook's `message_handle`
994
+ * and omit `part_index` so Sendblue can use the stored authoritative part.
995
+ * Responses omit it when no authoritative immediate-parent part is available.
996
+ */
997
+ part_index?: number;
998
+ }
999
+
1000
+ /**
1001
+ * Message that originated an iMessage inline-reply thread.
1002
+ */
1003
+ export interface ThreadOriginator {
1004
+ /**
1005
+ * Public handle of the thread's root message
1006
+ */
1007
+ message_handle: string;
1008
+
1009
+ /**
1010
+ * Opaque Apple thread-originator part descriptor
1011
+ */
1012
+ part?: string;
1013
+ }
1014
+ }
1015
+
1016
+ export interface Pagination {
1017
+ /**
1018
+ * Whether there are more messages available
1019
+ */
1020
+ hasMore?: boolean;
1021
+
1022
+ /**
1023
+ * Number of messages returned in this request
1024
+ */
1025
+ limit?: number;
1026
+
1027
+ /**
1028
+ * Number of messages skipped
1029
+ */
1030
+ offset?: number;
1031
+
1032
+ /**
1033
+ * Total number of messages matching the filters
1034
+ */
1035
+ total?: number;
1036
+ }
1037
+ }
1038
+
1039
+ export interface MessageListParams {
1040
+ /**
1041
+ * Filter by account email
1042
+ */
1043
+ account_email?: string;
1044
+
1045
+ /**
1046
+ * Filter messages created after this date (ISO 8601 format)
1047
+ */
1048
+ created_at_gte?: string;
1049
+
1050
+ /**
1051
+ * Filter messages created before this date (ISO 8601 format)
1052
+ */
1053
+ created_at_lte?: string;
1054
+
1055
+ /**
1056
+ * Filter by sender phone number
1057
+ */
1058
+ from_number?: string;
1059
+
1060
+ /**
1061
+ * Filter by group ID
1062
+ */
1063
+ group_id?: string;
1064
+
1065
+ /**
1066
+ * Filter by message direction. Use `false` to get inbound messages (messages sent
1067
+ * TO your Sendblue number).
1068
+ *
1069
+ * **To get inbound messages for polling:** Use `is_outbound=false` combined with
1070
+ * `sendblue_number` or `to_number` set to your Sendblue phone number.
1071
+ *
1072
+ * Note: Do NOT use `message_type=inbound` - that parameter only accepts `message`
1073
+ * or `group` values.
1074
+ */
1075
+ is_outbound?: 'true' | 'false';
1076
+
1077
+ /**
1078
+ * Maximum number of messages to return
1079
+ */
1080
+ limit?: number;
1081
+
1082
+ /**
1083
+ * Filter by message type (1:1 vs group chat). Only accepts `message` or `group`.
1084
+ *
1085
+ * **Common mistake:** This is NOT for filtering inbound vs outbound messages. Use
1086
+ * `is_outbound` parameter instead.
1087
+ */
1088
+ message_type?: 'message' | 'group';
1089
+
1090
+ /**
1091
+ * Filter by any phone number (from or to)
1092
+ */
1093
+ number?: string;
1094
+
1095
+ /**
1096
+ * Number of messages to skip
1097
+ */
1098
+ offset?: number;
1099
+
1100
+ /**
1101
+ * Field to order messages by
1102
+ */
1103
+ order_by?: 'createdAt' | 'updatedAt' | 'sentAt';
1104
+
1105
+ /**
1106
+ * Sort order
1107
+ */
1108
+ order_direction?: 'asc' | 'desc';
1109
+
1110
+ /**
1111
+ * Filter by Sendblue phone number
1112
+ */
1113
+ sendblue_number?: string;
1114
+
1115
+ /**
1116
+ * Filter messages sent after this date (ISO 8601 format)
1117
+ */
1118
+ sent_at_gte?: string;
1119
+
1120
+ /**
1121
+ * Filter messages sent before this date (ISO 8601 format)
1122
+ */
1123
+ sent_at_lte?: string;
1124
+
1125
+ /**
1126
+ * Filter by service type
1127
+ */
1128
+ service?: 'iMessage' | 'SMS' | 'RCS';
1129
+
1130
+ /**
1131
+ * Filter by message status
1132
+ */
1133
+ status?:
1134
+ | 'REGISTERED'
1135
+ | 'PENDING'
1136
+ | 'SENT'
1137
+ | 'DELIVERED'
1138
+ | 'RECEIVED'
1139
+ | 'QUEUED'
1140
+ | 'ERROR'
1141
+ | 'DECLINED'
1142
+ | 'ACCEPTED'
1143
+ | 'SUCCESS';
1144
+
1145
+ /**
1146
+ * Filter by recipient phone number
1147
+ */
1148
+ to_number?: string;
1149
+
1150
+ /**
1151
+ * Filter messages updated after this date (ISO 8601 format)
1152
+ */
1153
+ updated_at_gte?: string;
1154
+
1155
+ /**
1156
+ * Filter messages updated before this date (ISO 8601 format)
1157
+ */
1158
+ updated_at_lte?: string;
1159
+
1160
+ /**
1161
+ * Filter by worker ID (Admin only)
1162
+ */
1163
+ worker_id?: string;
1164
+ }
1165
+
1166
+ export interface MessageGetStatusParams {
1167
+ /**
1168
+ * The message handle of the message you want to check status for
1169
+ */
1170
+ handle: string;
1171
+ }
1172
+
1173
+ export interface MessageSendParams {
1174
+ /**
1175
+ * **REQUIRED** - The phone number to send from. Must be one of your registered
1176
+ * Sendblue phone numbers in E.164 format. Without this parameter, the message will
1177
+ * fail to send.
1178
+ */
1179
+ from_number: string;
1180
+
1181
+ /**
1182
+ * Recipient phone number in E.164 format
1183
+ */
1184
+ number: string;
1185
+
1186
+ /**
1187
+ * A Sendblue App Card rendered with Apple's Messages framework. App Cards require
1188
+ * a V2 Mac line and an iMessage-capable recipient; they never fall back to SMS.
1189
+ * The URL is delivered to the identified Messages extension when the recipient
1190
+ * taps the card. An initial App Card may include `reply_to` to create an inline
1191
+ * reply. Later state changes use the update endpoint, which sends a new Apple
1192
+ * message in the same App Card session. The feature is unavailable on the free
1193
+ * plan.
1194
+ */
1195
+ app_card?: MessageSendParams.AppCard;
1196
+
1197
+ /**
1198
+ * Message text content. Optional when `media_url` or `app_card` is provided.
1199
+ */
1200
+ content?: string;
1201
+
1202
+ /**
1203
+ * URL of media file to send (images, videos, etc.)
1204
+ */
1205
+ media_url?: string;
1206
+
1207
+ /**
1208
+ * Optional inline-reply target. This may be combined with `app_card`; the
1209
+ * resulting App Card is sent as an inline reply to the target.
1210
+ */
1211
+ reply_to?: MessageSendParams.ReplyTo;
1212
+
1213
+ /**
1214
+ * Optional. Identifies the seat (user) sending the message so the message is
1215
+ * attributed to a specific rep. Accepts either the seat UUID or the Firebase Auth
1216
+ * subject. When provided, `sender_email` is auto-populated on the message record
1217
+ * and webhook payloads. Returns 400 if the seat is not found.
1218
+ */
1219
+ seat_id?: string;
1220
+
1221
+ /**
1222
+ * The iMessage expressive message style
1223
+ */
1224
+ send_style?:
1225
+ | 'celebration'
1226
+ | 'shooting_star'
1227
+ | 'fireworks'
1228
+ | 'lasers'
1229
+ | 'love'
1230
+ | 'confetti'
1231
+ | 'balloons'
1232
+ | 'spotlight'
1233
+ | 'echo'
1234
+ | 'invisible'
1235
+ | 'gentle'
1236
+ | 'loud'
1237
+ | 'slam';
1238
+
1239
+ /**
1240
+ * Webhook URL for message status updates
1241
+ */
1242
+ status_callback?: string;
1243
+ }
1244
+
1245
+ export namespace MessageSendParams {
1246
+ /**
1247
+ * A Sendblue App Card rendered with Apple's Messages framework. App Cards require
1248
+ * a V2 Mac line and an iMessage-capable recipient; they never fall back to SMS.
1249
+ * The URL is delivered to the identified Messages extension when the recipient
1250
+ * taps the card. An initial App Card may include `reply_to` to create an inline
1251
+ * reply. Later state changes use the update endpoint, which sends a new Apple
1252
+ * message in the same App Card session. The feature is unavailable on the free
1253
+ * plan.
1254
+ */
1255
+ export interface AppCard {
1256
+ appName: string;
1257
+
1258
+ extensionBundleId: string;
1259
+
1260
+ /**
1261
+ * Visible card fields mirroring Apple's MSMessageTemplateLayout.
1262
+ */
1263
+ layout: AppCard.Layout;
1264
+
1265
+ teamId: string;
1266
+
1267
+ /**
1268
+ * URL delivered to the iMessage extension on tap. HTTPS URLs are limited to 2048
1269
+ * characters; data URLs carrying inline app state are limited to 16384.
1270
+ */
1271
+ url: string;
1272
+
1273
+ /**
1274
+ * Optional numeric App Store ID for recipients without the extension.
1275
+ */
1276
+ appStoreId?: number;
1277
+
1278
+ /**
1279
+ * Fallback text for notifications and surfaces that cannot render the card.
1280
+ */
1281
+ fallbackText?: string;
1282
+
1283
+ /**
1284
+ * Use Apple's live layout when the extension is installed; false always sends the
1285
+ * static template layout.
1286
+ */
1287
+ interactive?: boolean;
1288
+
1289
+ /**
1290
+ * Optional caller-supplied App Card session UUID. Generated automatically when
1291
+ * omitted.
1292
+ */
1293
+ sessionIdentifier?: string;
1294
+ }
1295
+
1296
+ export namespace AppCard {
1297
+ /**
1298
+ * Visible card fields mirroring Apple's MSMessageTemplateLayout.
1299
+ */
1300
+ export interface Layout {
1301
+ caption?: string;
1302
+
1303
+ /**
1304
+ * Secondary text overlaid on the preview image. Requires imageUrl.
1305
+ */
1306
+ imageSubtitle?: string;
1307
+
1308
+ /**
1309
+ * Text overlaid on the preview image. Requires imageUrl.
1310
+ */
1311
+ imageTitle?: string;
1312
+
1313
+ /**
1314
+ * HTTPS preview image fetched by the worker and sent as a hidden card attachment.
1315
+ * JPEG, PNG, HEIC, HEIF, and WebP are supported up to 10 MB.
1316
+ */
1317
+ imageUrl?: string;
1318
+
1319
+ subcaption?: string;
1320
+
1321
+ /**
1322
+ * Fallback text used in notifications and non-rendering surfaces.
1323
+ */
1324
+ summary?: string;
1325
+
1326
+ trailingCaption?: string;
1327
+
1328
+ trailingSubcaption?: string;
1329
+ }
1330
+ }
1331
+
1332
+ /**
1333
+ * Optional inline-reply target. This may be combined with `app_card`; the
1334
+ * resulting App Card is sent as an inline reply to the target.
1335
+ */
1336
+ export interface ReplyTo {
1337
+ /**
1338
+ * Public handle of the immediate parent message
1339
+ */
1340
+ message_handle: string;
1341
+
1342
+ /**
1343
+ * Advanced override for a known part of a multipart target. Omit this in normal
1344
+ * reply requests and never guess it; requests default to 0. When replying to an
1345
+ * attachment represented by its own webhook, use that webhook's `message_handle`
1346
+ * and omit `part_index` so Sendblue can use the stored authoritative part.
1347
+ * Responses omit it when no authoritative immediate-parent part is available.
1348
+ */
1349
+ part_index?: number;
1350
+ }
1351
+ }
1352
+
1353
+ export interface MessageUpdateAppCardParams {
1354
+ /**
1355
+ * Replacement fallback text for notifications and non-rendering surfaces.
1356
+ */
1357
+ fallback_text?: string;
1358
+
1359
+ /**
1360
+ * Reusing this key for the same App Card target returns the original update
1361
+ * instead of sending again.
1362
+ */
1363
+ idempotency_key?: string;
1364
+
1365
+ interactive?: boolean;
1366
+
1367
+ /**
1368
+ * Visible card fields mirroring Apple's MSMessageTemplateLayout.
1369
+ */
1370
+ layout?: MessageUpdateAppCardParams.Layout;
1371
+
1372
+ /**
1373
+ * The iMessage expressive message style for this update.
1374
+ */
1375
+ send_style?:
1376
+ | 'celebration'
1377
+ | 'shooting_star'
1378
+ | 'fireworks'
1379
+ | 'lasers'
1380
+ | 'love'
1381
+ | 'confetti'
1382
+ | 'balloons'
1383
+ | 'spotlight'
1384
+ | 'echo'
1385
+ | 'invisible'
1386
+ | 'gentle'
1387
+ | 'loud'
1388
+ | 'slam';
1389
+
1390
+ url?: string;
1391
+ }
1392
+
1393
+ export namespace MessageUpdateAppCardParams {
1394
+ /**
1395
+ * Visible card fields mirroring Apple's MSMessageTemplateLayout.
1396
+ */
1397
+ export interface Layout {
1398
+ caption?: string;
1399
+
1400
+ /**
1401
+ * Secondary text overlaid on the preview image. Requires imageUrl.
1402
+ */
1403
+ imageSubtitle?: string;
1404
+
1405
+ /**
1406
+ * Text overlaid on the preview image. Requires imageUrl.
1407
+ */
1408
+ imageTitle?: string;
1409
+
1410
+ /**
1411
+ * HTTPS preview image fetched by the worker and sent as a hidden card attachment.
1412
+ * JPEG, PNG, HEIC, HEIF, and WebP are supported up to 10 MB.
1413
+ */
1414
+ imageUrl?: string;
1415
+
1416
+ subcaption?: string;
1417
+
1418
+ /**
1419
+ * Fallback text used in notifications and non-rendering surfaces.
1420
+ */
1421
+ summary?: string;
1422
+
1423
+ trailingCaption?: string;
1424
+
1425
+ trailingSubcaption?: string;
1426
+ }
1427
+ }
1428
+
1429
+ Messages.V2 = V2;
1430
+
1431
+ export declare namespace Messages {
1432
+ export {
1433
+ type MessageContent as MessageContent,
1434
+ type MessageResponse as MessageResponse,
1435
+ type MessageRetrieveResponse as MessageRetrieveResponse,
1436
+ type MessageListResponse as MessageListResponse,
1437
+ type MessageListParams as MessageListParams,
1438
+ type MessageGetStatusParams as MessageGetStatusParams,
1439
+ type MessageSendParams as MessageSendParams,
1440
+ type MessageUpdateAppCardParams as MessageUpdateAppCardParams,
1441
+ };
1442
+
1443
+ export { V2 as V2 };
1444
+ }