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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/lib/courier/client.rb +39 -4
- data/lib/courier/models/automations/invoke_invoke_ad_hoc_params.rb +13 -1
- data/lib/courier/models/automations/invoke_invoke_by_template_params.rb +13 -1
- data/lib/courier/models/brand_create_params.rb +13 -1
- data/lib/courier/models/inbox/message_delete_params.rb +22 -0
- data/lib/courier/models/inbox/message_restore_params.rb +22 -0
- data/lib/courier/models/journey_cancel_params.rb +13 -1
- data/lib/courier/models/journey_create_params.rb +13 -1
- data/lib/courier/models/journey_invoke_params.rb +13 -1
- data/lib/courier/models/journey_publish_params.rb +13 -1
- data/lib/courier/models/journeys/template_create_params.rb +13 -1
- data/lib/courier/models/journeys/template_publish_params.rb +13 -1
- data/lib/courier/models/lists/subscription_add_params.rb +13 -1
- data/lib/courier/models/notification_create_params.rb +13 -1
- data/lib/courier/models/notification_publish_params.rb +13 -1
- data/lib/courier/models/profile_create_params.rb +13 -1
- data/lib/courier/models/profiles/list_subscribe_params.rb +13 -1
- data/lib/courier/models/provider_create_params.rb +15 -1
- data/lib/courier/models/routing_strategy_create_params.rb +13 -1
- data/lib/courier/models/send_message_params.rb +15 -1
- data/lib/courier/models/users/preference_bulk_update_params.rb +15 -1
- data/lib/courier/models/users/preference_update_or_create_topic_params.rb +14 -4
- data/lib/courier/models/users/topic_preference.rb +21 -7
- data/lib/courier/models/workspace_preference_create_params.rb +13 -1
- data/lib/courier/models/workspace_preference_publish_params.rb +13 -1
- data/lib/courier/models/workspace_preferences/topic_create_params.rb +13 -1
- data/lib/courier/models.rb +2 -14
- data/lib/courier/resources/audiences.rb +12 -5
- data/lib/courier/resources/audit_events.rb +5 -2
- data/lib/courier/resources/auth.rb +5 -1
- data/lib/courier/resources/automations/invoke.rb +47 -23
- data/lib/courier/resources/automations.rb +6 -1
- data/lib/courier/resources/brands.rb +38 -12
- data/lib/courier/resources/digests/schedules.rb +4 -3
- data/lib/courier/resources/digests.rb +2 -0
- data/lib/courier/resources/inbound.rb +3 -1
- data/lib/courier/resources/inbox/messages.rb +58 -0
- data/lib/courier/resources/inbox.rb +19 -0
- data/lib/courier/resources/journeys/templates.rb +43 -25
- data/lib/courier/resources/journeys.rb +73 -44
- data/lib/courier/resources/lists/subscriptions.rb +22 -8
- data/lib/courier/resources/lists.rb +14 -5
- data/lib/courier/resources/messages.rb +14 -14
- data/lib/courier/resources/notifications/checks.rb +8 -3
- data/lib/courier/resources/notifications.rb +48 -30
- data/lib/courier/resources/profiles/lists.rb +19 -8
- data/lib/courier/resources/profiles.rb +25 -14
- data/lib/courier/resources/providers/catalog.rb +4 -4
- data/lib/courier/resources/providers.rb +27 -18
- data/lib/courier/resources/requests.rb +4 -1
- data/lib/courier/resources/routing_strategies.rb +24 -12
- data/lib/courier/resources/send.rb +14 -4
- data/lib/courier/resources/tenants/preferences/items.rb +6 -2
- data/lib/courier/resources/tenants/preferences.rb +2 -0
- data/lib/courier/resources/tenants/templates/versions.rb +4 -7
- data/lib/courier/resources/tenants/templates.rb +14 -19
- data/lib/courier/resources/tenants.rb +14 -5
- data/lib/courier/resources/translations.rb +6 -2
- data/lib/courier/resources/users/preferences.rb +23 -42
- data/lib/courier/resources/users/tenants.rb +12 -10
- data/lib/courier/resources/users/tokens.rb +14 -6
- data/lib/courier/resources/users.rb +6 -0
- data/lib/courier/resources/workspace_preferences/topics.rb +27 -19
- data/lib/courier/resources/workspace_preferences.rb +40 -20
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +4 -11
- data/rbi/courier/client.rbi +38 -3
- data/rbi/courier/models/automations/invoke_invoke_ad_hoc_params.rbi +18 -0
- data/rbi/courier/models/automations/invoke_invoke_by_template_params.rbi +18 -0
- data/rbi/courier/models/brand_create_params.rbi +18 -0
- data/rbi/courier/models/inbox/message_delete_params.rbi +40 -0
- data/rbi/courier/models/inbox/message_restore_params.rbi +40 -0
- data/rbi/courier/models/journey_cancel_params.rbi +31 -5
- data/rbi/courier/models/journey_create_params.rbi +31 -5
- data/rbi/courier/models/journey_invoke_params.rbi +26 -2
- data/rbi/courier/models/journey_publish_params.rbi +26 -2
- data/rbi/courier/models/journeys/template_create_params.rbi +26 -2
- data/rbi/courier/models/journeys/template_publish_params.rbi +23 -1
- data/rbi/courier/models/lists/subscription_add_params.rbi +23 -1
- data/rbi/courier/models/notification_create_params.rbi +31 -5
- data/rbi/courier/models/notification_publish_params.rbi +26 -2
- data/rbi/courier/models/profile_create_params.rbi +23 -1
- data/rbi/courier/models/profiles/list_subscribe_params.rbi +23 -1
- data/rbi/courier/models/provider_create_params.rbi +18 -0
- data/rbi/courier/models/routing_strategy_create_params.rbi +31 -5
- data/rbi/courier/models/send_message_params.rbi +18 -0
- data/rbi/courier/models/users/preference_bulk_update_params.rbi +18 -0
- data/rbi/courier/models/users/preference_update_or_create_topic_params.rbi +14 -2
- data/rbi/courier/models/users/topic_preference.rbi +24 -2
- data/rbi/courier/models/workspace_preference_create_params.rbi +31 -5
- data/rbi/courier/models/workspace_preference_publish_params.rbi +31 -5
- data/rbi/courier/models/workspace_preferences/topic_create_params.rbi +26 -2
- data/rbi/courier/models.rbi +2 -14
- data/rbi/courier/resources/audiences.rbi +12 -5
- data/rbi/courier/resources/audit_events.rbi +5 -2
- data/rbi/courier/resources/auth.rbi +5 -1
- data/rbi/courier/resources/automations/invoke.rbi +48 -7
- data/rbi/courier/resources/automations.rbi +6 -1
- data/rbi/courier/resources/brands.rbi +37 -7
- data/rbi/courier/resources/digests/schedules.rbi +4 -3
- data/rbi/courier/resources/digests.rbi +2 -0
- data/rbi/courier/resources/inbound.rbi +3 -1
- data/rbi/courier/resources/inbox/messages.rbi +44 -0
- data/rbi/courier/resources/inbox.rbi +16 -0
- data/rbi/courier/resources/journeys/templates.rbi +47 -17
- data/rbi/courier/resources/journeys.rbi +93 -39
- data/rbi/courier/resources/lists/subscriptions.rbi +24 -5
- data/rbi/courier/resources/lists.rbi +14 -5
- data/rbi/courier/resources/messages.rbi +14 -14
- data/rbi/courier/resources/notifications/checks.rbi +8 -3
- data/rbi/courier/resources/notifications.rbi +58 -28
- data/rbi/courier/resources/profiles/lists.rbi +25 -6
- data/rbi/courier/resources/profiles.rbi +31 -11
- data/rbi/courier/resources/providers/catalog.rbi +4 -4
- data/rbi/courier/resources/providers.rbi +35 -19
- data/rbi/courier/resources/requests.rbi +4 -1
- data/rbi/courier/resources/routing_strategies.rbi +26 -10
- data/rbi/courier/resources/send.rbi +20 -3
- data/rbi/courier/resources/tenants/preferences/items.rbi +6 -2
- data/rbi/courier/resources/tenants/preferences.rbi +2 -0
- data/rbi/courier/resources/tenants/templates/versions.rbi +4 -7
- data/rbi/courier/resources/tenants/templates.rbi +14 -19
- data/rbi/courier/resources/tenants.rbi +14 -5
- data/rbi/courier/resources/translations.rbi +6 -2
- data/rbi/courier/resources/users/preferences.rbi +28 -40
- data/rbi/courier/resources/users/tenants.rbi +12 -10
- data/rbi/courier/resources/users/tokens.rbi +14 -6
- data/rbi/courier/resources/users.rbi +6 -0
- data/rbi/courier/resources/workspace_preferences/topics.rbi +37 -18
- data/rbi/courier/resources/workspace_preferences.rbi +51 -17
- data/sig/courier/client.rbs +2 -2
- data/sig/courier/models/automations/invoke_invoke_ad_hoc_params.rbs +15 -1
- data/sig/courier/models/automations/invoke_invoke_by_template_params.rbs +15 -1
- data/sig/courier/models/brand_create_params.rbs +15 -1
- data/sig/courier/models/inbox/message_delete_params.rbs +25 -0
- data/sig/courier/models/inbox/message_restore_params.rbs +25 -0
- data/sig/courier/models/journey_cancel_params.rbs +20 -3
- data/sig/courier/models/journey_create_params.rbs +20 -3
- data/sig/courier/models/journey_invoke_params.rbs +18 -1
- data/sig/courier/models/journey_publish_params.rbs +18 -1
- data/sig/courier/models/journeys/template_create_params.rbs +18 -1
- data/sig/courier/models/journeys/template_publish_params.rbs +18 -1
- data/sig/courier/models/lists/subscription_add_params.rbs +15 -1
- data/sig/courier/models/notification_create_params.rbs +20 -3
- data/sig/courier/models/notification_publish_params.rbs +18 -2
- data/sig/courier/models/profile_create_params.rbs +18 -1
- data/sig/courier/models/profiles/list_subscribe_params.rbs +15 -1
- data/sig/courier/models/provider_create_params.rbs +15 -1
- data/sig/courier/models/routing_strategy_create_params.rbs +20 -3
- data/sig/courier/models/send_message_params.rbs +17 -1
- data/sig/courier/models/users/preference_bulk_update_params.rbs +15 -1
- data/sig/courier/models/workspace_preference_create_params.rbs +20 -3
- data/sig/courier/models/workspace_preference_publish_params.rbs +20 -3
- data/sig/courier/models/workspace_preferences/topic_create_params.rbs +18 -1
- data/sig/courier/models.rbs +2 -14
- data/sig/courier/resources/automations/invoke.rbs +4 -0
- data/sig/courier/resources/brands.rbs +2 -0
- data/sig/courier/resources/inbox/messages.rbs +19 -0
- data/sig/courier/resources/inbox.rbs +9 -0
- data/sig/courier/resources/journeys/templates.rbs +4 -0
- data/sig/courier/resources/journeys.rbs +8 -0
- data/sig/courier/resources/lists/subscriptions.rbs +2 -0
- data/sig/courier/resources/notifications.rbs +4 -0
- data/sig/courier/resources/profiles/lists.rbs +2 -0
- data/sig/courier/resources/profiles.rbs +2 -0
- data/sig/courier/resources/providers.rbs +2 -0
- data/sig/courier/resources/routing_strategies.rbs +2 -0
- data/sig/courier/resources/send.rbs +2 -0
- data/sig/courier/resources/users/preferences.rbs +2 -0
- data/sig/courier/resources/workspace_preferences/topics.rbs +2 -0
- data/sig/courier/resources/workspace_preferences.rbs +4 -0
- metadata +14 -35
- data/lib/courier/models/bulk_add_users_params.rb +0 -26
- data/lib/courier/models/bulk_create_job_params.rb +0 -29
- data/lib/courier/models/bulk_create_job_response.rb +0 -16
- data/lib/courier/models/bulk_list_users_params.rb +0 -33
- data/lib/courier/models/bulk_list_users_response.rb +0 -49
- data/lib/courier/models/bulk_retrieve_job_params.rb +0 -20
- data/lib/courier/models/bulk_retrieve_job_response.rb +0 -76
- data/lib/courier/models/bulk_run_job_params.rb +0 -20
- data/lib/courier/models/inbound_bulk_message.rb +0 -91
- data/lib/courier/models/inbound_bulk_message_user.rb +0 -54
- data/lib/courier/resources/bulk.rb +0 -141
- data/rbi/courier/models/bulk_add_users_params.rbi +0 -43
- data/rbi/courier/models/bulk_create_job_params.rbi +0 -54
- data/rbi/courier/models/bulk_create_job_response.rbi +0 -26
- data/rbi/courier/models/bulk_list_users_params.rbi +0 -51
- data/rbi/courier/models/bulk_list_users_response.rbi +0 -125
- data/rbi/courier/models/bulk_retrieve_job_params.rbi +0 -35
- data/rbi/courier/models/bulk_retrieve_job_response.rbi +0 -157
- data/rbi/courier/models/bulk_run_job_params.rbi +0 -35
- data/rbi/courier/models/inbound_bulk_message.rbi +0 -124
- data/rbi/courier/models/inbound_bulk_message_user.rbi +0 -88
- data/rbi/courier/resources/bulk.rbi +0 -102
- data/sig/courier/models/bulk_add_users_params.rbs +0 -28
- data/sig/courier/models/bulk_create_job_params.rbs +0 -24
- data/sig/courier/models/bulk_create_job_response.rbs +0 -13
- data/sig/courier/models/bulk_list_users_params.rbs +0 -28
- data/sig/courier/models/bulk_list_users_response.rbs +0 -65
- data/sig/courier/models/bulk_retrieve_job_params.rbs +0 -23
- data/sig/courier/models/bulk_retrieve_job_response.rbs +0 -66
- data/sig/courier/models/bulk_run_job_params.rbs +0 -23
- data/sig/courier/models/inbound_bulk_message.rbs +0 -58
- data/sig/courier/models/inbound_bulk_message_user.rbs +0 -42
- 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
|
|
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
|
|
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
|
|
40
|
-
#
|
|
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
|
|
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
|
-
#
|
|
10
|
-
#
|
|
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
|
|
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
|
|
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
|
-
#
|
|
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
|
|
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
|
-
#
|
|
74
|
-
#
|
|
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
|
|
8
|
-
#
|
|
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
|
-
#
|
|
10
|
-
#
|
|
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").
|
|
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
|
|
27
|
-
# omitted. Use the catalog endpoint to discover required fields for a
|
|
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
|
-
#
|
|
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
|
-
#
|
|
51
|
-
#
|
|
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
|
-
#
|
|
84
|
-
#
|
|
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
|
-
#
|
|
99
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
38
|
-
#
|
|
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
|
-
#
|
|
87
|
-
#
|
|
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
|
-
#
|
|
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.
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
|
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
|
|
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
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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,
|