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
@@ -3,8 +3,11 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Profiles
6
+ # Store the contact information Courier delivers to for each user — email, phone
7
+ # number, push tokens, and any custom data you send to.
6
8
  class Lists
7
- # Returns the subscribed lists for a specified user.
9
+ # Returns the lists a user is subscribed to, with paging. Use it to check what a
10
+ # recipient will receive before sending to a list.
8
11
  sig do
9
12
  params(
10
13
  user_id: String,
@@ -22,7 +25,8 @@ module Courier
22
25
  )
23
26
  end
24
27
 
25
- # Removes all list subscriptions for given user.
28
+ # Removes every list subscription for a user at once. Their profile and
29
+ # preferences are untouched, so this only affects list-targeted sends.
26
30
  sig do
27
31
  params(
28
32
  user_id: String,
@@ -36,20 +40,35 @@ module Courier
36
40
  )
37
41
  end
38
42
 
39
- # Subscribes the given user to one or more lists. If the list does not exist, it
40
- # will be created.
43
+ # Subscribes a user to one or more lists, creating any list that does not yet
44
+ # exist. Optional preferences apply to each subscription.
41
45
  sig do
42
46
  params(
43
47
  user_id: String,
44
48
  lists: T::Array[Courier::SubscribeToListsRequestItem::OrHash],
49
+ idempotency_key: String,
50
+ x_idempotency_expiration: String,
45
51
  request_options: Courier::RequestOptions::OrHash
46
52
  ).returns(Courier::Models::Profiles::ListSubscribeResponse)
47
53
  end
48
54
  def subscribe(
49
- # A unique identifier representing the user associated with the requested user
50
- # profile.
55
+ # Path param: A unique identifier representing the user associated with the
56
+ # requested user profile.
51
57
  user_id,
58
+ # Body param
52
59
  lists:,
60
+ # Header param: A unique key that makes this request idempotent. If Courier
61
+ # receives another request with the same `Idempotency-Key`, it returns the stored
62
+ # response from the first request without performing the operation again
63
+ # (including the original status code and any error). Use it to safely retry
64
+ # `POST` requests after network failures without risking duplicate sends. The key
65
+ # is scoped to this endpoint.
66
+ idempotency_key: nil,
67
+ # Header param: How long the idempotency key remains valid, as a Unix epoch
68
+ # timestamp in seconds or an ISO 8601 date string. Only applies when
69
+ # `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
70
+ # maximum is 1 year.
71
+ x_idempotency_expiration: nil,
53
72
  request_options: {}
54
73
  )
55
74
  end
@@ -2,28 +2,49 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Store the contact information Courier delivers to for each user — email, phone
6
+ # number, push tokens, and any custom data you send to.
5
7
  class Profiles
8
+ # Store the contact information Courier delivers to for each user — email, phone
9
+ # number, push tokens, and any custom data you send to.
6
10
  sig { returns(Courier::Resources::Profiles::Lists) }
7
11
  attr_reader :lists
8
12
 
9
- # Merge the supplied values with an existing profile or create a new profile if
10
- # one doesn't already exist.
13
+ # Merges the supplied values into a user's profile, creating it if absent and
14
+ # leaving any key you omit untouched. Prefer this for everyday writes.
11
15
  sig do
12
16
  params(
13
17
  user_id: String,
14
18
  profile: T::Hash[Symbol, T.anything],
19
+ idempotency_key: String,
20
+ x_idempotency_expiration: String,
15
21
  request_options: Courier::RequestOptions::OrHash
16
22
  ).returns(Courier::Models::ProfileCreateResponse)
17
23
  end
18
24
  def create(
19
- # A unique identifier representing the user associated with the requested profile.
25
+ # Path param: A unique identifier representing the user associated with the
26
+ # requested profile.
20
27
  user_id,
28
+ # Body param
21
29
  profile:,
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,
22
42
  request_options: {}
23
43
  )
24
44
  end
25
45
 
26
- # Returns the specified user profile.
46
+ # Returns a user's stored profile and preferences, including the email address,
47
+ # phone number, and push tokens Courier can reach them on.
27
48
  sig do
28
49
  params(
29
50
  user_id: String,
@@ -37,7 +58,8 @@ module Courier
37
58
  )
38
59
  end
39
60
 
40
- # Update a profile
61
+ # Applies a JSON Patch to a user profile, adding, removing, or replacing
62
+ # individual fields without sending the whole object.
41
63
  sig do
42
64
  params(
43
65
  user_id: String,
@@ -55,7 +77,8 @@ module Courier
55
77
  )
56
78
  end
57
79
 
58
- # Deletes the specified user profile.
80
+ # Deletes a user's profile and stored contact details. List subscriptions and
81
+ # preferences are separate resources, so remove those too if required.
59
82
  sig do
60
83
  params(
61
84
  user_id: String,
@@ -70,11 +93,8 @@ module Courier
70
93
  )
71
94
  end
72
95
 
73
- # When using `PUT`, be sure to include all the key-value pairs required by the
74
- # recipient's profile. Any key-value pairs that exist in the profile but fail to
75
- # be included in the `PUT` request will be removed from the profile. Remember, a
76
- # `PUT` update is a full replacement of the data. For partial updates, use the
77
- # [Patch](https://www.courier.com/docs/reference/profiles/patch/) request.
96
+ # Overwrites a user profile in full, removing any key absent from the request
97
+ # body. Use the patch endpoint when changing a single field.
78
98
  sig do
79
99
  params(
80
100
  user_id: String,
@@ -3,11 +3,11 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Providers
6
+ # Configure the channel providers Courier delivers through, and browse the
7
+ # provider types it supports.
6
8
  class Catalog
7
- # Returns the catalog of available provider types with their display names,
8
- # descriptions, and configuration schema fields (snake_case, with `type` and
9
- # `required`). Providers with no configurable schema return only `provider`,
10
- # `name`, and `description`.
9
+ # Returns the provider types Courier supports, each with a display name,
10
+ # description, and the configuration fields it requires.
11
11
  sig do
12
12
  params(
13
13
  channel: String,
@@ -2,38 +2,57 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Configure the channel providers Courier delivers through, and browse the
6
+ # provider types it supports.
5
7
  class Providers
8
+ # Configure the channel providers Courier delivers through, and browse the
9
+ # provider types it supports.
6
10
  sig { returns(Courier::Resources::Providers::Catalog) }
7
11
  attr_reader :catalog
8
12
 
9
- # Create a new provider configuration. The `provider` field must be a known
10
- # Courier provider key (see catalog).
13
+ # Configures a provider integration from a Courier provider key and its settings.
14
+ # Check the catalog endpoint for the schema each provider expects.
11
15
  sig do
12
16
  params(
13
17
  provider: String,
14
18
  alias_: String,
15
19
  settings: T::Hash[Symbol, T.anything],
16
20
  title: String,
21
+ idempotency_key: String,
22
+ x_idempotency_expiration: String,
17
23
  request_options: Courier::RequestOptions::OrHash
18
24
  ).returns(Courier::Provider)
19
25
  end
20
26
  def create(
21
- # The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a
22
- # known Courier provider — see the catalog endpoint for valid keys.
27
+ # Body param: The provider key identifying the type (e.g. "sendgrid", "twilio").
28
+ # Must be a known Courier provider — see the catalog endpoint for valid keys.
23
29
  provider:,
24
- # Optional alias for this configuration.
30
+ # Body param: Optional alias for this configuration.
25
31
  alias_: nil,
26
- # Provider-specific settings (snake_case keys). Defaults to an empty object when
27
- # omitted. Use the catalog endpoint to discover required fields for a given
28
- # provider — omitting a required field returns a 400 validation error.
32
+ # Body param: Provider-specific settings (snake_case keys). Defaults to an empty
33
+ # object when omitted. Use the catalog endpoint to discover required fields for a
34
+ # given provider — omitting a required field returns a 400 validation error.
29
35
  settings: nil,
30
- # Optional display title. Omit to use "Default Configuration".
36
+ # Body param: Optional display title. Omit to use "Default Configuration".
31
37
  title: 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,
32
50
  request_options: {}
33
51
  )
34
52
  end
35
53
 
36
- # Fetch a single provider configuration by ID.
54
+ # Returns one configured provider by id, including its channel, provider key,
55
+ # alias, title, and current settings.
37
56
  sig do
38
57
  params(
39
58
  id: String,
@@ -47,11 +66,8 @@ module Courier
47
66
  )
48
67
  end
49
68
 
50
- # Replace an existing provider configuration. The `provider` key is required and
51
- # determines which provider-specific settings schema is applied. All other fields
52
- # are optional — omitted fields are cleared from the stored configuration (this is
53
- # a full replacement, not a partial merge). Changing the provider type for an
54
- # existing configuration is not supported.
69
+ # Replaces a provider's configuration in full, clearing any field you omit rather
70
+ # than merging it. Send the complete settings object.
55
71
  sig do
56
72
  params(
57
73
  id: String,
@@ -80,8 +96,8 @@ module Courier
80
96
  )
81
97
  end
82
98
 
83
- # List configured provider integrations for the current workspace. Supports
84
- # cursor-based pagination.
99
+ # Lists the provider integrations configured in the workspace, one entry per
100
+ # channel and provider key with its alias and settings.
85
101
  sig do
86
102
  params(
87
103
  cursor: String,
@@ -95,8 +111,8 @@ module Courier
95
111
  )
96
112
  end
97
113
 
98
- # Delete a provider configuration. Returns 409 if the provider is still referenced
99
- # by routing or notifications.
114
+ # Deletes a provider configuration, which fails while routing strategies or
115
+ # templates still reference it. Update those references first.
100
116
  sig do
101
117
  params(
102
118
  id: String,
@@ -2,8 +2,11 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Look up the messages Courier has accepted, inspect their delivery history and
6
+ # rendered output, and cancel, resend, or archive them.
5
7
  class Requests
6
- # Archive message
8
+ # Archives a send request by its request id. Use it to remove test sends or
9
+ # superseded requests from the message list without deleting them.
7
10
  sig do
8
11
  params(
9
12
  request_id: String,
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Define reusable channel routing and failover strategies, and see which templates
6
+ # use them.
5
7
  class RoutingStrategies
6
8
  # Create a routing strategy. Requires a name and routing configuration at minimum.
7
9
  # Channels and providers default to empty if omitted.
@@ -14,28 +16,42 @@ module Courier
14
16
  providers:
15
17
  T.nilable(T::Hash[Symbol, Courier::MessageProvidersType::OrHash]),
16
18
  tags: T.nilable(T::Array[String]),
19
+ idempotency_key: String,
20
+ x_idempotency_expiration: String,
17
21
  request_options: Courier::RequestOptions::OrHash
18
22
  ).returns(Courier::RoutingStrategyGetResponse)
19
23
  end
20
24
  def create(
21
- # Human-readable name for the routing strategy.
25
+ # Body param: Human-readable name for the routing strategy.
22
26
  name:,
23
- # Routing tree defining channel selection method and order.
27
+ # Body param: Routing tree defining channel selection method and order.
24
28
  routing:,
25
- # Per-channel delivery configuration. Defaults to empty if omitted.
29
+ # Body param: Per-channel delivery configuration. Defaults to empty if omitted.
26
30
  channels: nil,
27
- # Optional description of the routing strategy.
31
+ # Body param: Optional description of the routing strategy.
28
32
  description: nil,
29
- # Per-provider delivery configuration. Defaults to empty if omitted.
33
+ # Body param: Per-provider delivery configuration. Defaults to empty if omitted.
30
34
  providers: nil,
31
- # Optional tags for categorization.
35
+ # Body param: Optional tags for categorization.
32
36
  tags: nil,
37
+ # Header param: A unique key that makes this request idempotent. If Courier
38
+ # receives another request with the same `Idempotency-Key`, it returns the stored
39
+ # response from the first request without performing the operation again
40
+ # (including the original status code and any error). Use it to safely retry
41
+ # `POST` requests after network failures without risking duplicate sends. The key
42
+ # is scoped to this endpoint.
43
+ idempotency_key: nil,
44
+ # Header param: How long the idempotency key remains valid, as a Unix epoch
45
+ # timestamp in seconds or an ISO 8601 date string. Only applies when
46
+ # `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
47
+ # maximum is 1 year.
48
+ x_idempotency_expiration: nil,
33
49
  request_options: {}
34
50
  )
35
51
  end
36
52
 
37
- # Retrieve a routing strategy by ID. Returns the full entity including routing
38
- # content and metadata.
53
+ # Returns one routing strategy by id with its name, tags, channels, and the
54
+ # routing rules that decide provider order and fallback.
39
55
  sig do
40
56
  params(
41
57
  id: String,
@@ -83,8 +99,8 @@ module Courier
83
99
  )
84
100
  end
85
101
 
86
- # List notification templates associated with a routing strategy. Includes
87
- # template metadata only, not full content.
102
+ # Returns the notification templates using a routing strategy, with paging. Check
103
+ # this before changing a strategy that templates depend on.
88
104
  sig do
89
105
  params(
90
106
  id: String,
@@ -2,18 +2,35 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Send a message to one or more recipients — users, lists, audiences, or tenants —
6
+ # across every channel you have configured.
5
7
  class Send
6
- # Send a message to one or more recipients.
8
+ # Sends a message to one or more recipients and returns a requestId. Courier
9
+ # routes it to email, SMS, push, chat, or in-app based on your rules.
7
10
  sig do
8
11
  params(
9
12
  message: Courier::SendMessageParams::Message::OrHash,
13
+ idempotency_key: String,
14
+ x_idempotency_expiration: String,
10
15
  request_options: Courier::RequestOptions::OrHash
11
16
  ).returns(Courier::Models::SendMessageResponse)
12
17
  end
13
18
  def message(
14
- # The message property has the following primary top-level properties. They define
15
- # the destination and content of the message.
19
+ # Body param: The message property has the following primary top-level properties.
20
+ # They define the destination and content of the message.
16
21
  message:,
22
+ # Header param: A unique key that makes this request idempotent. If Courier
23
+ # receives another request with the same `Idempotency-Key`, it returns the stored
24
+ # response from the first request without performing the operation again
25
+ # (including the original status code and any error). Use it to safely retry
26
+ # `POST` requests after network failures without risking duplicate sends. The key
27
+ # is scoped to this endpoint.
28
+ idempotency_key: nil,
29
+ # Header param: How long the idempotency key remains valid, as a Unix epoch
30
+ # timestamp in seconds or an ISO 8601 date string. Only applies when
31
+ # `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
32
+ # maximum is 1 year.
33
+ x_idempotency_expiration: nil,
17
34
  request_options: {}
18
35
  )
19
36
  end
@@ -4,8 +4,11 @@ module Courier
4
4
  module Resources
5
5
  class Tenants
6
6
  class Preferences
7
+ # Manage tenants — the organizations, teams, or accounts your users belong to —
8
+ # along with their users and default preferences.
7
9
  class Items
8
- # Create or Replace Default Preferences For Topic
10
+ # Sets a tenant's default opt-in status for one subscription topic, which applies
11
+ # to every member unless a user sets their own override.
9
12
  sig do
10
13
  params(
11
14
  topic_id: String,
@@ -36,7 +39,8 @@ module Courier
36
39
  )
37
40
  end
38
41
 
39
- # Remove Default Preferences For Topic
42
+ # Removes a tenant's default preference for one subscription topic, addressed by
43
+ # tenant id and topic id.
40
44
  sig do
41
45
  params(
42
46
  topic_id: String,
@@ -4,6 +4,8 @@ module Courier
4
4
  module Resources
5
5
  class Tenants
6
6
  class Preferences
7
+ # Manage tenants — the organizations, teams, or accounts your users belong to —
8
+ # along with their users and default preferences.
7
9
  sig { returns(Courier::Resources::Tenants::Preferences::Items) }
8
10
  attr_reader :items
9
11
 
@@ -4,14 +4,11 @@ module Courier
4
4
  module Resources
5
5
  class Tenants
6
6
  class Templates
7
+ # Manage the templates and template versions scoped to a single tenant, including
8
+ # the ones authored in the embedded designer.
7
9
  class Versions
8
- # Fetches a specific version of a tenant template.
9
- #
10
- # Supports the following version formats:
11
- #
12
- # - `latest` - The most recent version of the template
13
- # - `published` - The currently published version
14
- # - `v{version}` - A specific version (e.g., "v1", "v2", "v1.0.0")
10
+ # Returns one version of a tenant template, addressed by version number or by
11
+ # latest, with its content and publish timestamp.
15
12
  sig do
16
13
  params(
17
14
  version: String,
@@ -3,11 +3,16 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Tenants
6
+ # Manage the templates and template versions scoped to a single tenant, including
7
+ # the ones authored in the embedded designer.
6
8
  class Templates
9
+ # Manage the templates and template versions scoped to a single tenant, including
10
+ # the ones authored in the embedded designer.
7
11
  sig { returns(Courier::Resources::Tenants::Templates::Versions) }
8
12
  attr_reader :versions
9
13
 
10
- # Get a Template in Tenant
14
+ # Returns a tenant's notification template with its content, version, and created,
15
+ # updated, and published timestamps.
11
16
  sig do
12
17
  params(
13
18
  template_id: String,
@@ -24,7 +29,8 @@ module Courier
24
29
  )
25
30
  end
26
31
 
27
- # List Templates in Tenant
32
+ # Lists a tenant's notification templates, each carrying its version and published
33
+ # timestamp. Paged.
28
34
  sig do
29
35
  params(
30
36
  tenant_id: String,
@@ -44,12 +50,8 @@ module Courier
44
50
  )
45
51
  end
46
52
 
47
- # Deletes the tenant's notification template with the given `template_id`.
48
- #
49
- # Returns **204 No Content** with an empty body on success.
50
- #
51
- # Returns **404** if there is no template with this ID for the tenant, including a
52
- # second `DELETE` after a successful removal.
53
+ # Deletes a tenant's notification template by id. Sends for that tenant then use
54
+ # the workspace template registered under the same id.
53
55
  sig do
54
56
  params(
55
57
  template_id: String,
@@ -66,10 +68,8 @@ module Courier
66
68
  )
67
69
  end
68
70
 
69
- # Publishes a specific version of a notification template for a tenant.
70
- #
71
- # The template must already exist in the tenant's notification map. If no version
72
- # is specified, defaults to publishing the "latest" version.
71
+ # Publishes a version of a tenant's notification template, making it the content
72
+ # that tenant's sends render from until you publish another.
73
73
  sig do
74
74
  params(
75
75
  template_id: String,
@@ -90,13 +90,8 @@ module Courier
90
90
  )
91
91
  end
92
92
 
93
- # Creates or updates a notification template for a tenant.
94
- #
95
- # If the template already exists for the tenant, it will be updated (200).
96
- # Otherwise, a new template is created (201).
97
- #
98
- # Optionally publishes the template immediately if the `published` flag is set to
99
- # true.
93
+ # Creates or updates a notification template scoped to one tenant, letting a
94
+ # tenant override the content the workspace template would send.
100
95
  sig do
101
96
  params(
102
97
  template_id: String,
@@ -2,14 +2,19 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Manage tenants — the organizations, teams, or accounts your users belong to —
6
+ # along with their users and default preferences.
5
7
  class Tenants
6
8
  sig { returns(Courier::Resources::Tenants::Preferences) }
7
9
  attr_reader :preferences
8
10
 
11
+ # Manage the templates and template versions scoped to a single tenant, including
12
+ # the ones authored in the embedded designer.
9
13
  sig { returns(Courier::Resources::Tenants::Templates) }
10
14
  attr_reader :templates
11
15
 
12
- # Get a Tenant
16
+ # Returns one tenant with its name, parent tenant id, default preferences,
17
+ # properties, and the user profile applied to its members.
13
18
  sig do
14
19
  params(
15
20
  tenant_id: String,
@@ -23,7 +28,8 @@ module Courier
23
28
  )
24
29
  end
25
30
 
26
- # Create or Replace a Tenant
31
+ # Creates or replaces a tenant from a name, parent, brand, properties, and default
32
+ # preferences supplied in the request body.
27
33
  sig do
28
34
  params(
29
35
  tenant_id: String,
@@ -56,7 +62,8 @@ module Courier
56
62
  )
57
63
  end
58
64
 
59
- # Get a List of Tenants
65
+ # Lists the workspace's tenants, each carrying a name, parent tenant, properties,
66
+ # and default preferences. Paged.
60
67
  sig do
61
68
  params(
62
69
  cursor: T.nilable(String),
@@ -76,7 +83,8 @@ module Courier
76
83
  )
77
84
  end
78
85
 
79
- # Delete a Tenant
86
+ # Deletes a tenant. Its members' workspace-level profiles and preferences live
87
+ # outside the tenant and are managed separately.
80
88
  sig do
81
89
  params(
82
90
  tenant_id: String,
@@ -90,7 +98,8 @@ module Courier
90
98
  )
91
99
  end
92
100
 
93
- # Get Users in Tenant
101
+ # Returns the users belonging to a tenant with cursor paging. Use it to see who a
102
+ # tenant-scoped send will reach.
94
103
  sig do
95
104
  params(
96
105
  tenant_id: String,
@@ -2,8 +2,11 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Store and retrieve the translation strings Courier uses to render localized
6
+ # template content.
5
7
  class Translations
6
- # Get translations by locale
8
+ # Returns the translation strings stored for one domain and locale, for use in
9
+ # localized notification content.
7
10
  sig do
8
11
  params(
9
12
  locale: String,
@@ -21,7 +24,8 @@ module Courier
21
24
  )
22
25
  end
23
26
 
24
- # Update a translation
27
+ # Uploads the translation strings for one domain and locale. Courier uses them to
28
+ # render localized content for recipients in that locale.
25
29
  sig do
26
30
  params(
27
31
  locale: String,