@trycourier/courier 7.21.0 → 7.23.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 (358) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +60 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +60 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +60 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +60 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/audiences.d.mts +13 -5
  12. package/resources/audiences.d.mts.map +1 -1
  13. package/resources/audiences.d.ts +13 -5
  14. package/resources/audiences.d.ts.map +1 -1
  15. package/resources/audiences.js +13 -5
  16. package/resources/audiences.js.map +1 -1
  17. package/resources/audiences.mjs +13 -5
  18. package/resources/audiences.mjs.map +1 -1
  19. package/resources/audit-events.d.mts +7 -2
  20. package/resources/audit-events.d.mts.map +1 -1
  21. package/resources/audit-events.d.ts +7 -2
  22. package/resources/audit-events.d.ts.map +1 -1
  23. package/resources/audit-events.js +7 -2
  24. package/resources/audit-events.js.map +1 -1
  25. package/resources/audit-events.mjs +7 -2
  26. package/resources/audit-events.mjs.map +1 -1
  27. package/resources/auth.d.mts +5 -1
  28. package/resources/auth.d.mts.map +1 -1
  29. package/resources/auth.d.ts +5 -1
  30. package/resources/auth.d.ts.map +1 -1
  31. package/resources/auth.js +5 -1
  32. package/resources/auth.js.map +1 -1
  33. package/resources/auth.mjs +5 -1
  34. package/resources/auth.mjs.map +1 -1
  35. package/resources/automations/automations.d.mts +5 -1
  36. package/resources/automations/automations.d.mts.map +1 -1
  37. package/resources/automations/automations.d.ts +5 -1
  38. package/resources/automations/automations.d.ts.map +1 -1
  39. package/resources/automations/automations.js +5 -1
  40. package/resources/automations/automations.js.map +1 -1
  41. package/resources/automations/automations.mjs +5 -1
  42. package/resources/automations/automations.mjs.map +1 -1
  43. package/resources/automations/invoke.d.mts +74 -7
  44. package/resources/automations/invoke.d.mts.map +1 -1
  45. package/resources/automations/invoke.d.ts +74 -7
  46. package/resources/automations/invoke.d.ts.map +1 -1
  47. package/resources/automations/invoke.js +38 -9
  48. package/resources/automations/invoke.js.map +1 -1
  49. package/resources/automations/invoke.mjs +38 -9
  50. package/resources/automations/invoke.mjs.map +1 -1
  51. package/resources/brands.d.mts +42 -7
  52. package/resources/brands.d.mts.map +1 -1
  53. package/resources/brands.d.ts +42 -7
  54. package/resources/brands.d.ts.map +1 -1
  55. package/resources/brands.js +28 -8
  56. package/resources/brands.js.map +1 -1
  57. package/resources/brands.mjs +28 -8
  58. package/resources/brands.mjs.map +1 -1
  59. package/resources/broadcasts.d.mts +381 -0
  60. package/resources/broadcasts.d.mts.map +1 -0
  61. package/resources/broadcasts.d.ts +381 -0
  62. package/resources/broadcasts.d.ts.map +1 -0
  63. package/resources/broadcasts.js +181 -0
  64. package/resources/broadcasts.js.map +1 -0
  65. package/resources/broadcasts.mjs +177 -0
  66. package/resources/broadcasts.mjs.map +1 -0
  67. package/resources/digests/schedules.d.mts +5 -3
  68. package/resources/digests/schedules.d.mts.map +1 -1
  69. package/resources/digests/schedules.d.ts +5 -3
  70. package/resources/digests/schedules.d.ts.map +1 -1
  71. package/resources/digests/schedules.js +5 -3
  72. package/resources/digests/schedules.js.map +1 -1
  73. package/resources/digests/schedules.mjs +5 -3
  74. package/resources/digests/schedules.mjs.map +1 -1
  75. package/resources/inbound.d.mts +5 -1
  76. package/resources/inbound.d.mts.map +1 -1
  77. package/resources/inbound.d.ts +5 -1
  78. package/resources/inbound.d.ts.map +1 -1
  79. package/resources/inbound.js +5 -1
  80. package/resources/inbound.js.map +1 -1
  81. package/resources/inbound.mjs +5 -1
  82. package/resources/inbound.mjs.map +1 -1
  83. package/resources/inbox/inbox.d.mts +10 -0
  84. package/resources/inbox/inbox.d.mts.map +1 -0
  85. package/resources/inbox/inbox.d.ts +10 -0
  86. package/resources/inbox/inbox.d.ts.map +1 -0
  87. package/resources/inbox/inbox.js +17 -0
  88. package/resources/inbox/inbox.js.map +1 -0
  89. package/resources/inbox/inbox.mjs +12 -0
  90. package/resources/inbox/inbox.mjs.map +1 -0
  91. package/resources/inbox/index.d.mts +3 -0
  92. package/resources/inbox/index.d.mts.map +1 -0
  93. package/resources/inbox/index.d.ts +3 -0
  94. package/resources/inbox/index.d.ts.map +1 -0
  95. package/resources/inbox/index.js +9 -0
  96. package/resources/inbox/index.js.map +1 -0
  97. package/resources/inbox/index.mjs +4 -0
  98. package/resources/inbox/index.mjs.map +1 -0
  99. package/resources/inbox/messages.d.mts +23 -0
  100. package/resources/inbox/messages.d.mts.map +1 -0
  101. package/resources/inbox/messages.d.ts +23 -0
  102. package/resources/inbox/messages.d.ts.map +1 -0
  103. package/resources/inbox/messages.js +34 -0
  104. package/resources/inbox/messages.js.map +1 -0
  105. package/resources/inbox/messages.mjs +30 -0
  106. package/resources/inbox/messages.mjs.map +1 -0
  107. package/resources/inbox.d.mts +2 -0
  108. package/resources/inbox.d.mts.map +1 -0
  109. package/resources/inbox.d.ts +2 -0
  110. package/resources/inbox.d.ts.map +1 -0
  111. package/resources/inbox.js +6 -0
  112. package/resources/inbox.js.map +1 -0
  113. package/resources/inbox.mjs +3 -0
  114. package/resources/inbox.mjs.map +1 -0
  115. package/resources/index.d.mts +2 -0
  116. package/resources/index.d.mts.map +1 -1
  117. package/resources/index.d.ts +2 -0
  118. package/resources/index.d.ts.map +1 -1
  119. package/resources/index.js +5 -1
  120. package/resources/index.js.map +1 -1
  121. package/resources/index.mjs +2 -0
  122. package/resources/index.mjs.map +1 -1
  123. package/resources/journeys/journeys.d.mts +130 -39
  124. package/resources/journeys/journeys.d.mts.map +1 -1
  125. package/resources/journeys/journeys.d.ts +130 -39
  126. package/resources/journeys/journeys.d.ts.map +1 -1
  127. package/resources/journeys/journeys.js +79 -34
  128. package/resources/journeys/journeys.js.map +1 -1
  129. package/resources/journeys/journeys.mjs +79 -34
  130. package/resources/journeys/journeys.mjs.map +1 -1
  131. package/resources/journeys/templates.d.mts +60 -17
  132. package/resources/journeys/templates.d.mts.map +1 -1
  133. package/resources/journeys/templates.d.ts +60 -17
  134. package/resources/journeys/templates.d.ts.map +1 -1
  135. package/resources/journeys/templates.js +41 -20
  136. package/resources/journeys/templates.js.map +1 -1
  137. package/resources/journeys/templates.mjs +41 -20
  138. package/resources/journeys/templates.mjs.map +1 -1
  139. package/resources/lists/lists.d.mts +40 -5
  140. package/resources/lists/lists.d.mts.map +1 -1
  141. package/resources/lists/lists.d.ts +40 -5
  142. package/resources/lists/lists.d.ts.map +1 -1
  143. package/resources/lists/lists.js +40 -5
  144. package/resources/lists/lists.js.map +1 -1
  145. package/resources/lists/lists.mjs +40 -5
  146. package/resources/lists/lists.mjs.map +1 -1
  147. package/resources/lists/subscriptions.d.mts +65 -5
  148. package/resources/lists/subscriptions.d.mts.map +1 -1
  149. package/resources/lists/subscriptions.d.ts +65 -5
  150. package/resources/lists/subscriptions.d.ts.map +1 -1
  151. package/resources/lists/subscriptions.js +57 -6
  152. package/resources/lists/subscriptions.js.map +1 -1
  153. package/resources/lists/subscriptions.mjs +57 -6
  154. package/resources/lists/subscriptions.mjs.map +1 -1
  155. package/resources/messages.d.mts +15 -14
  156. package/resources/messages.d.mts.map +1 -1
  157. package/resources/messages.d.ts +15 -14
  158. package/resources/messages.d.ts.map +1 -1
  159. package/resources/messages.js +15 -14
  160. package/resources/messages.js.map +1 -1
  161. package/resources/messages.mjs +15 -14
  162. package/resources/messages.mjs.map +1 -1
  163. package/resources/notifications/checks.d.mts +9 -3
  164. package/resources/notifications/checks.d.mts.map +1 -1
  165. package/resources/notifications/checks.d.ts +9 -3
  166. package/resources/notifications/checks.d.ts.map +1 -1
  167. package/resources/notifications/checks.js +9 -3
  168. package/resources/notifications/checks.js.map +1 -1
  169. package/resources/notifications/checks.mjs +9 -3
  170. package/resources/notifications/checks.mjs.map +1 -1
  171. package/resources/notifications/notifications.d.mts +62 -29
  172. package/resources/notifications/notifications.d.mts.map +1 -1
  173. package/resources/notifications/notifications.d.ts +62 -29
  174. package/resources/notifications/notifications.d.ts.map +1 -1
  175. package/resources/notifications/notifications.js +49 -26
  176. package/resources/notifications/notifications.js.map +1 -1
  177. package/resources/notifications/notifications.mjs +49 -26
  178. package/resources/notifications/notifications.mjs.map +1 -1
  179. package/resources/profiles/lists.d.mts +49 -5
  180. package/resources/profiles/lists.d.mts.map +1 -1
  181. package/resources/profiles/lists.d.ts +49 -5
  182. package/resources/profiles/lists.d.ts.map +1 -1
  183. package/resources/profiles/lists.js +45 -6
  184. package/resources/profiles/lists.js.map +1 -1
  185. package/resources/profiles/lists.mjs +45 -6
  186. package/resources/profiles/lists.mjs.map +1 -1
  187. package/resources/profiles/profiles.d.mts +70 -11
  188. package/resources/profiles/profiles.d.mts.map +1 -1
  189. package/resources/profiles/profiles.d.ts +70 -11
  190. package/resources/profiles/profiles.d.ts.map +1 -1
  191. package/resources/profiles/profiles.js +65 -12
  192. package/resources/profiles/profiles.js.map +1 -1
  193. package/resources/profiles/profiles.mjs +65 -12
  194. package/resources/profiles/profiles.mjs.map +1 -1
  195. package/resources/providers/catalog.d.mts +10 -4
  196. package/resources/providers/catalog.d.mts.map +1 -1
  197. package/resources/providers/catalog.d.ts +10 -4
  198. package/resources/providers/catalog.d.ts.map +1 -1
  199. package/resources/providers/catalog.js +10 -4
  200. package/resources/providers/catalog.js.map +1 -1
  201. package/resources/providers/catalog.mjs +10 -4
  202. package/resources/providers/catalog.mjs.map +1 -1
  203. package/resources/providers/providers.d.mts +68 -22
  204. package/resources/providers/providers.d.mts.map +1 -1
  205. package/resources/providers/providers.d.ts +68 -22
  206. package/resources/providers/providers.d.ts.map +1 -1
  207. package/resources/providers/providers.js +57 -14
  208. package/resources/providers/providers.js.map +1 -1
  209. package/resources/providers/providers.mjs +57 -14
  210. package/resources/providers/providers.mjs.map +1 -1
  211. package/resources/requests.d.mts +5 -1
  212. package/resources/requests.d.mts.map +1 -1
  213. package/resources/requests.d.ts +5 -1
  214. package/resources/requests.d.ts.map +1 -1
  215. package/resources/requests.js +5 -1
  216. package/resources/requests.js.map +1 -1
  217. package/resources/requests.mjs +5 -1
  218. package/resources/requests.mjs.map +1 -1
  219. package/resources/routing-strategies.d.mts +30 -11
  220. package/resources/routing-strategies.d.mts.map +1 -1
  221. package/resources/routing-strategies.d.ts +30 -11
  222. package/resources/routing-strategies.d.ts.map +1 -1
  223. package/resources/routing-strategies.js +22 -6
  224. package/resources/routing-strategies.js.map +1 -1
  225. package/resources/routing-strategies.mjs +22 -6
  226. package/resources/routing-strategies.mjs.map +1 -1
  227. package/resources/send.d.mts +24 -4
  228. package/resources/send.d.mts.map +1 -1
  229. package/resources/send.d.ts +24 -4
  230. package/resources/send.d.ts.map +1 -1
  231. package/resources/send.js +21 -3
  232. package/resources/send.js.map +1 -1
  233. package/resources/send.mjs +21 -3
  234. package/resources/send.mjs.map +1 -1
  235. package/resources/tenants/preferences/items.d.mts +7 -2
  236. package/resources/tenants/preferences/items.d.mts.map +1 -1
  237. package/resources/tenants/preferences/items.d.ts +7 -2
  238. package/resources/tenants/preferences/items.d.ts.map +1 -1
  239. package/resources/tenants/preferences/items.js +7 -2
  240. package/resources/tenants/preferences/items.js.map +1 -1
  241. package/resources/tenants/preferences/items.mjs +7 -2
  242. package/resources/tenants/preferences/items.mjs.map +1 -1
  243. package/resources/tenants/templates/templates.d.mts +13 -19
  244. package/resources/tenants/templates/templates.d.mts.map +1 -1
  245. package/resources/tenants/templates/templates.d.ts +13 -19
  246. package/resources/tenants/templates/templates.d.ts.map +1 -1
  247. package/resources/tenants/templates/templates.js +13 -19
  248. package/resources/tenants/templates/templates.js.map +1 -1
  249. package/resources/tenants/templates/templates.mjs +13 -19
  250. package/resources/tenants/templates/templates.mjs.map +1 -1
  251. package/resources/tenants/templates/versions.d.mts +5 -7
  252. package/resources/tenants/templates/versions.d.mts.map +1 -1
  253. package/resources/tenants/templates/versions.d.ts +5 -7
  254. package/resources/tenants/templates/versions.d.ts.map +1 -1
  255. package/resources/tenants/templates/versions.js +5 -7
  256. package/resources/tenants/templates/versions.js.map +1 -1
  257. package/resources/tenants/templates/versions.mjs +5 -7
  258. package/resources/tenants/templates/versions.mjs.map +1 -1
  259. package/resources/tenants/tenants.d.mts +13 -5
  260. package/resources/tenants/tenants.d.mts.map +1 -1
  261. package/resources/tenants/tenants.d.ts +13 -5
  262. package/resources/tenants/tenants.d.ts.map +1 -1
  263. package/resources/tenants/tenants.js +13 -5
  264. package/resources/tenants/tenants.js.map +1 -1
  265. package/resources/tenants/tenants.mjs +13 -5
  266. package/resources/tenants/tenants.mjs.map +1 -1
  267. package/resources/translations.d.mts +7 -2
  268. package/resources/translations.d.mts.map +1 -1
  269. package/resources/translations.d.ts +7 -2
  270. package/resources/translations.d.ts.map +1 -1
  271. package/resources/translations.js +7 -2
  272. package/resources/translations.js.map +1 -1
  273. package/resources/translations.mjs +7 -2
  274. package/resources/translations.mjs.map +1 -1
  275. package/resources/users/preferences.d.mts +64 -42
  276. package/resources/users/preferences.d.mts.map +1 -1
  277. package/resources/users/preferences.d.ts +64 -42
  278. package/resources/users/preferences.d.ts.map +1 -1
  279. package/resources/users/preferences.js +30 -42
  280. package/resources/users/preferences.js.map +1 -1
  281. package/resources/users/preferences.mjs +30 -42
  282. package/resources/users/preferences.mjs.map +1 -1
  283. package/resources/users/tenants.d.mts +13 -10
  284. package/resources/users/tenants.d.mts.map +1 -1
  285. package/resources/users/tenants.d.ts +13 -10
  286. package/resources/users/tenants.d.ts.map +1 -1
  287. package/resources/users/tenants.js +13 -10
  288. package/resources/users/tenants.js.map +1 -1
  289. package/resources/users/tenants.mjs +13 -10
  290. package/resources/users/tenants.mjs.map +1 -1
  291. package/resources/users/tokens.d.mts +15 -6
  292. package/resources/users/tokens.d.mts.map +1 -1
  293. package/resources/users/tokens.d.ts +15 -6
  294. package/resources/users/tokens.d.ts.map +1 -1
  295. package/resources/users/tokens.js +15 -6
  296. package/resources/users/tokens.js.map +1 -1
  297. package/resources/users/tokens.mjs +15 -6
  298. package/resources/users/tokens.mjs.map +1 -1
  299. package/resources/workspace-preferences/topics.d.mts +40 -18
  300. package/resources/workspace-preferences/topics.d.mts.map +1 -1
  301. package/resources/workspace-preferences/topics.d.ts +40 -18
  302. package/resources/workspace-preferences/topics.d.ts.map +1 -1
  303. package/resources/workspace-preferences/topics.js +26 -11
  304. package/resources/workspace-preferences/topics.js.map +1 -1
  305. package/resources/workspace-preferences/topics.mjs +26 -11
  306. package/resources/workspace-preferences/topics.mjs.map +1 -1
  307. package/resources/workspace-preferences/workspace-preferences.d.mts +56 -19
  308. package/resources/workspace-preferences/workspace-preferences.d.mts.map +1 -1
  309. package/resources/workspace-preferences/workspace-preferences.d.ts +56 -19
  310. package/resources/workspace-preferences/workspace-preferences.d.ts.map +1 -1
  311. package/resources/workspace-preferences/workspace-preferences.js +41 -13
  312. package/resources/workspace-preferences/workspace-preferences.js.map +1 -1
  313. package/resources/workspace-preferences/workspace-preferences.mjs +41 -13
  314. package/resources/workspace-preferences/workspace-preferences.mjs.map +1 -1
  315. package/src/client.ts +96 -0
  316. package/src/resources/audiences.ts +13 -5
  317. package/src/resources/audit-events.ts +7 -2
  318. package/src/resources/auth.ts +5 -1
  319. package/src/resources/automations/automations.ts +5 -1
  320. package/src/resources/automations/invoke.ts +115 -9
  321. package/src/resources/brands.ts +62 -8
  322. package/src/resources/broadcasts.ts +489 -0
  323. package/src/resources/digests/schedules.ts +5 -3
  324. package/src/resources/inbound.ts +5 -1
  325. package/src/resources/inbox/inbox.ts +15 -0
  326. package/src/resources/inbox/index.ts +4 -0
  327. package/src/resources/inbox/messages.ts +40 -0
  328. package/src/resources/inbox.ts +3 -0
  329. package/src/resources/index.ts +18 -0
  330. package/src/resources/journeys/journeys.ts +212 -43
  331. package/src/resources/journeys/templates.ts +98 -20
  332. package/src/resources/lists/lists.ts +40 -5
  333. package/src/resources/lists/subscriptions.ts +82 -6
  334. package/src/resources/messages.ts +15 -14
  335. package/src/resources/notifications/checks.ts +9 -3
  336. package/src/resources/notifications/notifications.ts +102 -31
  337. package/src/resources/profiles/lists.ts +70 -6
  338. package/src/resources/profiles/profiles.ts +90 -12
  339. package/src/resources/providers/catalog.ts +10 -4
  340. package/src/resources/providers/providers.ts +86 -21
  341. package/src/resources/requests.ts +5 -1
  342. package/src/resources/routing-strategies.ts +50 -12
  343. package/src/resources/send.ts +45 -5
  344. package/src/resources/tenants/preferences/items.ts +7 -2
  345. package/src/resources/tenants/templates/templates.ts +13 -19
  346. package/src/resources/tenants/templates/versions.ts +5 -7
  347. package/src/resources/tenants/tenants.ts +13 -5
  348. package/src/resources/translations.ts +7 -2
  349. package/src/resources/users/preferences.ts +86 -44
  350. package/src/resources/users/tenants.ts +13 -10
  351. package/src/resources/users/tokens.ts +15 -6
  352. package/src/resources/workspace-preferences/topics.ts +60 -19
  353. package/src/resources/workspace-preferences/workspace-preferences.ts +96 -21
  354. package/src/version.ts +1 -1
  355. package/version.d.mts +1 -1
  356. package/version.d.ts +1 -1
  357. package/version.js +1 -1
  358. package/version.mjs +1 -1
@@ -0,0 +1,489 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as Shared from './shared';
5
+ import * as NotificationsAPI from './notifications/notifications';
6
+ import { APIPromise } from '../core/api-promise';
7
+ import { RequestOptions } from '../internal/request-options';
8
+ import { path } from '../internal/utils/path';
9
+
10
+ export class Broadcasts extends APIResource {
11
+ /**
12
+ * Create a broadcast. Provisions a private notification template for the broadcast
13
+ * and returns the new broadcast in the draft state. Exactly one channel is
14
+ * required.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const broadcast = await client.broadcasts.create({
19
+ * channel: 'email',
20
+ * name: 'Spring Sale Announcement',
21
+ * });
22
+ * ```
23
+ */
24
+ create(body: BroadcastCreateParams, options?: RequestOptions): APIPromise<Broadcast> {
25
+ return this._client.post('/broadcasts', { body, ...options });
26
+ }
27
+
28
+ /**
29
+ * Retrieve a broadcast by ID. Archived broadcasts return 404.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const broadcast = await client.broadcasts.retrieve(
34
+ * 'broadcastId',
35
+ * );
36
+ * ```
37
+ */
38
+ retrieve(broadcastID: string, options?: RequestOptions): APIPromise<Broadcast> {
39
+ return this._client.get(path`/broadcasts/${broadcastID}`, options);
40
+ }
41
+
42
+ /**
43
+ * Update a broadcast's name. Content is edited via the broadcast's notification
44
+ * template, not this endpoint.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const broadcast = await client.broadcasts.update(
49
+ * 'broadcastId',
50
+ * { name: 'Spring Sale Announcement (v2)' },
51
+ * );
52
+ * ```
53
+ */
54
+ update(broadcastID: string, body: BroadcastUpdateParams, options?: RequestOptions): APIPromise<Broadcast> {
55
+ return this._client.put(path`/broadcasts/${broadcastID}`, { body, ...options });
56
+ }
57
+
58
+ /**
59
+ * List broadcasts in your workspace. Cursor-paginated; returns broadcasts
60
+ * newest-first.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const broadcastListResponse =
65
+ * await client.broadcasts.list();
66
+ * ```
67
+ */
68
+ list(
69
+ query: BroadcastListParams | null | undefined = {},
70
+ options?: RequestOptions,
71
+ ): APIPromise<BroadcastListResponse> {
72
+ return this._client.get('/broadcasts', { query, ...options });
73
+ }
74
+
75
+ /**
76
+ * Archive a broadcast. This is a soft delete — the archived broadcast is returned
77
+ * and no longer appears in list results.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * const broadcast = await client.broadcasts.archive(
82
+ * 'broadcastId',
83
+ * );
84
+ * ```
85
+ */
86
+ archive(broadcastID: string, options?: RequestOptions): APIPromise<Broadcast> {
87
+ return this._client.delete(path`/broadcasts/${broadcastID}`, options);
88
+ }
89
+
90
+ /**
91
+ * Cancel a broadcast's pending schedule, returning it to the draft state. Only
92
+ * valid for a scheduled broadcast.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * const broadcast = await client.broadcasts.cancel(
97
+ * 'broadcastId',
98
+ * );
99
+ * ```
100
+ */
101
+ cancel(broadcastID: string, options?: RequestOptions): APIPromise<Broadcast> {
102
+ return this._client.post(path`/broadcasts/${broadcastID}/cancel`, options);
103
+ }
104
+
105
+ /**
106
+ * Duplicate a broadcast (and its template) into a new draft named "{source name}
107
+ * (copy)".
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * const broadcast = await client.broadcasts.duplicate(
112
+ * 'broadcastId',
113
+ * );
114
+ * ```
115
+ */
116
+ duplicate(broadcastID: string, options?: RequestOptions): APIPromise<Broadcast> {
117
+ return this._client.post(path`/broadcasts/${broadcastID}/duplicate`, options);
118
+ }
119
+
120
+ /**
121
+ * Author the broadcast's content by replacing the draft elemental content of its
122
+ * private notification template. The draft is published automatically when the
123
+ * broadcast is sent or scheduled.
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * const notificationContentMutationResponse =
128
+ * await client.broadcasts.putContent('broadcastId', {
129
+ * content: {
130
+ * version: '2022-01-01',
131
+ * elements: [{ type: 'meta' }, { type: 'text' }],
132
+ * },
133
+ * });
134
+ * ```
135
+ */
136
+ putContent(
137
+ broadcastID: string,
138
+ body: BroadcastPutContentParams,
139
+ options?: RequestOptions,
140
+ ): APIPromise<NotificationsAPI.NotificationContentMutationResponse> {
141
+ return this._client.put(path`/broadcasts/${broadcastID}/content`, { body, ...options });
142
+ }
143
+
144
+ /**
145
+ * Retrieve the broadcast's content — the elemental content of its private
146
+ * notification template. Defaults to the working draft, since broadcast content is
147
+ * authored as a draft until the broadcast is sent.
148
+ *
149
+ * @example
150
+ * ```ts
151
+ * const notificationContentGetResponse =
152
+ * await client.broadcasts.retrieveContent('broadcastId');
153
+ * ```
154
+ */
155
+ retrieveContent(
156
+ broadcastID: string,
157
+ query: BroadcastRetrieveContentParams | null | undefined = {},
158
+ options?: RequestOptions,
159
+ ): APIPromise<NotificationsAPI.NotificationContentGetResponse> {
160
+ return this._client.get(path`/broadcasts/${broadcastID}/content`, { query, ...options });
161
+ }
162
+
163
+ /**
164
+ * Schedule a broadcast for a future send to a list or audience. Publishes the
165
+ * broadcast template first. Not allowed once the broadcast is sending or sent. For
166
+ * an immediate send use POST /broadcasts/{broadcastId}/send.
167
+ *
168
+ * @example
169
+ * ```ts
170
+ * const broadcast = await client.broadcasts.schedule(
171
+ * 'broadcastId',
172
+ * {
173
+ * recipient_id: 'aud_01kx4h2jdafq8bk9amzvy6hbv0',
174
+ * recipient_type: 'audience',
175
+ * scheduled_to: '2026-08-01T15:00:00',
176
+ * timezone: 'America/New_York',
177
+ * },
178
+ * );
179
+ * ```
180
+ */
181
+ schedule(
182
+ broadcastID: string,
183
+ body: BroadcastScheduleParams,
184
+ options?: RequestOptions,
185
+ ): APIPromise<Broadcast> {
186
+ return this._client.post(path`/broadcasts/${broadcastID}/schedule`, { body, ...options });
187
+ }
188
+
189
+ /**
190
+ * Send a broadcast immediately to a list or audience. Publishes the broadcast
191
+ * template first. Not allowed once the broadcast is sending or sent.
192
+ *
193
+ * @example
194
+ * ```ts
195
+ * const broadcast = await client.broadcasts.send(
196
+ * 'broadcastId',
197
+ * {
198
+ * recipient_id: 'cool-customers',
199
+ * recipient_type: 'list',
200
+ * },
201
+ * );
202
+ * ```
203
+ */
204
+ send(broadcastID: string, body: BroadcastSendParams, options?: RequestOptions): APIPromise<Broadcast> {
205
+ return this._client.post(path`/broadcasts/${broadcastID}/send`, { body, ...options });
206
+ }
207
+ }
208
+
209
+ /**
210
+ * A broadcast — a single-channel message delivered to a known set of recipients (a
211
+ * list or audience).
212
+ */
213
+ export interface Broadcast {
214
+ /**
215
+ * The broadcast ID (bst\_ prefix).
216
+ */
217
+ id: string;
218
+
219
+ /**
220
+ * The broadcast's delivery channel.
221
+ */
222
+ channel: 'email' | 'sms' | 'push' | 'inbox' | 'slack' | 'msteams';
223
+
224
+ /**
225
+ * ISO 8601 timestamp when the broadcast was created.
226
+ */
227
+ created_at: string;
228
+
229
+ /**
230
+ * Actor that created the broadcast.
231
+ */
232
+ created_by: string;
233
+
234
+ /**
235
+ * Human-readable name.
236
+ */
237
+ name: string;
238
+
239
+ /**
240
+ * Lifecycle status of the broadcast.
241
+ */
242
+ status: 'draft' | 'scheduled' | 'sending' | 'sent';
243
+
244
+ /**
245
+ * ISO 8601 timestamp of the last update.
246
+ */
247
+ updated_at: string;
248
+
249
+ /**
250
+ * Actor that last updated the broadcast.
251
+ */
252
+ updated_by: string;
253
+
254
+ /**
255
+ * ISO 8601 timestamp when the broadcast was archived, if archived.
256
+ */
257
+ archived_at?: string | null;
258
+
259
+ /**
260
+ * Actor that archived the broadcast, if archived.
261
+ */
262
+ archived_by?: string | null;
263
+
264
+ /**
265
+ * The delivery schedule and recipient targeting for a broadcast.
266
+ */
267
+ schedule?: BroadcastSchedule | null;
268
+ }
269
+
270
+ /**
271
+ * Paginated list of broadcasts.
272
+ */
273
+ export interface BroadcastListResponse {
274
+ paging: Shared.Paging;
275
+
276
+ results: Array<Broadcast>;
277
+ }
278
+
279
+ /**
280
+ * The delivery schedule and recipient targeting for a broadcast.
281
+ */
282
+ export interface BroadcastSchedule {
283
+ /**
284
+ * ID of the target list or audience.
285
+ */
286
+ recipient_id: string;
287
+
288
+ /**
289
+ * Whether the broadcast targets a list or an audience.
290
+ */
291
+ recipient_type: 'list' | 'audience';
292
+
293
+ /**
294
+ * Wall-clock timestamp of the scheduled send, no timezone offset (e.g.
295
+ * "2026-07-21T20:00:00").
296
+ */
297
+ scheduled_to?: string | null;
298
+
299
+ /**
300
+ * IANA timezone for the scheduled send (e.g. America/New_York).
301
+ */
302
+ timezone?: string | null;
303
+ }
304
+
305
+ /**
306
+ * Request body for creating a broadcast.
307
+ */
308
+ export interface CreateBroadcastRequest {
309
+ /**
310
+ * The single delivery channel for this broadcast.
311
+ */
312
+ channel: 'email' | 'sms' | 'push' | 'inbox' | 'slack' | 'msteams';
313
+
314
+ /**
315
+ * Human-readable name.
316
+ */
317
+ name: string;
318
+ }
319
+
320
+ /**
321
+ * Request body for scheduling a broadcast for a future send.
322
+ */
323
+ export interface ScheduleBroadcastRequest {
324
+ /**
325
+ * ID of the target list or audience.
326
+ */
327
+ recipient_id: string;
328
+
329
+ /**
330
+ * Whether the broadcast targets a list or an audience.
331
+ */
332
+ recipient_type: 'list' | 'audience';
333
+
334
+ /**
335
+ * Wall-clock timestamp of the future send, no timezone offset (e.g.
336
+ * "2026-07-21T20:00:00"). The zone is given by `timezone`.
337
+ */
338
+ scheduled_to: string;
339
+
340
+ /**
341
+ * IANA timezone for the scheduled send (e.g. America/New_York).
342
+ */
343
+ timezone?: string;
344
+ }
345
+
346
+ /**
347
+ * Request body for sending a broadcast immediately.
348
+ */
349
+ export interface SendBroadcastRequest {
350
+ /**
351
+ * ID of the target list or audience.
352
+ */
353
+ recipient_id: string;
354
+
355
+ /**
356
+ * Whether the broadcast targets a list or an audience.
357
+ */
358
+ recipient_type: 'list' | 'audience';
359
+ }
360
+
361
+ /**
362
+ * Request body for updating a broadcast. Only the name is mutable.
363
+ */
364
+ export interface UpdateBroadcastRequest {
365
+ /**
366
+ * New human-readable name.
367
+ */
368
+ name: string;
369
+ }
370
+
371
+ export interface BroadcastCreateParams {
372
+ /**
373
+ * The single delivery channel for this broadcast.
374
+ */
375
+ channel: 'email' | 'sms' | 'push' | 'inbox' | 'slack' | 'msteams';
376
+
377
+ /**
378
+ * Human-readable name.
379
+ */
380
+ name: string;
381
+ }
382
+
383
+ export interface BroadcastUpdateParams {
384
+ /**
385
+ * New human-readable name.
386
+ */
387
+ name: string;
388
+ }
389
+
390
+ export interface BroadcastListParams {
391
+ /**
392
+ * Opaque pagination cursor from a previous response. Omit for the first page.
393
+ */
394
+ cursor?: string | null;
395
+
396
+ /**
397
+ * Maximum number of results per page.
398
+ */
399
+ limit?: number;
400
+ }
401
+
402
+ export interface BroadcastPutContentParams {
403
+ /**
404
+ * Elemental content payload. The server defaults `version` when omitted.
405
+ */
406
+ content: BroadcastPutContentParams.Content;
407
+
408
+ /**
409
+ * Template state. Defaults to `DRAFT`.
410
+ */
411
+ state?: NotificationsAPI.NotificationTemplateState;
412
+ }
413
+
414
+ export namespace BroadcastPutContentParams {
415
+ /**
416
+ * Elemental content payload. The server defaults `version` when omitted.
417
+ */
418
+ export interface Content {
419
+ elements: Array<Shared.ElementalNode>;
420
+
421
+ /**
422
+ * Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
423
+ * omitted.
424
+ */
425
+ version?: string;
426
+ }
427
+ }
428
+
429
+ export interface BroadcastRetrieveContentParams {
430
+ /**
431
+ * Accepts `draft`, `published`, or a version string (e.g. `v001`). Defaults to
432
+ * `draft`.
433
+ */
434
+ version?: string;
435
+ }
436
+
437
+ export interface BroadcastScheduleParams {
438
+ /**
439
+ * ID of the target list or audience.
440
+ */
441
+ recipient_id: string;
442
+
443
+ /**
444
+ * Whether the broadcast targets a list or an audience.
445
+ */
446
+ recipient_type: 'list' | 'audience';
447
+
448
+ /**
449
+ * Wall-clock timestamp of the future send, no timezone offset (e.g.
450
+ * "2026-07-21T20:00:00"). The zone is given by `timezone`.
451
+ */
452
+ scheduled_to: string;
453
+
454
+ /**
455
+ * IANA timezone for the scheduled send (e.g. America/New_York).
456
+ */
457
+ timezone?: string;
458
+ }
459
+
460
+ export interface BroadcastSendParams {
461
+ /**
462
+ * ID of the target list or audience.
463
+ */
464
+ recipient_id: string;
465
+
466
+ /**
467
+ * Whether the broadcast targets a list or an audience.
468
+ */
469
+ recipient_type: 'list' | 'audience';
470
+ }
471
+
472
+ export declare namespace Broadcasts {
473
+ export {
474
+ type Broadcast as Broadcast,
475
+ type BroadcastListResponse as BroadcastListResponse,
476
+ type BroadcastSchedule as BroadcastSchedule,
477
+ type CreateBroadcastRequest as CreateBroadcastRequest,
478
+ type ScheduleBroadcastRequest as ScheduleBroadcastRequest,
479
+ type SendBroadcastRequest as SendBroadcastRequest,
480
+ type UpdateBroadcastRequest as UpdateBroadcastRequest,
481
+ type BroadcastCreateParams as BroadcastCreateParams,
482
+ type BroadcastUpdateParams as BroadcastUpdateParams,
483
+ type BroadcastListParams as BroadcastListParams,
484
+ type BroadcastPutContentParams as BroadcastPutContentParams,
485
+ type BroadcastRetrieveContentParams as BroadcastRetrieveContentParams,
486
+ type BroadcastScheduleParams as BroadcastScheduleParams,
487
+ type BroadcastSendParams as BroadcastSendParams,
488
+ };
489
+ }
@@ -7,11 +7,13 @@ import { buildHeaders } from '../../internal/headers';
7
7
  import { RequestOptions } from '../../internal/request-options';
8
8
  import { path } from '../../internal/utils/path';
9
9
 
10
+ /**
11
+ * Inspect what has accumulated in a digest schedule and release a digest ahead of its next scheduled delivery.
12
+ */
10
13
  export class Schedules extends APIResource {
11
14
  /**
12
- * List the digest instances for a schedule. Each instance represents the events
13
- * accumulated for a single user against the schedule, and can be used to monitor
14
- * digest accumulation before the digest is released.
15
+ * Returns the digest instances for a schedule, one per user, with cursor paging.
16
+ * Use it to see what has accumulated before a digest releases.
15
17
  */
16
18
  listInstances(
17
19
  scheduleID: string,
@@ -4,9 +4,13 @@ import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
+ /**
8
+ * Record an inbound event that triggers the journeys and automations mapped to it.
9
+ */
7
10
  export class Inbound extends APIResource {
8
11
  /**
9
- * Courier Track Event
12
+ * Records an inbound event that can trigger a journey. Requires an event name, a
13
+ * messageId you generate, a type, and a properties object.
10
14
  *
11
15
  * @example
12
16
  * ```ts
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as MessagesAPI from './messages';
5
+ import { MessageRestoreParams, Messages } from './messages';
6
+
7
+ export class Inbox extends APIResource {
8
+ messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);
9
+ }
10
+
11
+ Inbox.Messages = Messages;
12
+
13
+ export declare namespace Inbox {
14
+ export { Messages as Messages, type MessageRestoreParams as MessageRestoreParams };
15
+ }
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Inbox } from './inbox';
4
+ export { Messages, type MessageRestoreParams } from './messages';
@@ -0,0 +1,40 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ /**
10
+ * Manage the messages in a user's in-app inbox.
11
+ */
12
+ export class Messages extends APIResource {
13
+ /**
14
+ * Delete a user's inbox message. The message is removed from every inbox read (it
15
+ * stops appearing in the recipient's Inbox); it can be restored.
16
+ */
17
+ delete(messageID: string, options?: RequestOptions): APIPromise<void> {
18
+ return this._client.delete(path`/inbox/messages/${messageID}`, {
19
+ ...options,
20
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
21
+ });
22
+ }
23
+
24
+ /**
25
+ * Restore a previously deleted inbox message.
26
+ */
27
+ restore(messageID: string, body: MessageRestoreParams, options?: RequestOptions): APIPromise<void> {
28
+ return this._client.put(path`/inbox/messages/${messageID}/restore`, {
29
+ body,
30
+ ...options,
31
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
32
+ });
33
+ }
34
+ }
35
+
36
+ export interface MessageRestoreParams {}
37
+
38
+ export declare namespace Messages {
39
+ export { type MessageRestoreParams as MessageRestoreParams };
40
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './inbox/index';
@@ -46,6 +46,23 @@ export {
46
46
  type BrandUpdateParams,
47
47
  type BrandListParams,
48
48
  } from './brands';
49
+ export {
50
+ Broadcasts,
51
+ type Broadcast,
52
+ type BroadcastListResponse,
53
+ type BroadcastSchedule,
54
+ type CreateBroadcastRequest,
55
+ type ScheduleBroadcastRequest,
56
+ type SendBroadcastRequest,
57
+ type UpdateBroadcastRequest,
58
+ type BroadcastCreateParams,
59
+ type BroadcastUpdateParams,
60
+ type BroadcastListParams,
61
+ type BroadcastPutContentParams,
62
+ type BroadcastRetrieveContentParams,
63
+ type BroadcastScheduleParams,
64
+ type BroadcastSendParams,
65
+ } from './broadcasts';
49
66
  export {
50
67
  Digests,
51
68
  type DigestCategory,
@@ -53,6 +70,7 @@ export {
53
70
  type DigestInstanceListResponse,
54
71
  } from './digests/digests';
55
72
  export { Inbound, type InboundTrackEventResponse, type InboundTrackEventParams } from './inbound';
73
+ export { Inbox } from './inbox/inbox';
56
74
  export {
57
75
  Journeys,
58
76
  type CancelJourneyRequest,