Users with SDKs
You can use Descope management SDK for common user management operations like create user, update user, delete user, etc... The management SDK requires a management key, which can be generated here.
Install SDK
Import and initialize Management SDK
Create User
This operation creates a new user within the project with the details provided. Create
will not send an invite. If you want to send an invite on creation, use Invite User.
Batch Create Users
This operation batch creates (optionally invites) new users within the project with the details provided. Create
will not send an invite. If you want to send an invite on creation, use Invite User.
Invite User
This operation creates a new user within the project with the details provided. This method also sends the invite to the user.
Note
When inviting users from the SDK, the default connector and template configured within Project Settings will be used, unless a different template Id is specified. Currently, when using the Java SDK, only the default connector and template can be used.
Update User
This operation updates an existing user with the details provided. It is important to note that all parameters are used as overrides to the existing user; empty fields will override populated fields.
Load Existing User Details
This operation loads the details of an existing user.
Note
Suppose you frequently load a user for a specific user detail, such as their email address or a particular custom attribute. In that case, you can save execution time and additional API/SDK calls to load the user by adding the items to the custom claim. For details on adding items to the custom claims, see this documentation.
Get User's Login History
Retrieve users' authentication history, by the given user's ids.
Load Existing User's Provider Token
This operation loads the user's access token generated by the OAuth/OIDC provider, using a valid management key. When
querying for OAuth providers, this only applies when utilizing your own account with the provider
and have selected Manage tokens from provider
selected under the social auth methods.
Search Users
This operation returns user details based on the applicable search.
Update a User's Email Address
This operation allows administrators to update a user's email address.
Update a User's Login ID
This operation allows administrators to update a user's Login ID. If you'd like to remove a login ID, provide an empty string for the new login ID.
Update a User's Phone Number
This operation allows administrators to update a user's phone number.
Update a User's Display Name
This operation allows administrators to update a user's display name.
Update a User's Picture
This operation allows administrators to update a user's profile picture granularly without updating all user details.
Update a User's Custom Attributes
This operation allows administrators to update a user's custom attributes granularly without updating all user details.
Expire a User's Password
This operation allows administrators to expire an existing user's password. Upon next login, the user will need to follow the reset password flow.
Set a Temporary User's Password
This operation allows administrators to set a temporary password for an existing user. This will require the user to change their password on next authentication.
Set an Active Password for User
This endpoint allows you to set an active password for an existing user. This will allow the user to authenticate with this password without changing it.
Add a Role to a User
This operation allows administrators to add roles to an existing user.
Set Roles for a User
This endpoint allows you to set a user's roles. This will override the current roles associated to the user and will set all passed roles.
Remove a Role from a User
This operation allows administrators to remove roles from an existing user.
Add a Tenant to a User
This operation allows administrators to add tenants to an existing user.
Remove a Tenant from a User
This operation allows administrators to remove tenants from an existing user.
Add Roles to a User in a Specific Tenant
This operation allows administrators to add roles to a user within a specific tenant.
Set Roles for a User in a Specific Tenant
This operation allows administrators to set roles to a user within a specific tenant. This will override the current roles associated to the user for the tenant and will set all passed roles.
Remove Roles from a User in a Specific Tenant
This operation allows administrators to remove roles from a user within a specific tenant.
Associate an Application to a User
This operation allows administrators to associate an Application with a user.
Set Applications for user
This operation allows administrators to set Applications associated to a user. This will override the current Application associated to the user for the user and set all passed Applications.
Remove an Application from a User
This operation allows administrators to remove an Application from being associated with a user.
Activate User
This operation allows administrators to activate an existing user.
Deactivate User
This operation allows administrators to deactivate an existing user.
Logout All User Sessions
This operation allows administrators to log an existing user out of all sessions. This operation can be done via loginId or userId.
Delete User's Passkeys
This operation will delete all existing passkeys for a user.
Delete User
This operation allows administrators to delete an existing user. It is important to note that this operation is irreversible and the user will be removed and will not be able to be added back without recreation.
Impersonate User
This operation allows administrators to impersonate an existing user. The impersonator user must have the impersonation permission in order for this request to work. The response would be a refresh JWT of the impersonated user.