@@ -85,7 +85,7 @@ def create(
8585 Containing the created user information.
8686
8787 Raise:
88- AuthException: raised if update operation fails
88+ AuthException: raised if create operation fails
8989 """
9090 role_names = [] if role_names is None else role_names
9191 user_tenants = [] if user_tenants is None else user_tenants
@@ -158,7 +158,7 @@ def create_test_user(
158158 Containing the created test user information.
159159
160160 Raise:
161- AuthException: raised if update operation fails
161+ AuthException: raised if create operation fails
162162 """
163163 role_names = [] if role_names is None else role_names
164164 user_tenants = [] if user_tenants is None else user_tenants
@@ -324,7 +324,7 @@ def update(
324324 custom_attributes (dict): Optional, set the different custom attributes values of the keys that were previously configured in Descope console app
325325
326326 Raise:
327- AuthException: raised if creation operation fails
327+ AuthException: raised if update operation fails
328328 """
329329 role_names = [] if role_names is None else role_names
330330 user_tenants = [] if user_tenants is None else user_tenants
@@ -362,22 +362,41 @@ def delete(
362362 login_id (str): The login ID of the user to be deleted.
363363
364364 Raise:
365- AuthException: raised if creation operation fails
365+ AuthException: raised if delete operation fails
366366 """
367367 self ._auth .do_post (
368368 MgmtV1 .user_delete_path ,
369369 {"loginId" : login_id },
370370 pswd = self ._auth .management_key ,
371371 )
372372
373+ def delete_by_user_id (
374+ self ,
375+ user_id : str ,
376+ ):
377+ """
378+ Delete an existing user by user ID. IMPORTANT: This action is irreversible. Use carefully.
379+
380+ Args:
381+ user_id (str): The user ID from the user's JWT.
382+
383+ Raise:
384+ AuthException: raised if delete operation fails
385+ """
386+ self ._auth .do_post (
387+ MgmtV1 .user_delete_path ,
388+ {"userId" : user_id },
389+ pswd = self ._auth .management_key ,
390+ )
391+
373392 def delete_all_test_users (
374393 self ,
375394 ):
376395 """
377396 Delete all test users in the project. IMPORTANT: This action is irreversible. Use carefully.
378397
379398 Raise:
380- AuthException: raised if creation operation fails
399+ AuthException: raised if delete operation fails
381400 """
382401 self ._auth .do_delete (
383402 MgmtV1 .user_delete_all_test_users_path ,
@@ -446,7 +465,7 @@ def logout_user(
446465 login_id (str): The login ID of the user to be logged out.
447466
448467 Raise:
449- AuthException: raised if creation operation fails
468+ AuthException: raised if logout operation fails
450469 """
451470 self ._auth .do_post (
452471 MgmtV1 .user_logout_path ,
@@ -465,7 +484,7 @@ def logout_user_by_user_id(
465484 user_id (str): The login ID of the user to be logged out.
466485
467486 Raise:
468- AuthException: raised if creation operation fails
487+ AuthException: raised if logout operation fails
469488 """
470489 self ._auth .do_post (
471490 MgmtV1 .user_logout_path ,
@@ -1069,7 +1088,7 @@ def expire_password(
10691088 Use the `password.send_reset` or `password.replace` methods to reset/replace the password.
10701089
10711090 Args:
1072- login_id (str): The login ID of the user expire the password to.
1091+ login_id (str): The login ID of the user to expire the password to.
10731092
10741093 Raise:
10751094 AuthException: raised if the operation fails
@@ -1081,6 +1100,28 @@ def expire_password(
10811100 )
10821101 return
10831102
1103+ def remove_all_passkeys (
1104+ self ,
1105+ login_id : str ,
1106+ ) -> None :
1107+ """
1108+ Removes all registered passkeys (WebAuthn devices) for the user with the given login ID.
1109+ Note: The user might not be able to login anymore if they have no other authentication
1110+ methods or a verified email/phone.
1111+
1112+ Args:
1113+ login_id (str): The login ID of the user to remove passkeys for.
1114+
1115+ Raise:
1116+ AuthException: raised if the operation fails
1117+ """
1118+ self ._auth .do_post (
1119+ MgmtV1 .user_remove_all_passkeys_path ,
1120+ {"loginId" : login_id },
1121+ pswd = self ._auth .management_key ,
1122+ )
1123+ return
1124+
10841125 def generate_otp_for_test_user (
10851126 self ,
10861127 method : DeliveryMethod ,
0 commit comments