trycourier 4.20.0 → 4.22.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 (207) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/lib/courier/client.rb +39 -4
  4. data/lib/courier/models/automations/invoke_invoke_ad_hoc_params.rb +13 -1
  5. data/lib/courier/models/automations/invoke_invoke_by_template_params.rb +13 -1
  6. data/lib/courier/models/brand_create_params.rb +13 -1
  7. data/lib/courier/models/inbox/message_delete_params.rb +22 -0
  8. data/lib/courier/models/inbox/message_restore_params.rb +22 -0
  9. data/lib/courier/models/journey_cancel_params.rb +13 -1
  10. data/lib/courier/models/journey_create_params.rb +13 -1
  11. data/lib/courier/models/journey_invoke_params.rb +13 -1
  12. data/lib/courier/models/journey_publish_params.rb +13 -1
  13. data/lib/courier/models/journeys/template_create_params.rb +13 -1
  14. data/lib/courier/models/journeys/template_publish_params.rb +13 -1
  15. data/lib/courier/models/lists/subscription_add_params.rb +13 -1
  16. data/lib/courier/models/notification_create_params.rb +13 -1
  17. data/lib/courier/models/notification_publish_params.rb +13 -1
  18. data/lib/courier/models/profile_create_params.rb +13 -1
  19. data/lib/courier/models/profiles/list_subscribe_params.rb +13 -1
  20. data/lib/courier/models/provider_create_params.rb +15 -1
  21. data/lib/courier/models/routing_strategy_create_params.rb +13 -1
  22. data/lib/courier/models/send_message_params.rb +15 -1
  23. data/lib/courier/models/users/preference_bulk_update_params.rb +15 -1
  24. data/lib/courier/models/users/preference_update_or_create_topic_params.rb +14 -4
  25. data/lib/courier/models/users/topic_preference.rb +21 -7
  26. data/lib/courier/models/workspace_preference_create_params.rb +13 -1
  27. data/lib/courier/models/workspace_preference_publish_params.rb +13 -1
  28. data/lib/courier/models/workspace_preferences/topic_create_params.rb +13 -1
  29. data/lib/courier/models.rb +2 -14
  30. data/lib/courier/resources/audiences.rb +12 -5
  31. data/lib/courier/resources/audit_events.rb +5 -2
  32. data/lib/courier/resources/auth.rb +5 -1
  33. data/lib/courier/resources/automations/invoke.rb +47 -23
  34. data/lib/courier/resources/automations.rb +6 -1
  35. data/lib/courier/resources/brands.rb +38 -12
  36. data/lib/courier/resources/digests/schedules.rb +4 -3
  37. data/lib/courier/resources/digests.rb +2 -0
  38. data/lib/courier/resources/inbound.rb +3 -1
  39. data/lib/courier/resources/inbox/messages.rb +58 -0
  40. data/lib/courier/resources/inbox.rb +19 -0
  41. data/lib/courier/resources/journeys/templates.rb +43 -25
  42. data/lib/courier/resources/journeys.rb +73 -44
  43. data/lib/courier/resources/lists/subscriptions.rb +22 -8
  44. data/lib/courier/resources/lists.rb +14 -5
  45. data/lib/courier/resources/messages.rb +14 -14
  46. data/lib/courier/resources/notifications/checks.rb +8 -3
  47. data/lib/courier/resources/notifications.rb +48 -30
  48. data/lib/courier/resources/profiles/lists.rb +19 -8
  49. data/lib/courier/resources/profiles.rb +25 -14
  50. data/lib/courier/resources/providers/catalog.rb +4 -4
  51. data/lib/courier/resources/providers.rb +27 -18
  52. data/lib/courier/resources/requests.rb +4 -1
  53. data/lib/courier/resources/routing_strategies.rb +24 -12
  54. data/lib/courier/resources/send.rb +14 -4
  55. data/lib/courier/resources/tenants/preferences/items.rb +6 -2
  56. data/lib/courier/resources/tenants/preferences.rb +2 -0
  57. data/lib/courier/resources/tenants/templates/versions.rb +4 -7
  58. data/lib/courier/resources/tenants/templates.rb +14 -19
  59. data/lib/courier/resources/tenants.rb +14 -5
  60. data/lib/courier/resources/translations.rb +6 -2
  61. data/lib/courier/resources/users/preferences.rb +23 -42
  62. data/lib/courier/resources/users/tenants.rb +12 -10
  63. data/lib/courier/resources/users/tokens.rb +14 -6
  64. data/lib/courier/resources/users.rb +6 -0
  65. data/lib/courier/resources/workspace_preferences/topics.rb +27 -19
  66. data/lib/courier/resources/workspace_preferences.rb +40 -20
  67. data/lib/courier/version.rb +1 -1
  68. data/lib/courier.rb +4 -11
  69. data/rbi/courier/client.rbi +38 -3
  70. data/rbi/courier/models/automations/invoke_invoke_ad_hoc_params.rbi +18 -0
  71. data/rbi/courier/models/automations/invoke_invoke_by_template_params.rbi +18 -0
  72. data/rbi/courier/models/brand_create_params.rbi +18 -0
  73. data/rbi/courier/models/inbox/message_delete_params.rbi +40 -0
  74. data/rbi/courier/models/inbox/message_restore_params.rbi +40 -0
  75. data/rbi/courier/models/journey_cancel_params.rbi +31 -5
  76. data/rbi/courier/models/journey_create_params.rbi +31 -5
  77. data/rbi/courier/models/journey_invoke_params.rbi +26 -2
  78. data/rbi/courier/models/journey_publish_params.rbi +26 -2
  79. data/rbi/courier/models/journeys/template_create_params.rbi +26 -2
  80. data/rbi/courier/models/journeys/template_publish_params.rbi +23 -1
  81. data/rbi/courier/models/lists/subscription_add_params.rbi +23 -1
  82. data/rbi/courier/models/notification_create_params.rbi +31 -5
  83. data/rbi/courier/models/notification_publish_params.rbi +26 -2
  84. data/rbi/courier/models/profile_create_params.rbi +23 -1
  85. data/rbi/courier/models/profiles/list_subscribe_params.rbi +23 -1
  86. data/rbi/courier/models/provider_create_params.rbi +18 -0
  87. data/rbi/courier/models/routing_strategy_create_params.rbi +31 -5
  88. data/rbi/courier/models/send_message_params.rbi +18 -0
  89. data/rbi/courier/models/users/preference_bulk_update_params.rbi +18 -0
  90. data/rbi/courier/models/users/preference_update_or_create_topic_params.rbi +14 -2
  91. data/rbi/courier/models/users/topic_preference.rbi +24 -2
  92. data/rbi/courier/models/workspace_preference_create_params.rbi +31 -5
  93. data/rbi/courier/models/workspace_preference_publish_params.rbi +31 -5
  94. data/rbi/courier/models/workspace_preferences/topic_create_params.rbi +26 -2
  95. data/rbi/courier/models.rbi +2 -14
  96. data/rbi/courier/resources/audiences.rbi +12 -5
  97. data/rbi/courier/resources/audit_events.rbi +5 -2
  98. data/rbi/courier/resources/auth.rbi +5 -1
  99. data/rbi/courier/resources/automations/invoke.rbi +48 -7
  100. data/rbi/courier/resources/automations.rbi +6 -1
  101. data/rbi/courier/resources/brands.rbi +37 -7
  102. data/rbi/courier/resources/digests/schedules.rbi +4 -3
  103. data/rbi/courier/resources/digests.rbi +2 -0
  104. data/rbi/courier/resources/inbound.rbi +3 -1
  105. data/rbi/courier/resources/inbox/messages.rbi +44 -0
  106. data/rbi/courier/resources/inbox.rbi +16 -0
  107. data/rbi/courier/resources/journeys/templates.rbi +47 -17
  108. data/rbi/courier/resources/journeys.rbi +93 -39
  109. data/rbi/courier/resources/lists/subscriptions.rbi +24 -5
  110. data/rbi/courier/resources/lists.rbi +14 -5
  111. data/rbi/courier/resources/messages.rbi +14 -14
  112. data/rbi/courier/resources/notifications/checks.rbi +8 -3
  113. data/rbi/courier/resources/notifications.rbi +58 -28
  114. data/rbi/courier/resources/profiles/lists.rbi +25 -6
  115. data/rbi/courier/resources/profiles.rbi +31 -11
  116. data/rbi/courier/resources/providers/catalog.rbi +4 -4
  117. data/rbi/courier/resources/providers.rbi +35 -19
  118. data/rbi/courier/resources/requests.rbi +4 -1
  119. data/rbi/courier/resources/routing_strategies.rbi +26 -10
  120. data/rbi/courier/resources/send.rbi +20 -3
  121. data/rbi/courier/resources/tenants/preferences/items.rbi +6 -2
  122. data/rbi/courier/resources/tenants/preferences.rbi +2 -0
  123. data/rbi/courier/resources/tenants/templates/versions.rbi +4 -7
  124. data/rbi/courier/resources/tenants/templates.rbi +14 -19
  125. data/rbi/courier/resources/tenants.rbi +14 -5
  126. data/rbi/courier/resources/translations.rbi +6 -2
  127. data/rbi/courier/resources/users/preferences.rbi +28 -40
  128. data/rbi/courier/resources/users/tenants.rbi +12 -10
  129. data/rbi/courier/resources/users/tokens.rbi +14 -6
  130. data/rbi/courier/resources/users.rbi +6 -0
  131. data/rbi/courier/resources/workspace_preferences/topics.rbi +37 -18
  132. data/rbi/courier/resources/workspace_preferences.rbi +51 -17
  133. data/sig/courier/client.rbs +2 -2
  134. data/sig/courier/models/automations/invoke_invoke_ad_hoc_params.rbs +15 -1
  135. data/sig/courier/models/automations/invoke_invoke_by_template_params.rbs +15 -1
  136. data/sig/courier/models/brand_create_params.rbs +15 -1
  137. data/sig/courier/models/inbox/message_delete_params.rbs +25 -0
  138. data/sig/courier/models/inbox/message_restore_params.rbs +25 -0
  139. data/sig/courier/models/journey_cancel_params.rbs +20 -3
  140. data/sig/courier/models/journey_create_params.rbs +20 -3
  141. data/sig/courier/models/journey_invoke_params.rbs +18 -1
  142. data/sig/courier/models/journey_publish_params.rbs +18 -1
  143. data/sig/courier/models/journeys/template_create_params.rbs +18 -1
  144. data/sig/courier/models/journeys/template_publish_params.rbs +18 -1
  145. data/sig/courier/models/lists/subscription_add_params.rbs +15 -1
  146. data/sig/courier/models/notification_create_params.rbs +20 -3
  147. data/sig/courier/models/notification_publish_params.rbs +18 -2
  148. data/sig/courier/models/profile_create_params.rbs +18 -1
  149. data/sig/courier/models/profiles/list_subscribe_params.rbs +15 -1
  150. data/sig/courier/models/provider_create_params.rbs +15 -1
  151. data/sig/courier/models/routing_strategy_create_params.rbs +20 -3
  152. data/sig/courier/models/send_message_params.rbs +17 -1
  153. data/sig/courier/models/users/preference_bulk_update_params.rbs +15 -1
  154. data/sig/courier/models/workspace_preference_create_params.rbs +20 -3
  155. data/sig/courier/models/workspace_preference_publish_params.rbs +20 -3
  156. data/sig/courier/models/workspace_preferences/topic_create_params.rbs +18 -1
  157. data/sig/courier/models.rbs +2 -14
  158. data/sig/courier/resources/automations/invoke.rbs +4 -0
  159. data/sig/courier/resources/brands.rbs +2 -0
  160. data/sig/courier/resources/inbox/messages.rbs +19 -0
  161. data/sig/courier/resources/inbox.rbs +9 -0
  162. data/sig/courier/resources/journeys/templates.rbs +4 -0
  163. data/sig/courier/resources/journeys.rbs +8 -0
  164. data/sig/courier/resources/lists/subscriptions.rbs +2 -0
  165. data/sig/courier/resources/notifications.rbs +4 -0
  166. data/sig/courier/resources/profiles/lists.rbs +2 -0
  167. data/sig/courier/resources/profiles.rbs +2 -0
  168. data/sig/courier/resources/providers.rbs +2 -0
  169. data/sig/courier/resources/routing_strategies.rbs +2 -0
  170. data/sig/courier/resources/send.rbs +2 -0
  171. data/sig/courier/resources/users/preferences.rbs +2 -0
  172. data/sig/courier/resources/workspace_preferences/topics.rbs +2 -0
  173. data/sig/courier/resources/workspace_preferences.rbs +4 -0
  174. metadata +14 -35
  175. data/lib/courier/models/bulk_add_users_params.rb +0 -26
  176. data/lib/courier/models/bulk_create_job_params.rb +0 -29
  177. data/lib/courier/models/bulk_create_job_response.rb +0 -16
  178. data/lib/courier/models/bulk_list_users_params.rb +0 -33
  179. data/lib/courier/models/bulk_list_users_response.rb +0 -49
  180. data/lib/courier/models/bulk_retrieve_job_params.rb +0 -20
  181. data/lib/courier/models/bulk_retrieve_job_response.rb +0 -76
  182. data/lib/courier/models/bulk_run_job_params.rb +0 -20
  183. data/lib/courier/models/inbound_bulk_message.rb +0 -91
  184. data/lib/courier/models/inbound_bulk_message_user.rb +0 -54
  185. data/lib/courier/resources/bulk.rb +0 -141
  186. data/rbi/courier/models/bulk_add_users_params.rbi +0 -43
  187. data/rbi/courier/models/bulk_create_job_params.rbi +0 -54
  188. data/rbi/courier/models/bulk_create_job_response.rbi +0 -26
  189. data/rbi/courier/models/bulk_list_users_params.rbi +0 -51
  190. data/rbi/courier/models/bulk_list_users_response.rbi +0 -125
  191. data/rbi/courier/models/bulk_retrieve_job_params.rbi +0 -35
  192. data/rbi/courier/models/bulk_retrieve_job_response.rbi +0 -157
  193. data/rbi/courier/models/bulk_run_job_params.rbi +0 -35
  194. data/rbi/courier/models/inbound_bulk_message.rbi +0 -124
  195. data/rbi/courier/models/inbound_bulk_message_user.rbi +0 -88
  196. data/rbi/courier/resources/bulk.rbi +0 -102
  197. data/sig/courier/models/bulk_add_users_params.rbs +0 -28
  198. data/sig/courier/models/bulk_create_job_params.rbs +0 -24
  199. data/sig/courier/models/bulk_create_job_response.rbs +0 -13
  200. data/sig/courier/models/bulk_list_users_params.rbs +0 -28
  201. data/sig/courier/models/bulk_list_users_response.rbs +0 -65
  202. data/sig/courier/models/bulk_retrieve_job_params.rbs +0 -23
  203. data/sig/courier/models/bulk_retrieve_job_response.rbs +0 -66
  204. data/sig/courier/models/bulk_run_job_params.rbs +0 -23
  205. data/sig/courier/models/inbound_bulk_message.rbs +0 -58
  206. data/sig/courier/models/inbound_bulk_message_user.rbs +0 -42
  207. data/sig/courier/resources/bulk.rbs +0 -34
@@ -2,8 +2,11 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Define filter-based groups whose membership Courier recalculates as user
6
+ # profiles change.
5
7
  class Audiences
6
- # Returns the specified audience by id.
8
+ # Returns one audience with its name, description, and the filter and AND or OR
9
+ # operator that decide which users belong to it.
7
10
  sig do
8
11
  params(
9
12
  audience_id: String,
@@ -17,7 +20,8 @@ module Courier
17
20
  )
18
21
  end
19
22
 
20
- # Creates or updates audience.
23
+ # Creates or replaces an audience from a filter and an AND or OR operator.
24
+ # Membership recalculates automatically as profiles change.
21
25
  sig do
22
26
  params(
23
27
  audience_id: String,
@@ -46,7 +50,8 @@ module Courier
46
50
  )
47
51
  end
48
52
 
49
- # Get the audiences associated with the authorization token.
53
+ # Returns the audiences in the workspace with paging. Audiences are filter-based
54
+ # groups that recalculate as user profiles change.
50
55
  sig do
51
56
  params(
52
57
  cursor: T.nilable(String),
@@ -60,7 +65,8 @@ module Courier
60
65
  )
61
66
  end
62
67
 
63
- # Deletes the specified audience.
68
+ # Deletes an audience permanently, so update any caller sending to it by audience
69
+ # id first. Those sends fail once the audience is gone.
64
70
  sig do
65
71
  params(
66
72
  audience_id: String,
@@ -74,7 +80,8 @@ module Courier
74
80
  )
75
81
  end
76
82
 
77
- # Get list of members of an audience.
83
+ # Returns the users currently matching an audience filter, with paging. Membership
84
+ # is recalculated, so results shift as profiles change.
78
85
  sig do
79
86
  params(
80
87
  audience_id: String,
@@ -2,8 +2,10 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Read the audit trail of configuration and access changes in your workspace.
5
6
  class AuditEvents
6
- # Fetch a specific audit event by ID.
7
+ # Returns one audit event by id, including the actor who performed it, the target
8
+ # they changed, the source, the event type, and a timestamp.
7
9
  sig do
8
10
  params(
9
11
  audit_event_id: String,
@@ -17,7 +19,8 @@ module Courier
17
19
  )
18
20
  end
19
21
 
20
- # Fetch the list of audit events
22
+ # Returns the workspace's audit event log with cursor paging. Each event records
23
+ # the actor, target, source, type, and timestamp of a change.
21
24
  sig do
22
25
  params(
23
26
  cursor: T.nilable(String),
@@ -2,8 +2,12 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Issue scoped, short-lived JWTs so client-side SDKs — Inbox, Preferences, and the
6
+ # embedded designer — can call Courier as a single user. Server-side requests
7
+ # authenticate with your workspace API key instead.
5
8
  class Auth
6
- # Returns a new access token.
9
+ # Returns a JWT for authenticating client-side SDKs such as the Inbox. You supply
10
+ # the scope and an expires_in duration, both required.
7
11
  sig do
8
12
  params(
9
13
  expires_in: String,
@@ -3,11 +3,11 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Automations
6
+ # Invoke a stored automation template or an ad hoc automation defined in the
7
+ # request.
6
8
  class Invoke
7
- # Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a
8
- # series of automation steps. For information about what steps are available,
9
- # checkout the ad hoc automation guide
10
- # [here](https://www.courier.com/docs/automations/steps/).
9
+ # Runs a series of automation steps supplied inline, without a saved template, and
10
+ # returns a runId.
11
11
  sig do
12
12
  params(
13
13
  automation:
@@ -17,21 +17,42 @@ module Courier
17
17
  profile: T.nilable(T::Hash[Symbol, T.anything]),
18
18
  recipient: T.nilable(String),
19
19
  template: T.nilable(String),
20
+ idempotency_key: String,
21
+ x_idempotency_expiration: String,
20
22
  request_options: Courier::RequestOptions::OrHash
21
23
  ).returns(Courier::AutomationInvokeResponse)
22
24
  end
23
25
  def invoke_ad_hoc(
26
+ # Body param
24
27
  automation:,
28
+ # Body param
25
29
  brand: nil,
30
+ # Body param
26
31
  data: nil,
32
+ # Body param
27
33
  profile: nil,
34
+ # Body param
28
35
  recipient: nil,
36
+ # Body param
29
37
  template: nil,
38
+ # Header param: A unique key that makes this request idempotent. If Courier
39
+ # receives another request with the same `Idempotency-Key`, it returns the stored
40
+ # response from the first request without performing the operation again
41
+ # (including the original status code and any error). Use it to safely retry
42
+ # `POST` requests after network failures without risking duplicate sends. The key
43
+ # is scoped to this endpoint.
44
+ idempotency_key: nil,
45
+ # Header param: How long the idempotency key remains valid, as a Unix epoch
46
+ # timestamp in seconds or an ISO 8601 date string. Only applies when
47
+ # `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
48
+ # maximum is 1 year.
49
+ x_idempotency_expiration: nil,
30
50
  request_options: {}
31
51
  )
32
52
  end
33
53
 
34
- # Invoke an automation run from an automation template.
54
+ # Starts an automation run from a saved template for one recipient, with optional
55
+ # data and profile, and returns a runId.
35
56
  sig do
36
57
  params(
37
58
  template_id: String,
@@ -40,18 +61,38 @@ module Courier
40
61
  data: T.nilable(T::Hash[Symbol, T.anything]),
41
62
  profile: T.nilable(T::Hash[Symbol, T.anything]),
42
63
  template: T.nilable(String),
64
+ idempotency_key: String,
65
+ x_idempotency_expiration: String,
43
66
  request_options: Courier::RequestOptions::OrHash
44
67
  ).returns(Courier::AutomationInvokeResponse)
45
68
  end
46
69
  def invoke_by_template(
47
- # A unique identifier representing the automation template to be invoked. This
48
- # could be the Automation Template ID or the Automation Template Alias.
70
+ # Path param: A unique identifier representing the automation template to be
71
+ # invoked. This could be the Automation Template ID or the Automation Template
72
+ # Alias.
49
73
  template_id,
74
+ # Body param
50
75
  recipient:,
76
+ # Body param
51
77
  brand: nil,
78
+ # Body param
52
79
  data: nil,
80
+ # Body param
53
81
  profile: nil,
82
+ # Body param
54
83
  template: nil,
84
+ # Header param: A unique key that makes this request idempotent. If Courier
85
+ # receives another request with the same `Idempotency-Key`, it returns the stored
86
+ # response from the first request without performing the operation again
87
+ # (including the original status code and any error). Use it to safely retry
88
+ # `POST` requests after network failures without risking duplicate sends. The key
89
+ # is scoped to this endpoint.
90
+ idempotency_key: nil,
91
+ # Header param: How long the idempotency key remains valid, as a Unix epoch
92
+ # timestamp in seconds or an ISO 8601 date string. Only applies when
93
+ # `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
94
+ # maximum is 1 year.
95
+ x_idempotency_expiration: nil,
55
96
  request_options: {}
56
97
  )
57
98
  end
@@ -2,11 +2,16 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Invoke a stored automation template or an ad hoc automation defined in the
6
+ # request.
5
7
  class Automations
8
+ # Invoke a stored automation template or an ad hoc automation defined in the
9
+ # request.
6
10
  sig { returns(Courier::Resources::Automations::Invoke) }
7
11
  attr_reader :invoke
8
12
 
9
- # Get the list of automations.
13
+ # Lists the workspace's saved automation templates, each with its id and a cursor
14
+ # for paging to the next page of results.
10
15
  sig do
11
16
  params(
12
17
  cursor: String,
@@ -2,22 +2,49 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Manage the logos, colors, and layout that give the templates you send a
6
+ # consistent look.
5
7
  class Brands
6
- # Create a new brand. Requires `name` and `settings` (with at least
7
- # `colors.primary` and `colors.secondary`).
8
+ # Creates a brand from a name and settings, including primary and secondary
9
+ # colors. Brands supply the logo, colors, and styling that templates render with.
8
10
  sig do
9
11
  params(
10
12
  name: String,
11
13
  settings: Courier::BrandSettings::OrHash,
12
14
  id: T.nilable(String),
13
15
  snippets: T.nilable(Courier::BrandSnippets::OrHash),
16
+ idempotency_key: String,
17
+ x_idempotency_expiration: String,
14
18
  request_options: Courier::RequestOptions::OrHash
15
19
  ).returns(Courier::Brand)
16
20
  end
17
- def create(name:, settings:, id: nil, snippets: nil, request_options: {})
21
+ def create(
22
+ # Body param
23
+ name:,
24
+ # Body param
25
+ settings:,
26
+ # Body param
27
+ id: nil,
28
+ # Body param
29
+ snippets: nil,
30
+ # Header param: A unique key that makes this request idempotent. If Courier
31
+ # receives another request with the same `Idempotency-Key`, it returns the stored
32
+ # response from the first request without performing the operation again
33
+ # (including the original status code and any error). Use it to safely retry
34
+ # `POST` requests after network failures without risking duplicate sends. The key
35
+ # is scoped to this endpoint.
36
+ idempotency_key: nil,
37
+ # Header param: How long the idempotency key remains valid, as a Unix epoch
38
+ # timestamp in seconds or an ISO 8601 date string. Only applies when
39
+ # `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
40
+ # maximum is 1 year.
41
+ x_idempotency_expiration: nil,
42
+ request_options: {}
43
+ )
18
44
  end
19
45
 
20
- # Fetch a specific brand by brand ID.
46
+ # Returns one brand by id, including its colors, logo and styling settings,
47
+ # Handlebars snippets, and published version.
21
48
  sig do
22
49
  params(
23
50
  brand_id: String,
@@ -31,7 +58,8 @@ module Courier
31
58
  )
32
59
  end
33
60
 
34
- # Replace an existing brand with the supplied values.
61
+ # Replaces a brand with the values you supply, so send the complete settings and
62
+ # snippets rather than only the fields you want changed.
35
63
  sig do
36
64
  params(
37
65
  brand_id: String,
@@ -52,7 +80,8 @@ module Courier
52
80
  )
53
81
  end
54
82
 
55
- # Get the list of brands.
83
+ # Lists the workspace's brands. Every entry carries its name, styling settings,
84
+ # snippets, and published version.
56
85
  sig do
57
86
  params(
58
87
  cursor: T.nilable(String),
@@ -66,7 +95,8 @@ module Courier
66
95
  )
67
96
  end
68
97
 
69
- # Delete a brand by brand ID.
98
+ # Deletes a brand by id. Reassign any template or tenant that references it before
99
+ # deleting to keep their styling intact.
70
100
  sig do
71
101
  params(
72
102
  brand_id: String,
@@ -3,10 +3,11 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Digests
6
+ # Inspect what has accumulated in a digest schedule and release a digest ahead of
7
+ # its next scheduled delivery.
6
8
  class Schedules
7
- # List the digest instances for a schedule. Each instance represents the events
8
- # accumulated for a single user against the schedule, and can be used to monitor
9
- # digest accumulation before the digest is released.
9
+ # Returns the digest instances for a schedule, one per user, with cursor paging.
10
+ # Use it to see what has accumulated before a digest releases.
10
11
  sig do
11
12
  params(
12
13
  schedule_id: String,
@@ -3,6 +3,8 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Digests
6
+ # Inspect what has accumulated in a digest schedule and release a digest ahead of
7
+ # its next scheduled delivery.
6
8
  sig { returns(Courier::Resources::Digests::Schedules) }
7
9
  attr_reader :schedules
8
10
 
@@ -2,8 +2,10 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Record an inbound event that triggers the journeys and automations mapped to it.
5
6
  class Inbound
6
- # Courier Track Event
7
+ # Records an inbound event that can trigger a journey. Requires an event name, a
8
+ # messageId you generate, a type, and a properties object.
7
9
  sig do
8
10
  params(
9
11
  event: String,
@@ -0,0 +1,44 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Resources
5
+ class Inbox
6
+ # Manage the messages in a user's in-app inbox.
7
+ class Messages
8
+ # Delete a user's inbox message. The message is removed from every inbox read (it
9
+ # stops appearing in the recipient's Inbox); it can be restored.
10
+ sig do
11
+ params(
12
+ message_id: String,
13
+ request_options: Courier::RequestOptions::OrHash
14
+ ).void
15
+ end
16
+ def delete(
17
+ # The message ID of the inbox message to delete.
18
+ message_id,
19
+ request_options: {}
20
+ )
21
+ end
22
+
23
+ # Restore a previously deleted inbox message.
24
+ sig do
25
+ params(
26
+ message_id: String,
27
+ request_options: Courier::RequestOptions::OrHash
28
+ ).void
29
+ end
30
+ def restore(
31
+ # The message ID of the inbox message to restore.
32
+ message_id,
33
+ request_options: {}
34
+ )
35
+ end
36
+
37
+ # @api private
38
+ sig { params(client: Courier::Client).returns(T.attached_class) }
39
+ def self.new(client:)
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,16 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Resources
5
+ class Inbox
6
+ # Manage the messages in a user's in-app inbox.
7
+ sig { returns(Courier::Resources::Inbox::Messages) }
8
+ attr_reader :messages
9
+
10
+ # @api private
11
+ sig { params(client: Courier::Client).returns(T.attached_class) }
12
+ def self.new(client:)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -3,6 +3,8 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Journeys
6
+ # Build, version, publish, invoke, and cancel multi-step notification workflows,
7
+ # along with the templates scoped to them.
6
8
  class Templates
7
9
  # Create a notification template scoped to this journey. Defaults to `DRAFT`
8
10
  # state; pass `state: "PUBLISHED"` to publish on create.
@@ -14,23 +16,40 @@ module Courier
14
16
  Courier::JourneyTemplateCreateRequest::Notification::OrHash,
15
17
  provider_key: String,
16
18
  state: String,
19
+ idempotency_key: String,
20
+ x_idempotency_expiration: String,
17
21
  request_options: Courier::RequestOptions::OrHash
18
22
  ).returns(Courier::JourneyTemplateGetResponse)
19
23
  end
20
24
  def create(
21
- # Journey id
25
+ # Path param: Journey id
22
26
  template_id,
27
+ # Body param
23
28
  channel:,
29
+ # Body param
24
30
  notification:,
31
+ # Body param
25
32
  provider_key: nil,
33
+ # Body param
26
34
  state: nil,
35
+ # Header param: A unique key that makes this request idempotent. If Courier
36
+ # receives another request with the same `Idempotency-Key`, it returns the stored
37
+ # response from the first request without performing the operation again
38
+ # (including the original status code and any error). Use it to safely retry
39
+ # `POST` requests after network failures without risking duplicate sends. The key
40
+ # is scoped to this endpoint.
41
+ idempotency_key: nil,
42
+ # Header param: How long the idempotency key remains valid, as a Unix epoch
43
+ # timestamp in seconds or an ISO 8601 date string. Only applies when
44
+ # `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
45
+ # maximum is 1 year.
46
+ x_idempotency_expiration: nil,
27
47
  request_options: {}
28
48
  )
29
49
  end
30
50
 
31
- # Fetch a journey-scoped notification template by id. Pass `?version=draft`
32
- # (default `published`) to retrieve the working draft, or `?version=vN` for a
33
- # historical version.
51
+ # Returns a journey's own notification template with its name, brand, subscription
52
+ # topic, and content. Defaults to the published version.
34
53
  sig do
35
54
  params(
36
55
  notification_id: String,
@@ -68,8 +87,8 @@ module Courier
68
87
  )
69
88
  end
70
89
 
71
- # Archive the journey-scoped notification template. Archived templates cannot be
72
- # sent.
90
+ # Archives one journey's notification template, preventing further sends. Detach
91
+ # any send node referencing it beforehand.
73
92
  sig do
74
93
  params(
75
94
  notification_id: String,
@@ -86,8 +105,8 @@ module Courier
86
105
  )
87
106
  end
88
107
 
89
- # List published versions of the journey-scoped notification template, ordered
90
- # most recent first.
108
+ # Lists the published versions of a template that belongs to a journey, most
109
+ # recent first. Paged by cursor.
91
110
  sig do
92
111
  params(
93
112
  notification_id: String,
@@ -104,14 +123,15 @@ module Courier
104
123
  )
105
124
  end
106
125
 
107
- # Publish the current draft of the journey-scoped notification template as a new
108
- # version. Optionally roll back to a prior version by passing
109
- # `{ "version": "vN" }`.
126
+ # Publishes a journey-scoped template's draft as a new version. Pass a version
127
+ # instead to roll back the template to an earlier publish.
110
128
  sig do
111
129
  params(
112
130
  notification_id: String,
113
131
  template_id: String,
114
132
  version: String,
133
+ idempotency_key: String,
134
+ x_idempotency_expiration: String,
115
135
  request_options: Courier::RequestOptions::OrHash
116
136
  ).void
117
137
  end
@@ -122,6 +142,18 @@ module Courier
122
142
  template_id:,
123
143
  # Body param
124
144
  version: nil,
145
+ # Header param: A unique key that makes this request idempotent. If Courier
146
+ # receives another request with the same `Idempotency-Key`, it returns the stored
147
+ # response from the first request without performing the operation again
148
+ # (including the original status code and any error). Use it to safely retry
149
+ # `POST` requests after network failures without risking duplicate sends. The key
150
+ # is scoped to this endpoint.
151
+ idempotency_key: nil,
152
+ # Header param: How long the idempotency key remains valid, as a Unix epoch
153
+ # timestamp in seconds or an ISO 8601 date string. Only applies when
154
+ # `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
155
+ # maximum is 1 year.
156
+ x_idempotency_expiration: nil,
125
157
  request_options: {}
126
158
  )
127
159
  end
@@ -179,7 +211,8 @@ module Courier
179
211
  )
180
212
  end
181
213
 
182
- # Replace the journey-scoped notification template draft.
214
+ # Replaces the draft content of one journey's notification template. Publish it
215
+ # before send nodes referencing it render the change.
183
216
  sig do
184
217
  params(
185
218
  notification_id: String,
@@ -203,11 +236,8 @@ module Courier
203
236
  )
204
237
  end
205
238
 
206
- # Retrieve the elemental content of a journey-scoped notification template. The
207
- # response contains the versioned elements along with their content checksums,
208
- # which can be used to detect changes between versions. Pass `?version=draft`
209
- # (default `published`) to retrieve the working draft, or `?version=vN` for a
210
- # historical version.
239
+ # Returns the Elemental elements and version of a journey-scoped template's
240
+ # content. Compare versions to see what changed between publishes.
211
241
  sig do
212
242
  params(
213
243
  notification_id: String,