prelude-sdk 0.5.0 → 0.7.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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +43 -0
  3. data/README.md +1 -1
  4. data/lib/prelude_sdk/internal/transport/base_client.rb +5 -0
  5. data/lib/prelude_sdk/models/notify_send_batch_params.rb +13 -1
  6. data/lib/prelude_sdk/models/notify_send_params.rb +13 -1
  7. data/lib/prelude_sdk/models/transactional_send_params.rb +11 -1
  8. data/lib/prelude_sdk/models/verification_check_params.rb +44 -1
  9. data/lib/prelude_sdk/models/verification_check_response.rb +12 -3
  10. data/lib/prelude_sdk/models/verification_create_params.rb +95 -5
  11. data/lib/prelude_sdk/models/watch_predict_params.rb +16 -4
  12. data/lib/prelude_sdk/models/watch_predict_response.rb +4 -0
  13. data/lib/prelude_sdk/models/watch_send_events_params.rb +22 -3
  14. data/lib/prelude_sdk/resources/notify.rb +16 -2
  15. data/lib/prelude_sdk/resources/transactional.rb +3 -1
  16. data/lib/prelude_sdk/resources/verification.rb +3 -1
  17. data/lib/prelude_sdk/resources/watch.rb +19 -6
  18. data/lib/prelude_sdk/version.rb +1 -1
  19. data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +19 -0
  20. data/rbi/prelude_sdk/models/notify_send_params.rbi +19 -0
  21. data/rbi/prelude_sdk/models/transactional_send_params.rbi +15 -0
  22. data/rbi/prelude_sdk/models/verification_check_params.rbi +68 -0
  23. data/rbi/prelude_sdk/models/verification_check_response.rbi +19 -3
  24. data/rbi/prelude_sdk/models/verification_create_params.rbi +203 -3
  25. data/rbi/prelude_sdk/models/watch_predict_params.rbi +22 -3
  26. data/rbi/prelude_sdk/models/watch_predict_response.rbi +11 -0
  27. data/rbi/prelude_sdk/models/watch_send_events_params.rbi +27 -3
  28. data/rbi/prelude_sdk/resources/notify.rbi +24 -0
  29. data/rbi/prelude_sdk/resources/transactional.rbi +5 -0
  30. data/rbi/prelude_sdk/resources/verification.rbi +6 -0
  31. data/rbi/prelude_sdk/resources/watch.rbi +19 -6
  32. data/sig/prelude_sdk/models/notify_send_batch_params.rbs +7 -0
  33. data/sig/prelude_sdk/models/notify_send_params.rbs +7 -0
  34. data/sig/prelude_sdk/models/transactional_send_params.rbs +7 -0
  35. data/sig/prelude_sdk/models/verification_check_params.rbs +31 -1
  36. data/sig/prelude_sdk/models/verification_check_response.rbs +8 -1
  37. data/sig/prelude_sdk/models/verification_create_params.rbs +45 -0
  38. data/sig/prelude_sdk/models/watch_predict_params.rbs +7 -0
  39. data/sig/prelude_sdk/models/watch_predict_response.rbs +3 -1
  40. data/sig/prelude_sdk/resources/notify.rbs +2 -0
  41. data/sig/prelude_sdk/resources/transactional.rbs +1 -0
  42. data/sig/prelude_sdk/resources/verification.rbs +1 -0
  43. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e471ff14576be4e30d555ac095637659799c089243d85e8eb0b1e107d5f72a4d
4
- data.tar.gz: b7429bca67dc1516c3deaccf43ca63535b4b2ec8e07d36889635893b940cb1ee
3
+ metadata.gz: 5c0ab52c77ef4b4adef294278608b900e799d87addb9838aa9d0f1b670cba4e3
4
+ data.tar.gz: 44b544a684b17f92a020198981d31f6013a43cc7d73b47c475f680529e332adb
5
5
  SHA512:
6
- metadata.gz: ad313a26fcd1936dc0b3e66224f7fdf4488c392c85ac3828ee18ff93463791e07ff0113296d5145ef492a3189787601c8481a8ee83fd735af42b985a52cbb148
7
- data.tar.gz: 2be45dd24a4db7b69cc636e1db2703d69a88721034ebb50bff9f3f79c1b6df2179b4a1f4a08f9681bd6498c7f50f380034e9ff1e6ee895a437433932bbd9d212
6
+ metadata.gz: 73d77009ae1589ec192685756e1ab08475f561447e281ff9ce16104be9c64bd16dc8658a9563d10c8fff0d8bf1ebf48756c2545125ba6e7f2c65ba59f020514d
7
+ data.tar.gz: 97b509de3dbc882b0ba62e84e19d7aaf4a17219a9d689d6e3fa309d07685969e92ce049326640c9f06f2038e1f8e5d90433955e5e9f5e3dd0d75cc779253e381
data/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0 (2026-09-15)
4
+
5
+ Full Changelog: [v0.6.0...v0.7.0](https://github.com/prelude-so/ruby-sdk/compare/v0.6.0...v0.7.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([ed39fec](https://github.com/prelude-so/ruby-sdk/commit/ed39fece4f1d8838d68d7596ab587b4aba76a14a))
10
+ * **api:** api update ([00dcf41](https://github.com/prelude-so/ruby-sdk/commit/00dcf41dcc28fe76ec0a112169c6d01da9937a53))
11
+ * **api:** api update ([ebb1d68](https://github.com/prelude-so/ruby-sdk/commit/ebb1d682d35d4fc0f6a403aa06b903481ccae8fe))
12
+
13
+
14
+ ### Chores
15
+
16
+ * **internal:** allow the mock server port to be set with STAINLESS_MOCK_PORT ([2c5f32b](https://github.com/prelude-so/ruby-sdk/commit/2c5f32b48b0859861875e96aceb3530daf400015))
17
+
18
+ ## 0.6.0 (2026-08-07)
19
+
20
+ Full Changelog: [v0.5.0...v0.6.0](https://github.com/prelude-so/ruby-sdk/compare/v0.5.0...v0.6.0)
21
+
22
+ ### Features
23
+
24
+ * **api:** api update ([f50fa71](https://github.com/prelude-so/ruby-sdk/commit/f50fa71d8df49b0787d7db47a5510f44151f9e8d))
25
+ * **api:** api update ([05e7092](https://github.com/prelude-so/ruby-sdk/commit/05e7092347c6b2b2c8824c3912843b751ee5139b))
26
+ * **api:** api update ([9354ab4](https://github.com/prelude-so/ruby-sdk/commit/9354ab444b7f24f01f953071f76088c05d7b60e0))
27
+ * **api:** api update ([8617519](https://github.com/prelude-so/ruby-sdk/commit/8617519ff89a67501d6a68a48e228f8f90c1acc5))
28
+ * **api:** api update ([714bb99](https://github.com/prelude-so/ruby-sdk/commit/714bb99f625935f8e7320ff56fe30db697015bc6))
29
+ * **api:** api update ([36cef75](https://github.com/prelude-so/ruby-sdk/commit/36cef7585d0e0217ef205a0de19a74cab7088ed6))
30
+ * **api:** api update ([4f9e5d5](https://github.com/prelude-so/ruby-sdk/commit/4f9e5d5fed8221c84514419e8fc55b4fe9695bb4))
31
+ * **api:** api update ([3a7d02a](https://github.com/prelude-so/ruby-sdk/commit/3a7d02aaff30f5db464a6669134125b645faccdb))
32
+ * **api:** api update ([b481c73](https://github.com/prelude-so/ruby-sdk/commit/b481c73a09d3cea498b5449612e8f36ffd134b68))
33
+ * **stlc:** configurable CI runner and private-production-repo support in workflow templates ([066b5f2](https://github.com/prelude-so/ruby-sdk/commit/066b5f29b4bf551e90d782fc5216a62669c7c415))
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * **client:** elide content type header on requests without body ([3b5e81c](https://github.com/prelude-so/ruby-sdk/commit/3b5e81cec044555fb0b3aecead5ae056eedb3373))
39
+ * **client:** send content-type header for requests with an omitted optional body ([513ece3](https://github.com/prelude-so/ruby-sdk/commit/513ece3bc7f8c0282b8825bb7a817c3a27e5c795))
40
+
41
+
42
+ ### Chores
43
+
44
+ * **internal:** bound formatter parallelism to CPU count ([8370b94](https://github.com/prelude-so/ruby-sdk/commit/8370b948890fbb6e4a981e63e4be6c0ee1fb0b1e))
45
+
3
46
  ## 0.5.0 (2026-05-07)
4
47
 
5
48
  Full Changelog: [v0.4.0...v0.5.0](https://github.com/prelude-so/ruby-sdk/compare/v0.4.0...v0.5.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "prelude-sdk", "~> 0.5.0"
20
+ gem "prelude-sdk", "~> 0.7.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -306,6 +306,11 @@ module PreludeSDK
306
306
  PreludeSDK::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
307
307
  end
308
308
 
309
+ # Generated methods always pass `req[:body]` for operations that define a
310
+ # request body, so only elide the content-type header when the operation
311
+ # has no body at all, not when an optional body param was omitted.
312
+ headers.delete("content-type") if body.nil? && !req.key?(:body)
313
+
309
314
  url = PreludeSDK::Internal::Util.join_parsed_uri(
310
315
  @base_url_components,
311
316
  {**req, path: path, query: query}
@@ -65,6 +65,16 @@ module PreludeSDK
65
65
  # @return [String, nil]
66
66
  optional :locale, String
67
67
 
68
+ # @!attribute max_auto_retries
69
+ # Maximum number of automatic retry attempts across channels for each send in the
70
+ # batch, in addition to the first attempt. For example, `2` allows up to 3 total
71
+ # delivery attempts per recipient. Lower values reduce delivery cost on
72
+ # hard-to-reach numbers at the expense of deliverability. When omitted, your
73
+ # account's configured default applies.
74
+ #
75
+ # @return [Integer, nil]
76
+ optional :max_auto_retries, Integer
77
+
68
78
  # @!attribute preferred_channel
69
79
  # Preferred channel for delivery. If unavailable, automatic fallback applies.
70
80
  #
@@ -84,7 +94,7 @@ module PreludeSDK
84
94
  # @return [Hash{Symbol=>String}, nil]
85
95
  optional :variables, PreludeSDK::Internal::Type::HashOf[String]
86
96
 
87
- # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
97
+ # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, max_auto_retries: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
88
98
  # Some parameter documentations has been truncated, see
89
99
  # {PreludeSDK::Models::NotifySendBatchParams} for more details.
90
100
  #
@@ -104,6 +114,8 @@ module PreludeSDK
104
114
  #
105
115
  # @param locale [String] A BCP-47 formatted locale string.
106
116
  #
117
+ # @param max_auto_retries [Integer] Maximum number of automatic retry attempts across channels for each send in the
118
+ #
107
119
  # @param preferred_channel [Symbol, PreludeSDK::Models::NotifySendBatchParams::PreferredChannel] Preferred channel for delivery. If unavailable, automatic fallback applies.
108
120
  #
109
121
  # @param schedule_at [Time] Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply w
@@ -70,6 +70,16 @@ module PreludeSDK
70
70
  # @return [String, nil]
71
71
  optional :locale, String
72
72
 
73
+ # @!attribute max_auto_retries
74
+ # Maximum number of automatic retry attempts across channels for this send, in
75
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
76
+ # attempts. Lower values reduce delivery cost on hard-to-reach numbers at the
77
+ # expense of deliverability. When omitted, your account's configured default
78
+ # applies.
79
+ #
80
+ # @return [Integer, nil]
81
+ optional :max_auto_retries, Integer
82
+
73
83
  # @!attribute preferred_channel
74
84
  # The preferred channel to be used in priority for message delivery. If the
75
85
  # channel is unavailable, the system will fallback to other available channels.
@@ -91,7 +101,7 @@ module PreludeSDK
91
101
  # @return [Hash{Symbol=>String}, nil]
92
102
  optional :variables, PreludeSDK::Internal::Type::HashOf[String]
93
103
 
94
- # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
104
+ # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, max_auto_retries: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
95
105
  # Some parameter documentations has been truncated, see
96
106
  # {PreludeSDK::Models::NotifySendParams} for more details.
97
107
  #
@@ -111,6 +121,8 @@ module PreludeSDK
111
121
  #
112
122
  # @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
113
123
  #
124
+ # @param max_auto_retries [Integer] Maximum number of automatic retry attempts across channels for this send, in add
125
+ #
114
126
  # @param preferred_channel [Symbol, PreludeSDK::Models::NotifySendParams::PreferredChannel] The preferred channel to be used in priority for message delivery. If the channe
115
127
  #
116
128
  # @param schedule_at [Time] Schedule the message for future delivery in RFC3339 format. Marketing messages c
@@ -69,6 +69,14 @@ module PreludeSDK
69
69
  # @return [String, nil]
70
70
  optional :locale, String
71
71
 
72
+ # @!attribute max_auto_retries
73
+ # Maximum number of automatic retry attempts across channels for this send, in
74
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
75
+ # attempts. When omitted, your account's configured default applies.
76
+ #
77
+ # @return [Integer, nil]
78
+ optional :max_auto_retries, Integer
79
+
72
80
  # @!attribute preferred_channel
73
81
  # The preferred delivery channel for the message. When specified, the system will
74
82
  # prioritize sending via the requested channel if the template is configured for
@@ -89,7 +97,7 @@ module PreludeSDK
89
97
  # @return [Hash{Symbol=>String}, nil]
90
98
  optional :variables, PreludeSDK::Internal::Type::HashOf[String]
91
99
 
92
- # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, variables: nil, request_options: {})
100
+ # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, max_auto_retries: nil, preferred_channel: nil, variables: nil, request_options: {})
93
101
  # Some parameter documentations has been truncated, see
94
102
  # {PreludeSDK::Models::TransactionalSendParams} for more details.
95
103
  #
@@ -109,6 +117,8 @@ module PreludeSDK
109
117
  #
110
118
  # @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
111
119
  #
120
+ # @param max_auto_retries [Integer] Maximum number of automatic retry attempts across channels for this send, in add
121
+ #
112
122
  # @param preferred_channel [Symbol, PreludeSDK::Models::TransactionalSendParams::PreferredChannel] The preferred delivery channel for the message. When specified, the system will
113
123
  #
114
124
  # @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
@@ -20,7 +20,16 @@ module PreludeSDK
20
20
  # @return [PreludeSDK::Models::VerificationCheckParams::Target]
21
21
  required :target, -> { PreludeSDK::VerificationCheckParams::Target }
22
22
 
23
- # @!method initialize(code:, target:, request_options: {})
23
+ # @!attribute psd2
24
+ # Required when checking a code issued under the `prelude:psd2` template. The
25
+ # submitted variables must match those provided at issuance; any mismatch
26
+ # invalidates the code (PSD2 SCA RTS Article 5 dynamic linking). Ignored on
27
+ # non-PSD2 verifications.
28
+ #
29
+ # @return [PreludeSDK::Models::VerificationCheckParams::Psd2, nil]
30
+ optional :psd2, -> { PreludeSDK::VerificationCheckParams::Psd2 }
31
+
32
+ # @!method initialize(code:, target:, psd2: nil, request_options: {})
24
33
  # Some parameter documentations has been truncated, see
25
34
  # {PreludeSDK::Models::VerificationCheckParams} for more details.
26
35
  #
@@ -28,6 +37,8 @@ module PreludeSDK
28
37
  #
29
38
  # @param target [PreludeSDK::Models::VerificationCheckParams::Target] The verification target. Either a phone number or an email address. To use the e
30
39
  #
40
+ # @param psd2 [PreludeSDK::Models::VerificationCheckParams::Psd2] Required when checking a code issued under the `prelude:psd2` template. The subm
41
+ #
31
42
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
32
43
 
33
44
  class Target < PreludeSDK::Internal::Type::BaseModel
@@ -64,6 +75,38 @@ module PreludeSDK
64
75
  # @return [Array<Symbol>]
65
76
  end
66
77
  end
78
+
79
+ class Psd2 < PreludeSDK::Internal::Type::BaseModel
80
+ # @!attribute amount
81
+ # Decimal amount of the transaction.
82
+ #
83
+ # @return [String]
84
+ required :amount, String
85
+
86
+ # @!attribute currency
87
+ # ISO 4217 currency code.
88
+ #
89
+ # @return [String]
90
+ required :currency, String
91
+
92
+ # @!attribute recipient
93
+ # Payee name displayed to the payer.
94
+ #
95
+ # @return [String]
96
+ required :recipient, String
97
+
98
+ # @!method initialize(amount:, currency:, recipient:)
99
+ # Required when checking a code issued under the `prelude:psd2` template. The
100
+ # submitted variables must match those provided at issuance; any mismatch
101
+ # invalidates the code (PSD2 SCA RTS Article 5 dynamic linking). Ignored on
102
+ # non-PSD2 verifications.
103
+ #
104
+ # @param amount [String] Decimal amount of the transaction.
105
+ #
106
+ # @param currency [String] ISO 4217 currency code.
107
+ #
108
+ # @param recipient [String] Payee name displayed to the payer.
109
+ end
67
110
  end
68
111
  end
69
112
  end
@@ -5,7 +5,9 @@ module PreludeSDK
5
5
  # @see PreludeSDK::Resources::Verification#check
6
6
  class VerificationCheckResponse < PreludeSDK::Internal::Type::BaseModel
7
7
  # @!attribute status
8
- # The status of the check.
8
+ # The status of the check. For `prelude:psd2` codes, `transaction_missing` is
9
+ # returned when the `psd2` block is omitted, and `transaction_mismatch` when the
10
+ # submitted variables differ from those provided at issuance.
9
11
  #
10
12
  # @return [Symbol, PreludeSDK::Models::VerificationCheckResponse::Status]
11
13
  required :status, enum: -> { PreludeSDK::Models::VerificationCheckResponse::Status }
@@ -28,7 +30,10 @@ module PreludeSDK
28
30
  optional :request_id, String
29
31
 
30
32
  # @!method initialize(status:, id: nil, metadata: nil, request_id: nil)
31
- # @param status [Symbol, PreludeSDK::Models::VerificationCheckResponse::Status] The status of the check.
33
+ # Some parameter documentations has been truncated, see
34
+ # {PreludeSDK::Models::VerificationCheckResponse} for more details.
35
+ #
36
+ # @param status [Symbol, PreludeSDK::Models::VerificationCheckResponse::Status] The status of the check. For `prelude:psd2` codes, `transaction_missing` is retu
32
37
  #
33
38
  # @param id [String] The verification identifier.
34
39
  #
@@ -36,7 +41,9 @@ module PreludeSDK
36
41
  #
37
42
  # @param request_id [String]
38
43
 
39
- # The status of the check.
44
+ # The status of the check. For `prelude:psd2` codes, `transaction_missing` is
45
+ # returned when the `psd2` block is omitted, and `transaction_mismatch` when the
46
+ # submitted variables differ from those provided at issuance.
40
47
  #
41
48
  # @see PreludeSDK::Models::VerificationCheckResponse#status
42
49
  module Status
@@ -45,6 +52,8 @@ module PreludeSDK
45
52
  SUCCESS = :success
46
53
  FAILURE = :failure
47
54
  EXPIRED_OR_NOT_FOUND = :expired_or_not_found
55
+ TRANSACTION_MISSING = :transaction_missing
56
+ TRANSACTION_MISMATCH = :transaction_mismatch
48
57
 
49
58
  # @!method self.values
50
59
  # @return [Array<Symbol>]
@@ -125,6 +125,22 @@ module PreludeSDK
125
125
  # @return [String, nil]
126
126
  optional :callback_url, String
127
127
 
128
+ # @!attribute channels
129
+ # The channels this verification may use, in the order they are tried. Channels
130
+ # you omit are never used, including on retries. This option can only be set when
131
+ # the verification is created. The list is recorded on the verification and
132
+ # applies for its whole lifecycle, so `channels` sent while retrying an existing
133
+ # verification is ignored — unlike `preferred_channel`, which is honored on every
134
+ # retry. Every channel you list must be enabled on your account and active in the
135
+ # destination country, otherwise the request fails with
136
+ # `channel_not_enabled_in_region`. Prelude still picks the best provider within
137
+ # each channel. Cannot be combined with `preferred_channel`. Voice is requested
138
+ # through `method` instead. Disabled by default — contact support to enable it.
139
+ #
140
+ # @return [Array<Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Channel>, nil]
141
+ optional :channels,
142
+ -> { PreludeSDK::Internal::Type::ArrayOf[enum: PreludeSDK::VerificationCreateParams::Options::Channel] }
143
+
128
144
  # @!attribute code_size
129
145
  # The size of the code generated. It should be between 4 and 8. Defaults to the
130
146
  # code size specified from the Dashboard.
@@ -140,6 +156,18 @@ module PreludeSDK
140
156
  # @return [String, nil]
141
157
  optional :custom_code, String
142
158
 
159
+ # @!attribute force_challenge
160
+ # When `true`, the verification is routed through challenge-safe channels
161
+ # (non-SMS/Voice) regardless of country eligibility or any antispam outcome. The
162
+ # resulting verification has `status: "challenged"`. Use this when you have your
163
+ # own signal that the request is suspicious and want stricter routing — the
164
+ # verification is **not** classified as fraud and does not contribute to
165
+ # anti-fraud counters or risk factors. This feature is disabled by default —
166
+ # contact Prelude support to enable it on your account.
167
+ #
168
+ # @return [Boolean, nil]
169
+ optional :force_challenge, PreludeSDK::Internal::Type::Boolean
170
+
143
171
  # @!attribute locale
144
172
  # A BCP-47 formatted locale string with the language the text message will be sent
145
173
  # to. If there's no locale set, the language will be determined by the country
@@ -149,6 +177,26 @@ module PreludeSDK
149
177
  # @return [String, nil]
150
178
  optional :locale, String
151
179
 
180
+ # @!attribute max_auto_fallbacks
181
+ # Maximum number of delivery attempts Prelude may add on its own after the one you
182
+ # requested. `0` means a single attempt: if it cannot be delivered, Prelude
183
+ # neither tries another provider nor another channel, and does not retry
184
+ # automatically. `1` allows one additional attempt, and so on — a value larger
185
+ # than the number of routes available for the destination simply behaves like the
186
+ # default. When omitted, Prelude retries as your account is configured, across as
187
+ # many channels as the route offers.
188
+ #
189
+ # This option can only be set when the verification is created. The value is
190
+ # recorded on the verification and applies for its whole lifecycle, so a
191
+ # `max_auto_fallbacks` sent while retrying an existing verification is ignored —
192
+ # the limit cannot be raised or lowered after the fact. A retry you ask for is not
193
+ # an automatic attempt, so it gets a fresh allowance of the same limit. This
194
+ # option is disabled by default — contact Prelude support to enable it on your
195
+ # account.
196
+ #
197
+ # @return [Integer, nil]
198
+ optional :max_auto_fallbacks, Integer
199
+
152
200
  # @!attribute verification_method
153
201
  # The method used for verifying this phone number. The 'voice' option provides an
154
202
  # accessible alternative for visually impaired users by delivering the
@@ -164,7 +212,12 @@ module PreludeSDK
164
212
  api_name: :method
165
213
 
166
214
  # @!attribute preferred_channel
167
- # The preferred channel to be used in priority for verification.
215
+ # The channel to prioritize when delivering the verification. Prelude prioritizes
216
+ # this channel on the first attempt and continues to prefer it on retries while an
217
+ # untried route on that channel remains; once those are exhausted, retries fall
218
+ # back to the next best available route. If the channel is unavailable (for
219
+ # example, when a verification is challenged), Prelude uses the best available
220
+ # route instead. Cannot be combined with `channels`.
168
221
  #
169
222
  # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::PreferredChannel, nil]
170
223
  optional :preferred_channel, enum: -> { PreludeSDK::VerificationCreateParams::Options::PreferredChannel }
@@ -189,7 +242,7 @@ module PreludeSDK
189
242
  # @return [Hash{Symbol=>String}, nil]
190
243
  optional :variables, PreludeSDK::Internal::Type::HashOf[String]
191
244
 
192
- # @!method initialize(app_realm: nil, callback_url: nil, code_size: nil, custom_code: nil, locale: nil, verification_method: nil, preferred_channel: nil, sender_id: nil, template_id: nil, variables: nil)
245
+ # @!method initialize(app_realm: nil, callback_url: nil, channels: nil, code_size: nil, custom_code: nil, force_challenge: nil, locale: nil, max_auto_fallbacks: nil, verification_method: nil, preferred_channel: nil, sender_id: nil, template_id: nil, variables: nil)
193
246
  # Some parameter documentations has been truncated, see
194
247
  # {PreludeSDK::Models::VerificationCreateParams::Options} for more details.
195
248
  #
@@ -199,15 +252,21 @@ module PreludeSDK
199
252
  #
200
253
  # @param callback_url [String] The URL where webhooks will be sent when verification events occur, including ve
201
254
  #
255
+ # @param channels [Array<Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Channel>] The channels this verification may use, in the order they are tried. Channels yo
256
+ #
202
257
  # @param code_size [Integer] The size of the code generated. It should be between 4 and 8. Defaults to the co
203
258
  #
204
259
  # @param custom_code [String] The custom code to use for OTP verification. To use the custom code feature, con
205
260
  #
261
+ # @param force_challenge [Boolean] When `true`, the verification is routed through challenge-safe channels (non-SMS
262
+ #
206
263
  # @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
207
264
  #
265
+ # @param max_auto_fallbacks [Integer] Maximum number of delivery attempts Prelude may add on its own after the one you
266
+ #
208
267
  # @param verification_method [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Method] The method used for verifying this phone number. The 'voice' option provides an
209
268
  #
210
- # @param preferred_channel [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::PreferredChannel] The preferred channel to be used in priority for verification.
269
+ # @param preferred_channel [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::PreferredChannel] The channel to prioritize when delivering the verification. Prelude prioritizes
211
270
  #
212
271
  # @param sender_id [String] The Sender ID to use for this message. The Sender ID needs to be enabled by Prel
213
272
  #
@@ -262,6 +321,20 @@ module PreludeSDK
262
321
  end
263
322
  end
264
323
 
324
+ module Channel
325
+ extend PreludeSDK::Internal::Type::Enum
326
+
327
+ SMS = :sms
328
+ RCS = :rcs
329
+ WHATSAPP = :whatsapp
330
+ VIBER = :viber
331
+ ZALO = :zalo
332
+ TELEGRAM = :telegram
333
+
334
+ # @!method self.values
335
+ # @return [Array<Symbol>]
336
+ end
337
+
265
338
  # The method used for verifying this phone number. The 'voice' option provides an
266
339
  # accessible alternative for visually impaired users by delivering the
267
340
  # verification code through a phone call rather than a text message. It also
@@ -282,7 +355,12 @@ module PreludeSDK
282
355
  # @return [Array<Symbol>]
283
356
  end
284
357
 
285
- # The preferred channel to be used in priority for verification.
358
+ # The channel to prioritize when delivering the verification. Prelude prioritizes
359
+ # this channel on the first attempt and continues to prefer it on retries while an
360
+ # untried route on that channel remains; once those are exhausted, retries fall
361
+ # back to the next best available route. If the channel is unavailable (for
362
+ # example, when a verification is challenged), Prelude uses the best available
363
+ # route instead. Cannot be combined with `channels`.
286
364
  #
287
365
  # @see PreludeSDK::Models::VerificationCreateParams::Options#preferred_channel
288
366
  module PreferredChannel
@@ -327,6 +405,16 @@ module PreludeSDK
327
405
  # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Signals::DevicePlatform, nil]
328
406
  optional :device_platform, enum: -> { PreludeSDK::VerificationCreateParams::Signals::DevicePlatform }
329
407
 
408
+ # @!attribute existing_user
409
+ # Whether the end-user already exists in your system, for example an existing
410
+ # account signing in again rather than a first-time signup. Unlike
411
+ # `is_trusted_user`, this signal does not bypass fraud checks; it is taken into
412
+ # account as one additional anti-fraud signal. For more details, refer to
413
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
414
+ #
415
+ # @return [Boolean, nil]
416
+ optional :existing_user, PreludeSDK::Internal::Type::Boolean
417
+
330
418
  # @!attribute ip
331
419
  # The public IP v4 or v6 address of the end-user's device. You should collect this
332
420
  # from your backend. If your backend is behind a proxy, use the `X-Forwarded-For`,
@@ -366,7 +454,7 @@ module PreludeSDK
366
454
  # @return [String, nil]
367
455
  optional :user_agent, String
368
456
 
369
- # @!method initialize(app_version: nil, device_id: nil, device_model: nil, device_platform: nil, ip: nil, is_trusted_user: nil, ja4_fingerprint: nil, os_version: nil, user_agent: nil)
457
+ # @!method initialize(app_version: nil, device_id: nil, device_model: nil, device_platform: nil, existing_user: nil, ip: nil, is_trusted_user: nil, ja4_fingerprint: nil, os_version: nil, user_agent: nil)
370
458
  # Some parameter documentations has been truncated, see
371
459
  # {PreludeSDK::Models::VerificationCreateParams::Signals} for more details.
372
460
  #
@@ -381,6 +469,8 @@ module PreludeSDK
381
469
  #
382
470
  # @param device_platform [Symbol, PreludeSDK::Models::VerificationCreateParams::Signals::DevicePlatform] The type of the user's device.
383
471
  #
472
+ # @param existing_user [Boolean] Whether the end-user already exists in your system, for example an existing acco
473
+ #
384
474
  # @param ip [String] The public IP v4 or v6 address of the end-user's device. You should collect this
385
475
  #
386
476
  # @param is_trusted_user [Boolean] This signal should indicate a higher level of trust, explicitly stating that the
@@ -8,7 +8,7 @@ module PreludeSDK
8
8
  include PreludeSDK::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute target
11
- # The prediction target. Only supports phone numbers for now.
11
+ # The signup identifier to score — a phone number or email address.
12
12
  #
13
13
  # @return [PreludeSDK::Models::WatchPredictParams::Target]
14
14
  required :target, -> { PreludeSDK::WatchPredictParams::Target }
@@ -36,7 +36,7 @@ module PreludeSDK
36
36
  # Some parameter documentations has been truncated, see
37
37
  # {PreludeSDK::Models::WatchPredictParams} for more details.
38
38
  #
39
- # @param target [PreludeSDK::Models::WatchPredictParams::Target] The prediction target. Only supports phone numbers for now.
39
+ # @param target [PreludeSDK::Models::WatchPredictParams::Target] The signup identifier to score — a phone number or email address.
40
40
  #
41
41
  # @param dispatch_id [String] The identifier of the dispatch that came from the front-end SDK.
42
42
  #
@@ -60,7 +60,7 @@ module PreludeSDK
60
60
  required :value, String
61
61
 
62
62
  # @!method initialize(type:, value:)
63
- # The prediction target. Only supports phone numbers for now.
63
+ # The signup identifier to score — a phone number or email address.
64
64
  #
65
65
  # @param type [Symbol, PreludeSDK::Models::WatchPredictParams::Target::Type] The type of the target. Either "phone_number" or "email_address".
66
66
  #
@@ -124,6 +124,16 @@ module PreludeSDK
124
124
  # @return [Symbol, PreludeSDK::Models::WatchPredictParams::Signals::DevicePlatform, nil]
125
125
  optional :device_platform, enum: -> { PreludeSDK::WatchPredictParams::Signals::DevicePlatform }
126
126
 
127
+ # @!attribute existing_user
128
+ # Whether the end-user already exists in your system, for example an existing
129
+ # account signing in again rather than a first-time signup. Unlike
130
+ # `is_trusted_user`, this signal does not bypass fraud checks; it is taken into
131
+ # account as one additional anti-fraud signal. For more details, refer to
132
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
133
+ #
134
+ # @return [Boolean, nil]
135
+ optional :existing_user, PreludeSDK::Internal::Type::Boolean
136
+
127
137
  # @!attribute ip
128
138
  # The public IP v4 or v6 address of the end-user's device. You should collect this
129
139
  # from your backend. If your backend is behind a proxy, use the `X-Forwarded-For`,
@@ -163,7 +173,7 @@ module PreludeSDK
163
173
  # @return [String, nil]
164
174
  optional :user_agent, String
165
175
 
166
- # @!method initialize(app_version: nil, device_id: nil, device_model: nil, device_platform: nil, ip: nil, is_trusted_user: nil, ja4_fingerprint: nil, os_version: nil, user_agent: nil)
176
+ # @!method initialize(app_version: nil, device_id: nil, device_model: nil, device_platform: nil, existing_user: nil, ip: nil, is_trusted_user: nil, ja4_fingerprint: nil, os_version: nil, user_agent: nil)
167
177
  # Some parameter documentations has been truncated, see
168
178
  # {PreludeSDK::Models::WatchPredictParams::Signals} for more details.
169
179
  #
@@ -178,6 +188,8 @@ module PreludeSDK
178
188
  #
179
189
  # @param device_platform [Symbol, PreludeSDK::Models::WatchPredictParams::Signals::DevicePlatform] The type of the user's device.
180
190
  #
191
+ # @param existing_user [Boolean] Whether the end-user already exists in your system, for example an existing acco
192
+ #
181
193
  # @param ip [String] The public IP v4 or v6 address of the end-user's device. You should collect this
182
194
  #
183
195
  # @param is_trusted_user [Boolean] This signal should indicate a higher level of trust, explicitly stating that the
@@ -28,6 +28,9 @@ module PreludeSDK
28
28
  # when prediction is "suspicious" and the anti-fraud system detected specific risk
29
29
  # signals.
30
30
  #
31
+ # - `account_risk_profile` - The target matches a risk profile derived from the
32
+ # outcomes reported on your own account, rather than from a signal shared across
33
+ # accounts.
31
34
  # - `behavioral_pattern` - The phone number past behavior during verification
32
35
  # flows exhibits suspicious patterns.
33
36
  # - `device_attribute` - The device exhibits characteristics associated with
@@ -81,6 +84,7 @@ module PreludeSDK
81
84
  module RiskFactor
82
85
  extend PreludeSDK::Internal::Type::Enum
83
86
 
87
+ ACCOUNT_RISK_PROFILE = :account_risk_profile
84
88
  BEHAVIORAL_PATTERN = :behavioral_pattern
85
89
  DEVICE_ATTRIBUTE = :device_attribute
86
90
  FRAUD_DATABASE = :fraud_database
@@ -24,7 +24,15 @@ module PreludeSDK
24
24
 
25
25
  class Event < PreludeSDK::Internal::Type::BaseModel
26
26
  # @!attribute confidence
27
- # A confidence level you want to assign to the event.
27
+ # How much this event tells us to trust the end-user's legitimacy — not how
28
+ # certain you are that the event occurred. In increasing order of trust:
29
+ # `minimum`, `low`, `neutral`, `high`, `maximum`.
30
+ #
31
+ # Use `minimum` for an event tied to a user you trust the least to be legitimate
32
+ # (e.g. a `payment.chargeback`), and `maximum` for an event tied to a highly
33
+ # trustworthy user (e.g. a confirmed 3DS payment). Prelude weights these signals
34
+ # when scoring traffic: it filters out users tied to low-confidence events while
35
+ # preserving the experience for users tied to high-confidence ones.
28
36
  #
29
37
  # @return [Symbol, PreludeSDK::Models::WatchSendEventsParams::Event::Confidence]
30
38
  required :confidence, enum: -> { PreludeSDK::WatchSendEventsParams::Event::Confidence }
@@ -42,13 +50,24 @@ module PreludeSDK
42
50
  required :target, -> { PreludeSDK::WatchSendEventsParams::Event::Target }
43
51
 
44
52
  # @!method initialize(confidence:, label:, target:)
45
- # @param confidence [Symbol, PreludeSDK::Models::WatchSendEventsParams::Event::Confidence] A confidence level you want to assign to the event.
53
+ # Some parameter documentations has been truncated, see
54
+ # {PreludeSDK::Models::WatchSendEventsParams::Event} for more details.
55
+ #
56
+ # @param confidence [Symbol, PreludeSDK::Models::WatchSendEventsParams::Event::Confidence] How much this event tells us to trust the end-user's legitimacy — not how certai
46
57
  #
47
58
  # @param label [String] A label to describe what the event refers to.
48
59
  #
49
60
  # @param target [PreludeSDK::Models::WatchSendEventsParams::Event::Target] The event target. Only supports phone numbers for now.
50
61
 
51
- # A confidence level you want to assign to the event.
62
+ # How much this event tells us to trust the end-user's legitimacy — not how
63
+ # certain you are that the event occurred. In increasing order of trust:
64
+ # `minimum`, `low`, `neutral`, `high`, `maximum`.
65
+ #
66
+ # Use `minimum` for an event tied to a user you trust the least to be legitimate
67
+ # (e.g. a `payment.chargeback`), and `maximum` for an event tied to a highly
68
+ # trustworthy user (e.g. a confirmed 3DS payment). Prelude weights these signals
69
+ # when scoring traffic: it filters out users tied to low-confidence events while
70
+ # preserving the experience for users tied to high-confidence ones.
52
71
  #
53
72
  # @see PreludeSDK::Models::WatchSendEventsParams::Event#confidence
54
73
  module Confidence