Skip to content

Commit 932bd29

Browse files
feat(generated): Add user management operations and models (+1 more) (#513)
Co-authored-by: workos-sdk-automation[bot] <255426317+workos-sdk-automation[bot]@users.noreply.github.com>
1 parent e371582 commit 932bd29

34 files changed

Lines changed: 998 additions & 34 deletions
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
* [#513](https://github.com/workos/workos-ruby/pull/513) feat(generated): regenerate from spec (2 changes)
2+
3+
**Features**
4+
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
5+
* Added model `SendRadarSmsChallenge`
6+
* Added model `SendRadarSmsChallengeResponse`
7+
* Added model `UrnWorkosOAuthGrantTypeRadarEmailChallengeCodeSessionAuthenticateRequest`
8+
* Added model `UrnWorkosOAuthGrantTypeRadarSmsChallengeCodeSessionAuthenticateRequest`
9+
* Added model `MagicAuthSendMagicAuthCodeAndReturnResponse`
10+
* Added model `UserCreateResponse`
11+
* Added `ip_address` to `CreateMagicCodeAndReturn`
12+
* Added `user_agent` to `CreateMagicCodeAndReturn`
13+
* Added `radar_auth_attempt_id` to `CreateMagicCodeAndReturn`
14+
* Added `signals_id` to `CreateMagicCodeAndReturn`
15+
* Added `ip_address` to `CreateUser`
16+
* Added `user_agent` to `CreateUser`
17+
* Added `signals_id` to `CreateUser`
18+
* Added `signals_id` to `AuthorizationCodeSessionAuthenticateRequest`
19+
* Added `signals_id` to `PasswordSessionAuthenticateRequest`
20+
* Added `radar_auth_attempt_id` to `PasswordSessionAuthenticateRequest`
21+
* Added `radar_auth_attempt_id` to `UrnWorkosOAuthGrantTypeMagicAuthCodeSessionAuthenticateRequest`
22+
* Added endpoint `POST /user_management/radar_challenges`
23+
* **[radar](https://workos.com/docs/reference/radar)**:
24+
* Added `signals_id` to `RadarStandaloneAssessRequest`
25+
26+
**Fixes**
27+
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
28+
* Changed request body for `UserManagementAuthentication.authenticate`
29+
* Changed response of `UserManagementUsers.create` from `User` to `UserCreateResponse`
30+
* Changed response of `UserManagementMagicAuth.sendMagicAuthCodeAndReturn` from `MagicAuth` to `MagicAuthSendMagicAuthCodeAndReturnResponse`

.oagen-manifest.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 2,
33
"language": "ruby",
4-
"generatedAt": "2026-07-02T14:59:01.941Z",
4+
"generatedAt": "2026-07-02T17:29:49.181Z",
55
"files": [
66
"lib/workos.rb",
77
"lib/workos/admin_portal.rb",
@@ -560,6 +560,7 @@
560560
"lib/workos/user_management/magic_auth_code_session_authenticate_request.rb",
561561
"lib/workos/user_management/magic_auth_created.rb",
562562
"lib/workos/user_management/magic_auth_created_data.rb",
563+
"lib/workos/user_management/magic_auth_send_magic_auth_code_and_return_response.rb",
563564
"lib/workos/user_management/mfa_totp_session_authenticate_request.rb",
564565
"lib/workos/user_management/organization_selection_session_authenticate_request.rb",
565566
"lib/workos/user_management/password_reset.rb",
@@ -568,12 +569,16 @@
568569
"lib/workos/user_management/password_reset_succeeded.rb",
569570
"lib/workos/user_management/password_reset_succeeded_data.rb",
570571
"lib/workos/user_management/password_session_authenticate_request.rb",
572+
"lib/workos/user_management/radar_email_challenge_code_session_authenticate_request.rb",
573+
"lib/workos/user_management/radar_sms_challenge_code_session_authenticate_request.rb",
571574
"lib/workos/user_management/redirect_uri.rb",
572575
"lib/workos/user_management/refresh_token_session_authenticate_request.rb",
573576
"lib/workos/user_management/resend_user_invite_options.rb",
574577
"lib/workos/user_management/reset_password_response.rb",
575578
"lib/workos/user_management/revoke_session.rb",
576579
"lib/workos/user_management/send_email_change.rb",
580+
"lib/workos/user_management/send_radar_sms_challenge.rb",
581+
"lib/workos/user_management/send_radar_sms_challenge_response.rb",
577582
"lib/workos/user_management/send_verification_email_response.rb",
578583
"lib/workos/user_management/session_created.rb",
579584
"lib/workos/user_management/session_created_data.rb",
@@ -592,6 +597,7 @@
592597
"lib/workos/user_management/user_api_key_updated_data_owner.rb",
593598
"lib/workos/user_management/user_api_key_with_value.rb",
594599
"lib/workos/user_management/user_api_key_with_value_owner.rb",
600+
"lib/workos/user_management/user_create_response.rb",
595601
"lib/workos/user_management/user_created.rb",
596602
"lib/workos/user_management/user_deleted.rb",
597603
"lib/workos/user_management/user_identities_get_item.rb",
@@ -955,6 +961,7 @@
955961
"rbi/workos/magic_auth_code_session_authenticate_request.rbi",
956962
"rbi/workos/magic_auth_created.rbi",
957963
"rbi/workos/magic_auth_created_data.rbi",
964+
"rbi/workos/magic_auth_send_magic_auth_code_and_return_response.rbi",
958965
"rbi/workos/mfa_totp_session_authenticate_request.rbi",
959966
"rbi/workos/multi_factor_auth.rbi",
960967
"rbi/workos/new_connect_application_secret.rbi",
@@ -1030,7 +1037,9 @@
10301037
"rbi/workos/portal_link_response.rbi",
10311038
"rbi/workos/profile.rbi",
10321039
"rbi/workos/radar.rbi",
1040+
"rbi/workos/radar_email_challenge_code_session_authenticate_request.rbi",
10331041
"rbi/workos/radar_list_entry_already_present_response.rbi",
1042+
"rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi",
10341043
"rbi/workos/radar_standalone_assess_request.rbi",
10351044
"rbi/workos/radar_standalone_delete_radar_list_entry_request.rbi",
10361045
"rbi/workos/radar_standalone_response.rbi",
@@ -1055,6 +1064,8 @@
10551064
"rbi/workos/role_updated.rbi",
10561065
"rbi/workos/role_updated_data.rbi",
10571066
"rbi/workos/send_email_change.rbi",
1067+
"rbi/workos/send_radar_sms_challenge.rbi",
1068+
"rbi/workos/send_radar_sms_challenge_response.rbi",
10581069
"rbi/workos/send_verification_email_response.rbi",
10591070
"rbi/workos/session_created.rbi",
10601071
"rbi/workos/session_created_data.rbi",
@@ -1099,6 +1110,7 @@
10991110
"rbi/workos/user_authentication_factor_enroll_response.rbi",
11001111
"rbi/workos/user_consent_option.rbi",
11011112
"rbi/workos/user_consent_option_choice.rbi",
1113+
"rbi/workos/user_create_response.rbi",
11021114
"rbi/workos/user_created.rbi",
11031115
"rbi/workos/user_deleted.rbi",
11041116
"rbi/workos/user_identities_get_item.rbi",
@@ -1175,6 +1187,7 @@
11751187
"test/workos/test_pipes_model_round_trip.rb",
11761188
"test/workos/test_pipes_provider.rb",
11771189
"test/workos/test_radar.rb",
1190+
"test/workos/test_radar_model_round_trip.rb",
11781191
"test/workos/test_shared_model_round_trip.rb",
11791192
"test/workos/test_sso.rb",
11801193
"test/workos/test_user_management.rb",

lib/workos/radar.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def initialize(client)
1616
# @param email [String] The email address of the user making the request.
1717
# @param auth_method [WorkOS::Types::RadarStandaloneAssessRequestAuthMethod] The authentication method being used.
1818
# @param action [WorkOS::Types::RadarStandaloneAssessRequestAction] The action being performed.
19+
# @param signals_id [String, nil] An optional Radar signals ID for the request.
1920
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
2021
# @return [WorkOS::RadarStandaloneResponse]
2122
def create_attempt(
@@ -24,15 +25,17 @@ def create_attempt(
2425
email:,
2526
auth_method:,
2627
action:,
28+
signals_id: nil,
2729
request_options: {}
2830
)
2931
body = {
3032
"ip_address" => ip_address,
3133
"user_agent" => user_agent,
3234
"email" => email,
3335
"auth_method" => auth_method,
34-
"action" => action
35-
}
36+
"action" => action,
37+
"signals_id" => signals_id
38+
}.compact
3639
response = @client.request(
3740
method: :post,
3841
path: "/radar/attempts",

lib/workos/radar/radar_standalone_assess_request.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ class RadarStandaloneAssessRequest < WorkOS::Types::BaseModel
99
user_agent: :user_agent,
1010
email: :email,
1111
auth_method: :auth_method,
12-
action: :action
12+
action: :action,
13+
signals_id: :signals_id
1314
}.freeze
1415

1516
attr_accessor \
1617
:ip_address,
1718
:user_agent,
1819
:email,
1920
:auth_method,
20-
:action
21+
:action,
22+
:signals_id
2123

2224
def initialize(json)
2325
hash = self.class.normalize(json)
@@ -26,6 +28,7 @@ def initialize(json)
2628
@email = hash[:email]
2729
@auth_method = hash[:auth_method]
2830
@action = hash[:action]
31+
@signals_id = hash[:signals_id]
2932
end
3033
end
3134
end

lib/workos/user_management.rb

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

lib/workos/user_management/authorization_code_session_authenticate_request.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ class AuthorizationCodeSessionAuthenticateRequest < WorkOS::Types::BaseModel
1313
invitation_token: :invitation_token,
1414
ip_address: :ip_address,
1515
device_id: :device_id,
16-
user_agent: :user_agent
16+
user_agent: :user_agent,
17+
signals_id: :signals_id
1718
}.freeze
1819

1920
attr_accessor \
@@ -25,7 +26,8 @@ class AuthorizationCodeSessionAuthenticateRequest < WorkOS::Types::BaseModel
2526
:invitation_token,
2627
:ip_address,
2728
:device_id,
28-
:user_agent
29+
:user_agent,
30+
:signals_id
2931

3032
def initialize(json)
3133
hash = self.class.normalize(json)
@@ -38,6 +40,7 @@ def initialize(json)
3840
@ip_address = hash[:ip_address]
3941
@device_id = hash[:device_id]
4042
@user_agent = hash[:user_agent]
43+
@signals_id = hash[:signals_id]
4144
end
4245
end
4346
end

0 commit comments

Comments
 (0)