trycourier 4.21.0 → 4.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/lib/courier/client.rb +43 -0
- 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/broadcast.rb +132 -0
- data/lib/courier/models/broadcast_archive_params.rb +20 -0
- data/lib/courier/models/broadcast_cancel_params.rb +20 -0
- data/lib/courier/models/broadcast_create_params.rb +14 -0
- data/lib/courier/models/broadcast_duplicate_params.rb +20 -0
- data/lib/courier/models/broadcast_list_params.rb +30 -0
- data/lib/courier/models/broadcast_list_response.rb +24 -0
- data/lib/courier/models/broadcast_put_content_params.rb +20 -0
- data/lib/courier/models/broadcast_retrieve_content_params.rb +33 -0
- data/lib/courier/models/broadcast_retrieve_params.rb +20 -0
- data/lib/courier/models/broadcast_schedule.rb +59 -0
- data/lib/courier/models/broadcast_schedule_params.rb +20 -0
- data/lib/courier/models/broadcast_send_params.rb +20 -0
- data/lib/courier/models/broadcast_update_params.rb +20 -0
- data/lib/courier/models/create_broadcast_request.rb +43 -0
- 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/schedule_broadcast_request.rb +59 -0
- data/lib/courier/models/send_broadcast_request.rb +39 -0
- data/lib/courier/models/send_message_params.rb +15 -1
- data/lib/courier/models/update_broadcast_request.rb +18 -0
- 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 +38 -0
- 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/broadcasts.rb +290 -0
- 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 +24 -1
- data/rbi/courier/client.rbi +41 -0
- 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/broadcast.rbi +164 -0
- data/rbi/courier/models/broadcast_archive_params.rbi +35 -0
- data/rbi/courier/models/broadcast_cancel_params.rbi +35 -0
- data/rbi/courier/models/broadcast_create_params.rbi +27 -0
- data/rbi/courier/models/broadcast_duplicate_params.rbi +35 -0
- data/rbi/courier/models/broadcast_list_params.rbi +54 -0
- data/rbi/courier/models/broadcast_list_response.rbi +39 -0
- data/rbi/courier/models/broadcast_put_content_params.rbi +35 -0
- data/rbi/courier/models/broadcast_retrieve_content_params.rbi +57 -0
- data/rbi/courier/models/broadcast_retrieve_params.rbi +35 -0
- data/rbi/courier/models/broadcast_schedule.rbi +92 -0
- data/rbi/courier/models/broadcast_schedule_params.rbi +35 -0
- data/rbi/courier/models/broadcast_send_params.rbi +35 -0
- data/rbi/courier/models/broadcast_update_params.rbi +35 -0
- data/rbi/courier/models/create_broadcast_request.rbi +81 -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/schedule_broadcast_request.rbi +103 -0
- data/rbi/courier/models/send_broadcast_request.rbi +77 -0
- data/rbi/courier/models/send_message_params.rbi +18 -0
- data/rbi/courier/models/update_broadcast_request.rbi +28 -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 +39 -0
- 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/broadcasts.rbi +199 -0
- 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 +4 -0
- 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/broadcast.rbs +98 -0
- data/sig/courier/models/broadcast_archive_params.rbs +23 -0
- data/sig/courier/models/broadcast_cancel_params.rbs +23 -0
- data/sig/courier/models/broadcast_create_params.rbs +15 -0
- data/sig/courier/models/broadcast_duplicate_params.rbs +23 -0
- data/sig/courier/models/broadcast_list_params.rbs +30 -0
- data/sig/courier/models/broadcast_list_response.rbs +22 -0
- data/sig/courier/models/broadcast_put_content_params.rbs +25 -0
- data/sig/courier/models/broadcast_retrieve_content_params.rbs +30 -0
- data/sig/courier/models/broadcast_retrieve_params.rbs +23 -0
- data/sig/courier/models/broadcast_schedule.rbs +46 -0
- data/sig/courier/models/broadcast_schedule_params.rbs +25 -0
- data/sig/courier/models/broadcast_send_params.rbs +25 -0
- data/sig/courier/models/broadcast_update_params.rbs +25 -0
- data/sig/courier/models/create_broadcast_request.rbs +40 -0
- 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/schedule_broadcast_request.rbs +48 -0
- data/sig/courier/models/send_broadcast_request.rbs +36 -0
- data/sig/courier/models/send_message_params.rbs +17 -1
- data/sig/courier/models/update_broadcast_request.rbs +13 -0
- 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 +38 -0
- data/sig/courier/resources/automations/invoke.rbs +4 -0
- data/sig/courier/resources/brands.rbs +2 -0
- data/sig/courier/resources/broadcasts.rbs +74 -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 +71 -2
|
@@ -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,
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
5
|
class Users
|
|
6
|
+
# Read and write a single user's notification preferences, per topic and per
|
|
7
|
+
# channel.
|
|
6
8
|
class Preferences
|
|
7
|
-
#
|
|
9
|
+
# Returns a user's preference overrides with paging, one entry per subscription
|
|
10
|
+
# topic they have set a choice for.
|
|
8
11
|
sig do
|
|
9
12
|
params(
|
|
10
13
|
user_id: String,
|
|
@@ -22,23 +25,8 @@ module Courier
|
|
|
22
25
|
)
|
|
23
26
|
end
|
|
24
27
|
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
# listed topics are created or updated, and every existing override that is not
|
|
28
|
-
# included in the body is reset to its topic default. Submitting an empty `topics`
|
|
29
|
-
# array is a valid clear-all that resets every existing override.
|
|
30
|
-
#
|
|
31
|
-
# This operation is validation-atomic (all-or-nothing): structural validation
|
|
32
|
-
# fails fast with a single `400`, and if any topic is semantically invalid (an
|
|
33
|
-
# unknown topic, a `REQUIRED` topic that cannot be opted out, or a custom routing
|
|
34
|
-
# request that is not available on the workspace's plan) the request returns a
|
|
35
|
-
# single `400` aggregating every failure in `errors` and writes nothing. On
|
|
36
|
-
# success it returns `200` with `items` (the complete resulting override set) and
|
|
37
|
-
# `deleted` (the ids of the overrides that were reset to default).
|
|
38
|
-
#
|
|
39
|
-
# Every `topic_id` in the response — in `items`, `deleted`, and any `errors` — is
|
|
40
|
-
# returned in Courier's canonical topic id form, regardless of the form supplied
|
|
41
|
-
# in the request.
|
|
28
|
+
# Replaces a user's entire set of preference overrides. Any topic you leave out is
|
|
29
|
+
# reset to its default, so send the full set rather than a subset.
|
|
42
30
|
sig do
|
|
43
31
|
params(
|
|
44
32
|
user_id: String,
|
|
@@ -64,23 +52,8 @@ module Courier
|
|
|
64
52
|
)
|
|
65
53
|
end
|
|
66
54
|
|
|
67
|
-
#
|
|
68
|
-
#
|
|
69
|
-
# created or updated; any existing overrides for topics not listed are left
|
|
70
|
-
# untouched.
|
|
71
|
-
#
|
|
72
|
-
# Structural validation of the request body fails fast with a single `400`. Beyond
|
|
73
|
-
# that, each topic is processed independently (partial-success, not
|
|
74
|
-
# all-or-nothing): valid topics are written and returned in `items`, while topics
|
|
75
|
-
# that cannot be applied are collected in `errors` with a per-topic `reason` (for
|
|
76
|
-
# example an unknown topic, a `REQUIRED` topic that cannot be opted out, a custom
|
|
77
|
-
# routing request that is not available on the workspace's plan, or a write
|
|
78
|
-
# failure). The request therefore returns `200` with both lists whenever the body
|
|
79
|
-
# is structurally valid.
|
|
80
|
-
#
|
|
81
|
-
# Every `topic_id` in the response — in both `items` and `errors` — is returned in
|
|
82
|
-
# Courier's canonical topic id form, regardless of the form supplied in the
|
|
83
|
-
# request.
|
|
55
|
+
# Adds or updates a user's preferences for several subscription topics at once.
|
|
56
|
+
# Topics you leave out keep whatever they were set to before.
|
|
84
57
|
sig do
|
|
85
58
|
params(
|
|
86
59
|
user_id: String,
|
|
@@ -89,6 +62,8 @@ module Courier
|
|
|
89
62
|
Courier::Users::PreferenceBulkUpdateParams::Topic::OrHash
|
|
90
63
|
],
|
|
91
64
|
tenant_id: T.nilable(String),
|
|
65
|
+
idempotency_key: String,
|
|
66
|
+
x_idempotency_expiration: String,
|
|
92
67
|
request_options: Courier::RequestOptions::OrHash
|
|
93
68
|
).returns(Courier::Models::Users::PreferenceBulkUpdateResponse)
|
|
94
69
|
end
|
|
@@ -101,13 +76,24 @@ module Courier
|
|
|
101
76
|
topics:,
|
|
102
77
|
# Query param: Update the preferences of a user for this specific tenant context.
|
|
103
78
|
tenant_id: nil,
|
|
79
|
+
# Header param: A unique key that makes this request idempotent. If Courier
|
|
80
|
+
# receives another request with the same `Idempotency-Key`, it returns the stored
|
|
81
|
+
# response from the first request without performing the operation again
|
|
82
|
+
# (including the original status code and any error). Use it to safely retry
|
|
83
|
+
# `POST` requests after network failures without risking duplicate sends. The key
|
|
84
|
+
# is scoped to this endpoint.
|
|
85
|
+
idempotency_key: nil,
|
|
86
|
+
# Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
87
|
+
# timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
88
|
+
# `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
89
|
+
# maximum is 1 year.
|
|
90
|
+
x_idempotency_expiration: nil,
|
|
104
91
|
request_options: {}
|
|
105
92
|
)
|
|
106
93
|
end
|
|
107
94
|
|
|
108
|
-
#
|
|
109
|
-
#
|
|
110
|
-
# preference that does not exist succeeds with no error.
|
|
95
|
+
# Removes a user's override for one subscription topic, resetting it to the
|
|
96
|
+
# effective default from the tenant or workspace.
|
|
111
97
|
sig do
|
|
112
98
|
params(
|
|
113
99
|
topic_id: String,
|
|
@@ -128,7 +114,8 @@ module Courier
|
|
|
128
114
|
)
|
|
129
115
|
end
|
|
130
116
|
|
|
131
|
-
#
|
|
117
|
+
# Returns a user's opt-in status and channel choices for one subscription topic,
|
|
118
|
+
# or the effective default if they have set no override.
|
|
132
119
|
sig do
|
|
133
120
|
params(
|
|
134
121
|
topic_id: String,
|
|
@@ -149,7 +136,8 @@ module Courier
|
|
|
149
136
|
)
|
|
150
137
|
end
|
|
151
138
|
|
|
152
|
-
#
|
|
139
|
+
# Sets a user's opt-in status and channel choices for one subscription topic,
|
|
140
|
+
# overriding the tenant default for that topic only.
|
|
153
141
|
sig do
|
|
154
142
|
params(
|
|
155
143
|
topic_id: String,
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
5
|
class Users
|
|
6
|
+
# Associate a user with one or more tenants, and read or remove those
|
|
7
|
+
# associations.
|
|
6
8
|
class Tenants
|
|
7
|
-
# Returns a
|
|
9
|
+
# Returns the tenants a user belongs to, with cursor paging. A user can belong to
|
|
10
|
+
# many tenants, each with its own profile and preferences.
|
|
8
11
|
sig do
|
|
9
12
|
params(
|
|
10
13
|
user_id: String,
|
|
@@ -24,9 +27,8 @@ module Courier
|
|
|
24
27
|
)
|
|
25
28
|
end
|
|
26
29
|
|
|
27
|
-
#
|
|
28
|
-
# profile
|
|
29
|
-
# the user's main profile when sending to the user with that tenant.
|
|
30
|
+
# Adds a user to several tenants in one call, each optionally with a per-tenant
|
|
31
|
+
# profile that overrides their workspace profile.
|
|
30
32
|
sig do
|
|
31
33
|
params(
|
|
32
34
|
user_id: String,
|
|
@@ -42,10 +44,8 @@ module Courier
|
|
|
42
44
|
)
|
|
43
45
|
end
|
|
44
46
|
|
|
45
|
-
#
|
|
46
|
-
#
|
|
47
|
-
# A custom profile can also be supplied with the tenant. This profile will be
|
|
48
|
-
# merged with the user's main profile when sending to the user with that tenant.
|
|
47
|
+
# Adds a user to one tenant, optionally with a tenant-specific profile that
|
|
48
|
+
# overrides their workspace profile for sends in that tenant.
|
|
49
49
|
sig do
|
|
50
50
|
params(
|
|
51
51
|
tenant_id: String,
|
|
@@ -65,7 +65,8 @@ module Courier
|
|
|
65
65
|
)
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
# Removes a user from
|
|
68
|
+
# Removes a user from every tenant they belong to in one call. Their
|
|
69
|
+
# workspace-level profile is a separate resource.
|
|
69
70
|
sig do
|
|
70
71
|
params(
|
|
71
72
|
user_id: String,
|
|
@@ -79,7 +80,8 @@ module Courier
|
|
|
79
80
|
)
|
|
80
81
|
end
|
|
81
82
|
|
|
82
|
-
# Removes a user from
|
|
83
|
+
# Removes a user from one tenant. Their other tenant memberships and workspace
|
|
84
|
+
# profile are managed through separate endpoints.
|
|
83
85
|
sig do
|
|
84
86
|
params(
|
|
85
87
|
tenant_id: String,
|