Skip to content

Interface: Users ​

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:18

Properties ​

client ​

client: Client

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:19

Methods ​

create() ​

Call Signature ​

create<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:57

Create a new user.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
email? ​

string

User email.

name? ​

string

User name. Max length: 128 chars.

password? ​

string

Plain text user password. Must be at least 8 chars.

phone? ​

string

Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.

userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

create<Preferences>(userId, email?, phone?, password?, name?): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:76

Create a new user.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

email? ​

string

User email.

phone? ​

string

Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.

password? ​

string

Plain text user password. Must be at least 8 chars.

name? ​

string

User name. Max length: 128 chars.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createArgon2User() ​

Call Signature ​

createArgon2User<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:87

Create a new user. Password provided must be hashed with the Argon2 algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
email ​

string

User email.

name? ​

string

User name. Max length: 128 chars.

password ​

string

User password hashed using Argon2.

userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

createArgon2User<Preferences>(userId, email, password, name?): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:104

Create a new user. Password provided must be hashed with the Argon2 algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

email ​

string

User email.

password ​

string

User password hashed using Argon2.

name? ​

string

User name. Max length: 128 chars.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createBcryptUser() ​

Call Signature ​

createBcryptUser<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:115

Create a new user. Password provided must be hashed with the Bcrypt algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
email ​

string

User email.

name? ​

string

User name. Max length: 128 chars.

password ​

string

User password hashed using Bcrypt.

userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

createBcryptUser<Preferences>(userId, email, password, name?): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:132

Create a new user. Password provided must be hashed with the Bcrypt algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

email ​

string

User email.

password ​

string

User password hashed using Bcrypt.

name? ​

string

User name. Max length: 128 chars.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createJWT() ​

Call Signature ​

createJWT(params): Promise<Jwt>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:437

Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.

Parameters ​
params ​
duration? ​

number

Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.

sessionId? ​

string

Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.

userId ​

string

User ID.

Returns ​

Promise<Jwt>

Throws ​

Call Signature ​

createJWT(userId, sessionId?, duration?): Promise<Jwt>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:452

Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.

Parameters ​
userId ​

string

User ID.

sessionId? ​

string

Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.

duration? ​

number

Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.

Returns ​

Promise<Jwt>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createMD5User() ​

Call Signature ​

createMD5User<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:187

Create a new user. Password provided must be hashed with the MD5 algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
email ​

string

User email.

name? ​

string

User name. Max length: 128 chars.

password ​

string

User password hashed using MD5.

userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

createMD5User<Preferences>(userId, email, password, name?): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:204

Create a new user. Password provided must be hashed with the MD5 algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

email ​

string

User email.

password ​

string

User password hashed using MD5.

name? ​

string

User name. Max length: 128 chars.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createMfaRecoveryCodes() ​

Call Signature ​

createMfaRecoveryCodes(params): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:747

Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in createMfaChallenge method by client SDK.

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​
Deprecated ​

This API has been deprecated since 1.8.0. Please use Users.createMFARecoveryCodes instead.

Call Signature ​

createMfaRecoveryCodes(userId): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:758

Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in createMfaChallenge method by client SDK.

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createMFARecoveryCodes() ​

Call Signature ​

createMFARecoveryCodes(params): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:766

Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in createMfaChallenge method by client SDK.

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​

Call Signature ​

createMFARecoveryCodes(userId): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:777

Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in createMfaChallenge method by client SDK.

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createPHPassUser() ​

Call Signature ​

createPHPassUser<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:215

Create a new user. Password provided must be hashed with the PHPass algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
email ​

string

User email.

name? ​

string

User name. Max length: 128 chars.

password ​

string

User password hashed using PHPass.

userId ​

string

User ID. Choose a custom ID or pass the string ID.unique()to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

createPHPassUser<Preferences>(userId, email, password, name?): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:232

Create a new user. Password provided must be hashed with the PHPass algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID. Choose a custom ID or pass the string ID.unique()to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

email ​

string

User email.

password ​

string

User password hashed using PHPass.

name? ​

string

User name. Max length: 128 chars.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createScryptModifiedUser() ​

Call Signature ​

createScryptModifiedUser<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:289

Create a new user. Password provided must be hashed with the Scrypt Modified algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
email ​

string

User email.

name? ​

string

User name. Max length: 128 chars.

password ​

string

User password hashed using Scrypt Modified.

passwordSalt ​

string

Salt used to hash password.

passwordSaltSeparator ​

string

Salt separator used to hash password.

passwordSignerKey ​

string

Signer key used to hash password.

userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

createScryptModifiedUser<Preferences>(userId, email, password, passwordSalt, passwordSaltSeparator, passwordSignerKey, name?): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:312

Create a new user. Password provided must be hashed with the Scrypt Modified algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

email ​

string

User email.

password ​

string

User password hashed using Scrypt Modified.

passwordSalt ​

string

Salt used to hash password.

passwordSaltSeparator ​

string

Salt separator used to hash password.

passwordSignerKey ​

string

Signer key used to hash password.

name? ​

string

User name. Max length: 128 chars.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createScryptUser() ​

Call Signature ​

createScryptUser<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:248

Create a new user. Password provided must be hashed with the Scrypt algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
email ​

string

User email.

name? ​

string

User name. Max length: 128 chars.

password ​

string

User password hashed using Scrypt.

passwordCpu ​

number

Optional CPU cost used to hash password.

passwordLength ​

number

Optional hash length used to hash password.

passwordMemory ​

number

Optional memory cost used to hash password.

passwordParallel ​

number

Optional parallelization cost used to hash password.

passwordSalt ​

string

Optional salt used to hash password.

userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

createScryptUser<Preferences>(userId, email, password, passwordSalt, passwordCpu, passwordMemory, passwordParallel, passwordLength, name?): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:275

Create a new user. Password provided must be hashed with the Scrypt algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

email ​

string

User email.

password ​

string

User password hashed using Scrypt.

passwordSalt ​

string

Optional salt used to hash password.

passwordCpu ​

number

Optional CPU cost used to hash password.

passwordMemory ​

number

Optional memory cost used to hash password.

passwordParallel ​

number

Optional parallelization cost used to hash password.

passwordLength ​

number

Optional hash length used to hash password.

name? ​

string

User name. Max length: 128 chars.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createSession() ​

Call Signature ​

createSession(params): Promise<Session>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:916

Creates a session for a user. Returns an immediately usable session object.

If you want to generate a token for a custom authentication flow, use the POST /users/{userId}/tokens endpoint.

Parameters ​
params ​
userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

Returns ​

Promise<Session>

Throws ​

Call Signature ​

createSession(userId): Promise<Session>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:929

Creates a session for a user. Returns an immediately usable session object.

If you want to generate a token for a custom authentication flow, use the POST /users/{userId}/tokens endpoint.

Parameters ​
userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

Returns ​

Promise<Session>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createSHAUser() ​

Call Signature ​

createSHAUser<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:324

Create a new user. Password provided must be hashed with the SHA algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
email ​

string

User email.

name? ​

string

User name. Max length: 128 chars.

password ​

string

User password hashed using SHA.

passwordVersion? ​

PasswordHash

Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'

userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

createSHAUser<Preferences>(userId, email, password, passwordVersion?, name?): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:343

Create a new user. Password provided must be hashed with the SHA algorithm. Use the POST /users endpoint to create users with a plain text password.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

email ​

string

User email.

password ​

string

User password hashed using SHA.

passwordVersion? ​

PasswordHash

Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'

name? ​

string

User name. Max length: 128 chars.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createTarget() ​

Call Signature ​

createTarget(params): Promise<Target>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1030

Create a messaging target.

Parameters ​
params ​
identifier ​

string

The target identifier (token, email, phone etc.)

name? ​

string

Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.

providerId? ​

string

Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.

providerType ​

MessagingProviderType

The target provider type. Can be one of the following: email, sms or push.

targetId ​

string

Target ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

userId ​

string

User ID.

Returns ​

Promise<Target>

Throws ​

Call Signature ​

createTarget(userId, targetId, providerType, identifier, providerId?, name?): Promise<Target>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1051

Create a messaging target.

Parameters ​
userId ​

string

User ID.

targetId ​

string

Target ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

providerType ​

MessagingProviderType

The target provider type. Can be one of the following: email, sms or push.

identifier ​

string

The target identifier (token, email, phone etc.)

providerId? ​

string

Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.

name? ​

string

Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.

Returns ​

Promise<Target>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


createToken() ​

Call Signature ​

createToken(params): Promise<Token>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1137

Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the PUT /account/sessions/token endpoint to complete the login process.

Parameters ​
params ​
expire? ​

number

Token expiration period in seconds. The default expiration is 15 minutes.

length? ​

number

Token length in characters. The default length is 6 characters

userId ​

string

User ID.

Returns ​

Promise<Token>

Throws ​

Call Signature ​

createToken(userId, length?, expire?): Promise<Token>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1153

Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the PUT /account/sessions/token endpoint to complete the login process.

Parameters ​
userId ​

string

User ID.

length? ​

number

Token length in characters. The default length is 6 characters

expire? ​

number

Token expiration period in seconds. The default expiration is 15 minutes.

Returns ​

Promise<Token>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


delete() ​

Call Signature ​

delete(params): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:370

Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the updateStatus endpoint instead.

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<{ }>

Throws ​

Call Signature ​

delete(userId): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:381

Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the updateStatus endpoint instead.

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<{ }>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


deleteIdentity() ​

Call Signature ​

deleteIdentity(params): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:165

Delete an identity by its unique ID.

Parameters ​
params ​
identityId ​

string

Identity ID.

Returns ​

Promise<{ }>

Throws ​

Call Signature ​

deleteIdentity(identityId): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:176

Delete an identity by its unique ID.

Parameters ​
identityId ​

string

Identity ID.

Returns ​

Promise<{ }>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


deleteMfaAuthenticator() ​

Call Signature ​

deleteMfaAuthenticator(params): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:586

Delete an authenticator app.

Parameters ​
params ​
type ​

AuthenticatorType

Type of authenticator.

userId ​

string

User ID.

Returns ​

Promise<{ }>

Throws ​
Deprecated ​

This API has been deprecated since 1.8.0. Please use Users.deleteMFAAuthenticator instead.

Call Signature ​

deleteMfaAuthenticator(userId, type): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:599

Delete an authenticator app.

Parameters ​
userId ​

string

User ID.

type ​

AuthenticatorType

Type of authenticator.

Returns ​

Promise<{ }>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


deleteMFAAuthenticator() ​

Call Signature ​

deleteMFAAuthenticator(params): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:608

Delete an authenticator app.

Parameters ​
params ​
type ​

AuthenticatorType

Type of authenticator.

userId ​

string

User ID.

Returns ​

Promise<{ }>

Throws ​

Call Signature ​

deleteMFAAuthenticator(userId, type): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:621

Delete an authenticator app.

Parameters ​
userId ​

string

User ID.

type ​

AuthenticatorType

Type of authenticator.

Returns ​

Promise<{ }>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


deleteSession() ​

Call Signature ​

deleteSession(params): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:957

Delete a user sessions by its unique ID.

Parameters ​
params ​
sessionId ​

string

Session ID.

userId ​

string

User ID.

Returns ​

Promise<{ }>

Throws ​

Call Signature ​

deleteSession(userId, sessionId): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:970

Delete a user sessions by its unique ID.

Parameters ​
userId ​

string

User ID.

sessionId ​

string

Session ID.

Returns ​

Promise<{ }>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


deleteSessions() ​

Call Signature ​

deleteSessions(params): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:937

Delete all user's sessions by using the user's unique ID.

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<{ }>

Throws ​

Call Signature ​

deleteSessions(userId): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:948

Delete all user's sessions by using the user's unique ID.

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<{ }>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


deleteTarget() ​

Call Signature ​

deleteTarget(params): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1113

Delete a messaging target.

Parameters ​
params ​
targetId ​

string

Target ID.

userId ​

string

User ID.

Returns ​

Promise<{ }>

Throws ​

Call Signature ​

deleteTarget(userId, targetId): Promise<{ }>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1126

Delete a messaging target.

Parameters ​
userId ​

string

User ID.

targetId ​

string

Target ID.

Returns ​

Promise<{ }>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


get() ​

Call Signature ​

get<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:351

Get a user by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

get<Preferences>(userId): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:362

Get a user by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


getMfaRecoveryCodes() ​

Call Signature ​

getMfaRecoveryCodes(params): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:669

Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using createMfaRecoveryCodes method.

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​
Deprecated ​

This API has been deprecated since 1.8.0. Please use Users.getMFARecoveryCodes instead.

Call Signature ​

getMfaRecoveryCodes(userId): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:680

Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using createMfaRecoveryCodes method.

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


getMFARecoveryCodes() ​

Call Signature ​

getMFARecoveryCodes(params): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:688

Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using createMfaRecoveryCodes method.

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​

Call Signature ​

getMFARecoveryCodes(userId): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:699

Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using createMfaRecoveryCodes method.

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


getPrefs() ​

Call Signature ​

getPrefs<Preferences>(params): Promise<Preferences>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:851

Get the user preferences by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<Preferences>

Throws ​

Call Signature ​

getPrefs<Preferences>(userId): Promise<Preferences>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:862

Get the user preferences by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<Preferences>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


getTarget() ​

Call Signature ​

getTarget(params): Promise<Target>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1060

Get a user's push notification target by ID.

Parameters ​
params ​
targetId ​

string

Target ID.

userId ​

string

User ID.

Returns ​

Promise<Target>

Throws ​

Call Signature ​

getTarget(userId, targetId): Promise<Target>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1073

Get a user's push notification target by ID.

Parameters ​
userId ​

string

User ID.

targetId ​

string

Target ID.

Returns ​

Promise<Target>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


list() ​

Call Signature ​

list<Preferences>(params?): Promise<UserList<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:30

Get a list of all the project's users. You can use the query params to filter your results.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params? ​
queries? ​

string[]

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator

string

Search term to filter your list results. Max length: 256 chars.

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

Returns ​

Promise<UserList<Preferences>>

Throws ​

Call Signature ​

list<Preferences>(queries?, search?, total?): Promise<UserList<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:45

Get a list of all the project's users. You can use the query params to filter your results.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
queries? ​

string[]

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator

search? ​

string

Search term to filter your list results. Max length: 256 chars.

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

Returns ​

Promise<UserList<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


listIdentities() ​

Call Signature ​

listIdentities(params?): Promise<IdentityList>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:142

Get identities for all users.

Parameters ​
params? ​
queries? ​

string[]

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry

search? ​

string

Search term to filter your list results. Max length: 256 chars.

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

Returns ​

Promise<IdentityList>

Throws ​

Call Signature ​

listIdentities(queries?, search?, total?): Promise<IdentityList>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:157

Get identities for all users.

Parameters ​
queries? ​

string[]

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry

search? ​

string

Search term to filter your list results. Max length: 256 chars.

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

Returns ​

Promise<IdentityList>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


listLogs() ​

Call Signature ​

listLogs(params): Promise<LogList>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:488

Get the user activity logs list by its unique ID.

Parameters ​
params ​
queries? ​

string[]

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Only supported methods are limit and offset

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

userId ​

string

User ID.

Returns ​

Promise<LogList>

Throws ​

Call Signature ​

listLogs(userId, queries?, total?): Promise<LogList>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:503

Get the user activity logs list by its unique ID.

Parameters ​
userId ​

string

User ID.

queries? ​

string[]

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Only supported methods are limit and offset

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

Returns ​

Promise<LogList>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


listMemberships() ​

Call Signature ​

listMemberships(params): Promise<MembershipList>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:514

Get the user membership list by its unique ID.

Parameters ​
params ​
queries? ​

string[]

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles

search? ​

string

Search term to filter your list results. Max length: 256 chars.

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

userId ​

string

User ID.

Returns ​

Promise<MembershipList>

Throws ​

Call Signature ​

listMemberships(userId, queries?, search?, total?): Promise<MembershipList>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:531

Get the user membership list by its unique ID.

Parameters ​
userId ​

string

User ID.

queries? ​

string[]

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles

search? ​

string

Search term to filter your list results. Max length: 256 chars.

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

Returns ​

Promise<MembershipList>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


listMfaFactors() ​

Call Signature ​

listMfaFactors(params): Promise<MfaFactors>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:630

List the factors available on the account to be used as a MFA challange.

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<MfaFactors>

Throws ​
Deprecated ​

This API has been deprecated since 1.8.0. Please use Users.listMFAFactors instead.

Call Signature ​

listMfaFactors(userId): Promise<MfaFactors>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:641

List the factors available on the account to be used as a MFA challange.

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<MfaFactors>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


listMFAFactors() ​

Call Signature ​

listMFAFactors(params): Promise<MfaFactors>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:649

List the factors available on the account to be used as a MFA challange.

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<MfaFactors>

Throws ​

Call Signature ​

listMFAFactors(userId): Promise<MfaFactors>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:660

List the factors available on the account to be used as a MFA challange.

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<MfaFactors>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


listSessions() ​

Call Signature ​

listSessions(params): Promise<SessionList>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:893

Get the user sessions list by its unique ID.

Parameters ​
params ​
total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

userId ​

string

User ID.

Returns ​

Promise<SessionList>

Throws ​

Call Signature ​

listSessions(userId, total?): Promise<SessionList>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:906

Get the user sessions list by its unique ID.

Parameters ​
userId ​

string

User ID.

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

Returns ​

Promise<SessionList>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


listTargets() ​

Call Signature ​

listTargets(params): Promise<TargetList>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1002

List the messaging targets that are associated with a user.

Parameters ​
params ​
queries? ​

string[]

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

userId ​

string

User ID.

Returns ​

Promise<TargetList>

Throws ​

Call Signature ​

listTargets(userId, queries?, total?): Promise<TargetList>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1017

List the messaging targets that are associated with a user.

Parameters ​
userId ​

string

User ID.

queries? ​

string[]

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType

total? ​

boolean

When set to false, the total count returned will be 0 and will not be calculated.

Returns ​

Promise<TargetList>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateEmail() ​

Call Signature ​

updateEmail<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:390

Update the user email by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
email ​

string

User email.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

updateEmail<Preferences>(userId, email): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:403

Update the user email by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

email ​

string

User email.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateEmailVerification() ​

Call Signature ​

updateEmailVerification<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1162

Update the user email verification status by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
emailVerification ​

boolean

User email verification status.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

updateEmailVerification<Preferences>(userId, emailVerification): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1175

Update the user email verification status by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

emailVerification ​

boolean

User email verification status.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateImpersonator() ​

Call Signature ​

updateImpersonator<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:413

Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
impersonator ​

boolean

Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

updateImpersonator<Preferences>(userId, impersonator): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:427

Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

impersonator ​

boolean

Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateLabels() ​

Call Signature ​

updateLabels<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:463

Update the user labels by its unique ID.

Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the Permissions docs for more info.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
labels ​

string[]

Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

updateLabels<Preferences>(userId, labels): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:478

Update the user labels by its unique ID.

Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the Permissions docs for more info.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

labels ​

string[]

Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateMfa() ​

Call Signature ​

updateMfa<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:541

Enable or disable MFA on a user account.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
mfa ​

boolean

Enable or disable MFA.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

This API has been deprecated since 1.8.0. Please use Users.updateMFA instead.

Call Signature ​

updateMfa<Preferences>(userId, mfa): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:554

Enable or disable MFA on a user account.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

mfa ​

boolean

Enable or disable MFA.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateMFA() ​

Call Signature ​

updateMFA<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:563

Enable or disable MFA on a user account.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
mfa ​

boolean

Enable or disable MFA.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

updateMFA<Preferences>(userId, mfa): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:576

Enable or disable MFA on a user account.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

mfa ​

boolean

Enable or disable MFA.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateMfaRecoveryCodes() ​

Call Signature ​

updateMfaRecoveryCodes(params): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:708

Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​
Deprecated ​

This API has been deprecated since 1.8.0. Please use Users.updateMFARecoveryCodes instead.

Call Signature ​

updateMfaRecoveryCodes(userId): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:719

Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateMFARecoveryCodes() ​

Call Signature ​

updateMFARecoveryCodes(params): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:727

Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.

Parameters ​
params ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​

Call Signature ​

updateMFARecoveryCodes(userId): Promise<MfaRecoveryCodes>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:738

Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.

Parameters ​
userId ​

string

User ID.

Returns ​

Promise<MfaRecoveryCodes>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateName() ​

Call Signature ​

updateName<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:786

Update the user name by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
name ​

string

User name. Max length: 128 chars.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

updateName<Preferences>(userId, name): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:799

Update the user name by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

name ​

string

User name. Max length: 128 chars.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updatePassword() ​

Call Signature ​

updatePassword<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:808

Update the user password by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
password ​

string

New user password. Must be at least 8 chars.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

updatePassword<Preferences>(userId, password): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:821

Update the user password by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

password ​

string

New user password. Must be at least 8 chars.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updatePhone() ​

Call Signature ​

updatePhone<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:830

Update the user phone by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
number ​

string

User phone number.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

updatePhone<Preferences>(userId, number): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:843

Update the user phone by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

number ​

string

User phone number.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updatePhoneVerification() ​

Call Signature ​

updatePhoneVerification<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1184

Update the user phone verification status by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
phoneVerification ​

boolean

User phone verification status.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

updatePhoneVerification<Preferences>(userId, phoneVerification): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1197

Update the user phone verification status by its unique ID.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

phoneVerification ​

boolean

User phone verification status.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updatePrefs() ​

Call Signature ​

updatePrefs<Preferences>(params): Promise<Preferences>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:871

Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
prefs ​

object

Prefs key-value JSON object.

userId ​

string

User ID.

Returns ​

Promise<Preferences>

Throws ​

Call Signature ​

updatePrefs<Preferences>(userId, prefs): Promise<Preferences>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:884

Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

prefs ​

object

Prefs key-value JSON object.

Returns ​

Promise<Preferences>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateStatus() ​

Call Signature ​

updateStatus<Preferences>(params): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:979

Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
params ​
status ​

boolean

User Status. To activate the user pass true and to block the user pass false.

userId ​

string

User ID.

Returns ​

Promise<User<Preferences>>

Throws ​

Call Signature ​

updateStatus<Preferences>(userId, status): Promise<User<Preferences>>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:992

Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.

Type Parameters ​
Preferences ​

Preferences extends Preferences = {[key: string]: any; [___default]: true; }

Parameters ​
userId ​

string

User ID.

status ​

boolean

User Status. To activate the user pass true and to block the user pass false.

Returns ​

Promise<User<Preferences>>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.


updateTarget() ​

Call Signature ​

updateTarget(params): Promise<Target>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1085

Update a messaging target.

Parameters ​
params ​
identifier? ​

string

The target identifier (token, email, phone etc.)

name? ​

string

Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.

providerId? ​

string

Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.

targetId ​

string

Target ID.

userId ​

string

User ID.

Returns ​

Promise<Target>

Throws ​

Call Signature ​

updateTarget(userId, targetId, identifier?, providerId?, name?): Promise<Target>

Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/users.d.mts:1104

Update a messaging target.

Parameters ​
userId ​

string

User ID.

targetId ​

string

Target ID.

identifier? ​

string

The target identifier (token, email, phone etc.)

providerId? ​

string

Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.

name? ​

string

Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.

Returns ​

Promise<Target>

Throws ​
Deprecated ​

Use the object parameter style method for a better developer experience.