Create a password reset token for a user and reset the user’s password.
When a user’s password is reset, all of their active sessions are revoked.
const passwordReset = { object: 'password_reset', id: 'password_reset_01HYGDNK5G7FZ4YJFXYXPB5JRW', userId: 'user_01HWWYEH2NPT48X82ZT23K5AX4', email: 'marcelina.davis@example.com', passwordResetToken: 'Z1uX3RbwcIl5fIGJJJCXXisdI', passwordResetUrl: 'https://your-app.com/reset-password?token=Z1uX3RbwcIl5fIGJJJCXXisdI', expiresAt: '2025-07-14T18:00:54.578Z', createdAt: '2025-07-14T17:45:54.578Z', };
interface PasswordResetGet the details of an existing password reset token that can be used to reset a user’s password.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const passwordReset = await workos.userManagement.getPasswordReset( 'password_reset_01HYGDNK5G7FZ4YJFXYXPB5JRW', );
Creates a one-time token that can be used to reset a user’s password.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const passwordReset = await workos.userManagement.createPasswordReset({ email: 'marcelina@example.com', });
Sets a new password using the token query parameter from the link that the user received. Successfully resetting the password will verify a user’s email, if it hasn’t been verified yet.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const { user } = await workos.userManagement.resetPassword({ token: 'stpIJ48IFJt0HhSIqjf8eppe0', newPassword: 'i8uv6g34kd490s', });
userManagement .resetPassword()Parameters Returns object