Users API
Theusers module allows you to interact with Wacht User records programmatically from your backend server.
Reading Users
listUsers()
Retrieves a paginated list of all users in your workspace.
getUser(userId)
Retrieves a single user by their unique identifier.
The unique ID of the user to fetch.
getUserByEmail(email)
Retrieves a single user based on an exact email address match.
The exact email address of the user.
Mutating Users
createUser(request)
Provisions a new user into your workspace programmatically. This bypasses typical sign-up flows and automatically verifies specified identifiers if they are marked as such.
updateUser(userId, request)
Update a user’s rudimentary properties or custom metadata.
The unique ID of the user.
deleteUser(userId)
Permanently removes a user and cascades the deletion to their associated sessions, identities, and social connections.
The unique ID of the user to permanently delete.
Managing Identifiers
Users in Wacht can have multiple email addresses and phone numbers. Theusers module exposes methods to manage these relational arrays.
Emails
client.users.listEmails(userId)client.users.addEmail(userId, request)client.users.updateEmail(userId, emailId, request)client.users.deleteEmail(userId, emailId)
Phones
client.users.listPhones(userId)client.users.addPhone(userId, request)client.users.updatePhone(userId, phoneId, request)client.users.deletePhone(userId, phoneId)
Authentication Management
updatePassword(userId, request)
Force an administrative reset of a user’s password.
The user ID.
deleteSocialConnection(userId, connectionId)
Unlinks a connected OAuth provider (like Google or GitHub) from the user’s profile.
The user ID.
The connection identifier to unlink.
