@@ -53,12 +53,17 @@ def get_jwks(
5353 # @param ip_address [String, nil] The IP address of the user's request.
5454 # @param device_id [String, nil] A unique identifier for the device.
5555 # @param user_agent [String, nil] The user agent string from the user's browser.
56+ # @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this authentication attempt.
5657 # @param email [String, nil] The user's email address.
5758 # @param password [String, nil] The user's password.
59+ # @param radar_auth_attempt_id [String, nil] The ID of an existing Radar authentication attempt to associate with this authentication.
5860 # @param refresh_token [String, nil] The refresh token to exchange for new tokens.
5961 # @param organization_id [String, nil] The ID of the organization to scope the session to.
6062 # @param pending_authentication_token [String, nil] The pending authentication token from a previous authentication attempt.
6163 # @param authentication_challenge_id [String, nil] The ID of the MFA authentication challenge.
64+ # @param radar_challenge_id [String, nil] The ID of the Radar email challenge being verified.
65+ # @param verification_id [String, nil] The ID of the Radar SMS verification being confirmed.
66+ # @param phone_number [String, nil] The phone number the Radar SMS challenge was sent to.
6267 # @param device_code [String, nil] The device verification code.
6368 # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
6469 # @return [WorkOS::AuthenticateResponse]
@@ -72,12 +77,17 @@ def create_authenticate(
7277 ip_address : nil ,
7378 device_id : nil ,
7479 user_agent : nil ,
80+ signals_id : nil ,
7581 email : nil ,
7682 password : nil ,
83+ radar_auth_attempt_id : nil ,
7784 refresh_token : nil ,
7885 organization_id : nil ,
7986 pending_authentication_token : nil ,
8087 authentication_challenge_id : nil ,
88+ radar_challenge_id : nil ,
89+ verification_id : nil ,
90+ phone_number : nil ,
8191 device_code : nil ,
8292 request_options : { }
8393 )
@@ -91,12 +101,17 @@ def create_authenticate(
91101 "ip_address" => ip_address ,
92102 "device_id" => device_id ,
93103 "user_agent" => user_agent ,
104+ "signals_id" => signals_id ,
94105 "email" => email ,
95106 "password" => password ,
107+ "radar_auth_attempt_id" => radar_auth_attempt_id ,
96108 "refresh_token" => refresh_token ,
97109 "organization_id" => organization_id ,
98110 "pending_authentication_token" => pending_authentication_token ,
99111 "authentication_challenge_id" => authentication_challenge_id ,
112+ "radar_challenge_id" => radar_challenge_id ,
113+ "verification_id" => verification_id ,
114+ "phone_number" => phone_number ,
100115 "device_code" => device_code
101116 } . compact
102117 response = @client . request (
@@ -430,6 +445,41 @@ def create_device(
430445 result
431446 end
432447
448+ # Send a Radar SMS challenge
449+ # @param user_id [String] The ID of the user to send the SMS challenge to.
450+ # @param pending_authentication_token [String] The pending authentication token from a previous authentication attempt that triggered the Radar challenge.
451+ # @param phone_number [String] The phone number to send the SMS verification code to.
452+ # @param ip_address [String, nil] The IP address of the user's request.
453+ # @param user_agent [String, nil] The user agent string from the user's request.
454+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
455+ # @return [WorkOS::SendRadarSmsChallengeResponse]
456+ def create_radar_challenge (
457+ user_id :,
458+ pending_authentication_token :,
459+ phone_number :,
460+ ip_address : nil ,
461+ user_agent : nil ,
462+ request_options : { }
463+ )
464+ body = {
465+ "user_id" => user_id ,
466+ "pending_authentication_token" => pending_authentication_token ,
467+ "phone_number" => phone_number ,
468+ "ip_address" => ip_address ,
469+ "user_agent" => user_agent
470+ } . compact
471+ response = @client . request (
472+ method : :post ,
473+ path : "/user_management/radar_challenges" ,
474+ auth : true ,
475+ body : body ,
476+ request_options : request_options
477+ )
478+ result = WorkOS ::SendRadarSmsChallengeResponse . new ( response . body )
479+ result . last_response = WorkOS ::Types ::ApiResponse . new ( http_status : response . code . to_i , http_headers : response . each_header . to_h , request_id : response [ "x-request-id" ] )
480+ result
481+ end
482+
433483 # Revoke Session
434484 # @param session_id [String] The ID of the session to revoke. This can be extracted from the `sid` claim of the access token.
435485 # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
@@ -669,9 +719,12 @@ def list_users(
669719 # @param email_verified [Boolean, nil] Whether the user's email has been verified.
670720 # @param metadata [Hash{String => String}, nil] Object containing metadata key/value pairs associated with the user.
671721 # @param external_id [String, nil] The external ID of the user.
722+ # @param ip_address [String, nil] The IP address of the user's request.
723+ # @param user_agent [String, nil] The user agent string from the user's request.
724+ # @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this request.
672725 # @param password [WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed, nil] Identifies the password.
673726 # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
674- # @return [WorkOS::User ]
727+ # @return [WorkOS::UserCreateResponse ]
675728 def create_user (
676729 email :,
677730 first_name : nil ,
@@ -680,6 +733,9 @@ def create_user(
680733 email_verified : nil ,
681734 metadata : nil ,
682735 external_id : nil ,
736+ ip_address : nil ,
737+ user_agent : nil ,
738+ signals_id : nil ,
683739 password : nil ,
684740 request_options : { }
685741 )
@@ -690,7 +746,10 @@ def create_user(
690746 "name" => name ,
691747 "email_verified" => email_verified ,
692748 "metadata" => metadata ,
693- "external_id" => external_id
749+ "external_id" => external_id ,
750+ "ip_address" => ip_address ,
751+ "user_agent" => user_agent ,
752+ "signals_id" => signals_id
694753 } . compact
695754 if password
696755 case password
@@ -710,7 +769,7 @@ def create_user(
710769 body : body ,
711770 request_options : request_options
712771 )
713- result = WorkOS ::User . new ( response . body )
772+ result = WorkOS ::UserCreateResponse . new ( response . body )
714773 result . last_response = WorkOS ::Types ::ApiResponse . new ( http_status : response . code . to_i , http_headers : response . each_header . to_h , request_id : response [ "x-request-id" ] )
715774 result
716775 end
@@ -1220,16 +1279,28 @@ def update_jwt_template(
12201279 # Create a Magic Auth code
12211280 # @param email [String] The email address to send the magic code to.
12221281 # @param invitation_token [String, nil] The invitation token to associate with this magic code.
1282+ # @param ip_address [String, nil] The IP address of the user's request.
1283+ # @param user_agent [String, nil] The user agent string from the user's request.
1284+ # @param radar_auth_attempt_id [String, nil] The ID of an existing Radar authentication attempt to associate with this request.
1285+ # @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this request.
12231286 # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
1224- # @return [WorkOS::MagicAuth ]
1287+ # @return [WorkOS::MagicAuthSendMagicAuthCodeAndReturnResponse ]
12251288 def create_magic_auth (
12261289 email :,
12271290 invitation_token : nil ,
1291+ ip_address : nil ,
1292+ user_agent : nil ,
1293+ radar_auth_attempt_id : nil ,
1294+ signals_id : nil ,
12281295 request_options : { }
12291296 )
12301297 body = {
12311298 "email" => email ,
1232- "invitation_token" => invitation_token
1299+ "invitation_token" => invitation_token ,
1300+ "ip_address" => ip_address ,
1301+ "user_agent" => user_agent ,
1302+ "radar_auth_attempt_id" => radar_auth_attempt_id ,
1303+ "signals_id" => signals_id
12331304 } . compact
12341305 response = @client . request (
12351306 method : :post ,
@@ -1238,7 +1309,7 @@ def create_magic_auth(
12381309 body : body ,
12391310 request_options : request_options
12401311 )
1241- result = WorkOS ::MagicAuth . new ( response . body )
1312+ result = WorkOS ::MagicAuthSendMagicAuthCodeAndReturnResponse . new ( response . body )
12421313 result . last_response = WorkOS ::Types ::ApiResponse . new ( http_status : response . code . to_i , http_headers : response . each_header . to_h , request_id : response [ "x-request-id" ] )
12431314 result
12441315 end
0 commit comments