Interface: Account ​
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:18
Properties ​
client ​
client:
Client
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.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/account.d.mts:38
Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the /account/verfication route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new account session.
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
New user password. Must be between 8 and 256 chars.
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,password,name?):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:55
Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the /account/verfication route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new account session.
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
New user password. Must be between 8 and 256 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.
createAnonymousSession() ​
createAnonymousSession():
Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:610
Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its email and password or create an OAuth2 session.
Returns ​
Promise<Session>
Throws ​
createEmailPasswordSession() ​
Call Signature ​
createEmailPasswordSession(
params):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:621
Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
Parameters ​
params ​
email ​
string
User email.
password ​
string
User password. Must be at least 8 chars.
Returns ​
Promise<Session>
Throws ​
Call Signature ​
createEmailPasswordSession(
password):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:636
Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
Parameters ​
email ​
string
User email.
password ​
string
User password. Must be at least 8 chars.
Returns ​
Promise<Session>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
createEmailToken() ​
Call Signature ​
createEmailToken(
params):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:781
Sends the user an email with a secret key for creating a session. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
Parameters ​
params ​
email ​
string
User email.
phrase? ​
boolean
Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
Returns ​
Promise<Token>
Throws ​
Call Signature ​
createEmailToken(
userId,phrase?):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:799
Sends the user an email with a secret key for creating a session. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
email ​
string
User email.
phrase? ​
boolean
Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
Returns ​
Promise<Token>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
createEmailVerification() ​
Call Signature ​
createEmailVerification(
params):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:906
Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the userId and secret arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the userId and secret parameters. Learn more about how to complete the verification process. The verification link sent to the user's email address is valid for 7 days.
Please note that in order to avoid a Redirect Attack, the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
Parameters ​
params ​
url ​
string
URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
Returns ​
Promise<Token>
Throws ​
Call Signature ​
createEmailVerification(
url):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:920
Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the userId and secret arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the userId and secret parameters. Learn more about how to complete the verification process. The verification link sent to the user's email address is valid for 7 days.
Please note that in order to avoid a Redirect Attack, the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
Parameters ​
url ​
string
URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
Returns ​
Promise<Token>
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/account.d.mts:130
Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
Parameters ​
params? ​
duration? ​
number
Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
Returns ​
Promise<Jwt>
Throws ​
Call Signature ​
createJWT(
duration?):Promise<Jwt>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:141
Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
Parameters ​
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.
createMagicURLToken() ​
Call Signature ​
createMagicURLToken(
params):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:813
Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
Parameters ​
params ​
email ​
string
User email.
phrase? ​
boolean
Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
url? ​
string
URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
userId ​
string
Unique 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
Returns ​
Promise<Token>
Throws ​
Call Signature ​
createMagicURLToken(
userId,url?,phrase?):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:833
Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
Parameters ​
userId ​
string
Unique 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
email ​
string
User email.
url? ​
string
URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
phrase? ​
boolean
Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
Returns ​
Promise<Token>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
createMfaAuthenticator() ​
Call Signature ​
createMfaAuthenticator(
params):Promise<MfaType>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:191
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the verify authenticator method.
Parameters ​
params ​
type ​
AuthenticatorType
Type of authenticator. Must be totp
Returns ​
Promise<MfaType>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.createMFAAuthenticator instead.
Call Signature ​
createMfaAuthenticator(
type):Promise<MfaType>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:202
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the verify authenticator method.
Parameters ​
type ​
AuthenticatorType
Type of authenticator. Must be totp
Returns ​
Promise<MfaType>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
createMFAAuthenticator() ​
Call Signature ​
createMFAAuthenticator(
params):Promise<MfaType>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:210
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the verify authenticator method.
Parameters ​
params ​
type ​
AuthenticatorType
Type of authenticator. Must be totp
Returns ​
Promise<MfaType>
Throws ​
Call Signature ​
createMFAAuthenticator(
type):Promise<MfaType>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:221
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the verify authenticator method.
Parameters ​
type ​
AuthenticatorType
Type of authenticator. Must be totp
Returns ​
Promise<MfaType>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
createMfaChallenge() ​
Call Signature ​
createMfaChallenge(
params):Promise<MfaChallenge>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:314
Begin the process of MFA verification after sign-in. Finish the flow with updateMfaChallenge method.
Parameters ​
params ​
factor ​
AuthenticationFactor
Factor used for verification. Must be one of following: email, phone, totp, recoveryCode.
Returns ​
Promise<MfaChallenge>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.createMFAChallenge instead.
Call Signature ​
createMfaChallenge(
factor):Promise<MfaChallenge>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:325
Begin the process of MFA verification after sign-in. Finish the flow with updateMfaChallenge method.
Parameters ​
factor ​
AuthenticationFactor
Factor used for verification. Must be one of following: email, phone, totp, recoveryCode.
Returns ​
Promise<MfaChallenge>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
createMFAChallenge() ​
Call Signature ​
createMFAChallenge(
params):Promise<MfaChallenge>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:333
Begin the process of MFA verification after sign-in. Finish the flow with updateMfaChallenge method.
Parameters ​
params ​
factor ​
AuthenticationFactor
Factor used for verification. Must be one of following: email, phone, totp, recoveryCode.
Returns ​
Promise<MfaChallenge>
Throws ​
Call Signature ​
createMFAChallenge(
factor):Promise<MfaChallenge>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:344
Begin the process of MFA verification after sign-in. Finish the flow with updateMfaChallenge method.
Parameters ​
factor ​
AuthenticationFactor
Factor used for verification. Must be one of following: email, phone, totp, recoveryCode.
Returns ​
Promise<MfaChallenge>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
createMfaRecoveryCodes() ​
createMfaRecoveryCodes():
Promise<MfaRecoveryCodes>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:427
Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in createMfaChallenge method.
Returns ​
Promise<MfaRecoveryCodes>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.createMFARecoveryCodes instead.
createMFARecoveryCodes() ​
createMFARecoveryCodes():
Promise<MfaRecoveryCodes>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:434
Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in createMfaChallenge method.
Returns ​
Promise<MfaRecoveryCodes>
Throws ​
createOAuth2Token() ​
Call Signature ​
createOAuth2Token(
params):Promise<string>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:848
Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.
If authentication succeeds, userId and secret of a token will be appended to the success URL as query parameters. These can be used to create a new session using the Create session endpoint.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
Parameters ​
params ​
failure? ​
string
URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
provider ​
OAuthProvider
OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
scopes? ​
string[]
A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
success? ​
string
URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
Returns ​
Promise<string>
Throws ​
Call Signature ​
createOAuth2Token(
provider,success?,failure?,scopes?):Promise<string>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:869
Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.
If authentication succeeds, userId and secret of a token will be appended to the success URL as query parameters. These can be used to create a new session using the Create session endpoint.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
Parameters ​
provider ​
OAuthProvider
OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
success? ​
string
URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
failure? ​
string
URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
scopes? ​
string[]
A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
Returns ​
Promise<string>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
createPhoneToken() ​
Call Signature ​
createPhoneToken(
params):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:880
Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
Parameters ​
params ​
phone ​
string
Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
userId ​
string
Unique 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. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.
Returns ​
Promise<Token>
Throws ​
Call Signature ​
createPhoneToken(
userId,phone):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:895
Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
Parameters ​
userId ​
string
Unique 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. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.
phone ​
string
Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
Returns ​
Promise<Token>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
createPhoneVerification() ​
createPhoneVerification():
Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:998
Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the accountUpdatePhone endpoint. Learn more about how to complete the verification process. The verification code sent to the user's phone number is valid for 15 minutes.
Returns ​
Promise<Token>
Throws ​
createRecovery() ​
Call Signature ​
createRecovery(
params):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:547
Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the PUT /account/recovery endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.
Parameters ​
params ​
email ​
string
User email.
url ​
string
URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
Returns ​
Promise<Token>
Throws ​
Call Signature ​
createRecovery(
url):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:560
Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the PUT /account/recovery endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.
Parameters ​
email ​
string
User email.
url ​
string
URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
Returns ​
Promise<Token>
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/account.d.mts:691
Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
Parameters ​
params ​
secret ​
string
Secret of a token generated by login methods. For example, the createMagicURLToken or createPhoneToken methods.
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,secret):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:704
Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
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.
secret ​
string
Secret of a token generated by login methods. For example, the createMagicURLToken or createPhoneToken methods.
Returns ​
Promise<Session>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
createVerification() ​
Call Signature ​
createVerification(
params):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:932
Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the userId and secret arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the userId and secret parameters. Learn more about how to complete the verification process. The verification link sent to the user's email address is valid for 7 days.
Please note that in order to avoid a Redirect Attack, the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
Parameters ​
params ​
url ​
string
URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
Returns ​
Promise<Token>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.createEmailVerification instead.
Call Signature ​
createVerification(
url):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:946
Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the userId and secret arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the userId and secret parameters. Learn more about how to complete the verification process. The verification link sent to the user's email address is valid for 7 days.
Please note that in order to avoid a Redirect Attack, the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
Parameters ​
url ​
string
URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
Returns ​
Promise<Token>
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/account.d.mts:111
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/account.d.mts:122
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/account.d.mts:275
Delete an authenticator for a user by ID.
Parameters ​
params ​
type ​
AuthenticatorType
Type of authenticator.
Returns ​
Promise<{ }>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.deleteMFAAuthenticator instead.
Call Signature ​
deleteMfaAuthenticator(
type):Promise<{ }>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:286
Delete an authenticator for a user by ID.
Parameters ​
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/account.d.mts:294
Delete an authenticator for a user by ID.
Parameters ​
params ​
type ​
AuthenticatorType
Type of authenticator.
Returns ​
Promise<{ }>
Throws ​
Call Signature ​
deleteMFAAuthenticator(
type):Promise<{ }>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:305
Delete an authenticator for a user by ID.
Parameters ​
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/account.d.mts:750
Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use Delete Sessions instead.
Parameters ​
params ​
sessionId ​
string
Session ID. Use the string 'current' to delete the current device session.
Returns ​
Promise<{ }>
Throws ​
Call Signature ​
deleteSession(
sessionId):Promise<{ }>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:761
Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use Delete Sessions instead.
Parameters ​
sessionId ​
string
Session ID. Use the string 'current' to delete the current device session.
Returns ​
Promise<{ }>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
deleteSessions() ​
deleteSessions():
Promise<{ }>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:603
Delete all sessions from the user account and remove any sessions cookies from the end client.
Returns ​
Promise<{ }>
Throws ​
get() ​
get<
Preferences>():Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:27
Get the currently logged in user.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Returns ​
Promise<User<Preferences>>
Throws ​
getMfaRecoveryCodes() ​
getMfaRecoveryCodes():
Promise<MfaRecoveryCodes>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:412
Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using createMfaRecoveryCodes method. An OTP challenge is required to read recovery codes.
Returns ​
Promise<MfaRecoveryCodes>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.getMFARecoveryCodes instead.
getMFARecoveryCodes() ​
getMFARecoveryCodes():
Promise<MfaRecoveryCodes>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:419
Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using createMfaRecoveryCodes method. An OTP challenge is required to read recovery codes.
Returns ​
Promise<MfaRecoveryCodes>
Throws ​
getPrefs() ​
getPrefs<
Preferences>():Promise<Preferences>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:519
Get the preferences as a key-value object for the currently logged in user.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Returns ​
Promise<Preferences>
Throws ​
getSession() ​
Call Signature ​
getSession(
params):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:712
Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
Parameters ​
params ​
sessionId ​
string
Session ID. Use the string 'current' to get the current device session.
Returns ​
Promise<Session>
Throws ​
Call Signature ​
getSession(
sessionId):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:723
Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
Parameters ​
sessionId ​
string
Session ID. Use the string 'current' to get the current device session.
Returns ​
Promise<Session>
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/account.d.mts:90
Get the list of identities for the currently logged in 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, provider, providerUid, providerEmail, providerAccessTokenExpiry
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?,total?):Promise<IdentityList>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:103
Get the list of identities for the currently logged in user.
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
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/account.d.mts:150
Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
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.
Returns ​
Promise<LogList>
Throws ​
Call Signature ​
listLogs(
queries?,total?):Promise<LogList>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:163
Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
Parameters ​
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.
listMfaFactors() ​
listMfaFactors():
Promise<MfaFactors>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:397
List the factors available on the account to be used as a MFA challange.
Returns ​
Promise<MfaFactors>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.listMFAFactors instead.
listMFAFactors() ​
listMFAFactors():
Promise<MfaFactors>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:404
List the factors available on the account to be used as a MFA challange.
Returns ​
Promise<MfaFactors>
Throws ​
listSessions() ​
listSessions():
Promise<SessionList>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:596
Get the list of active sessions across different devices for the currently logged in user.
Returns ​
Promise<SessionList>
Throws ​
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/account.d.mts:66
Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
params ​
email ​
string
User email.
password ​
string
User password. Must be at least 8 chars.
Returns ​
Promise<User<Preferences>>
Throws ​
Call Signature ​
updateEmail<
Preferences>(password):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:81
Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
email ​
string
User email.
password ​
string
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.
updateEmailVerification() ​
Call Signature ​
updateEmailVerification(
params):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:955
Use this endpoint to complete the user email verification process. Use both the userId and secret parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
Parameters ​
params ​
secret ​
string
Valid verification token.
userId ​
string
User ID.
Returns ​
Promise<Token>
Throws ​
Call Signature ​
updateEmailVerification(
userId,secret):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:968
Use this endpoint to complete the user email verification process. Use both the userId and secret parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
Parameters ​
userId ​
string
User ID.
secret ​
string
Valid verification token.
Returns ​
Promise<Token>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updateMagicURLSession() ​
Call Signature ​
updateMagicURLSession(
params):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:646
Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
Parameters ​
params ​
secret ​
string
Valid verification token.
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 ​
This API has been deprecated since 1.6.0. Please use Account.createSession instead.
Call Signature ​
updateMagicURLSession(
userId,secret):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:659
Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
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.
secret ​
string
Valid verification token.
Returns ​
Promise<Session>
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/account.d.mts:171
Enable or disable MFA on an account.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
params ​
mfa ​
boolean
Enable or disable MFA.
Returns ​
Promise<User<Preferences>>
Throws ​
Call Signature ​
updateMFA<
Preferences>(mfa):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:182
Enable or disable MFA on an account.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
mfa ​
boolean
Enable or disable MFA.
Returns ​
Promise<User<Preferences>>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updateMfaAuthenticator() ​
Call Signature ​
updateMfaAuthenticator<
Preferences>(params):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:231
Verify an authenticator app after adding it using the add authenticator method.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
params ​
otp ​
string
Valid verification token.
type ​
AuthenticatorType
Type of authenticator.
Returns ​
Promise<User<Preferences>>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.updateMFAAuthenticator instead.
Call Signature ​
updateMfaAuthenticator<
Preferences>(type,otp):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:244
Verify an authenticator app after adding it using the add authenticator method.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
type ​
AuthenticatorType
Type of authenticator.
otp ​
string
Valid verification token.
Returns ​
Promise<User<Preferences>>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updateMFAAuthenticator() ​
Call Signature ​
updateMFAAuthenticator<
Preferences>(params):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:253
Verify an authenticator app after adding it using the add authenticator method.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
params ​
otp ​
string
Valid verification token.
type ​
AuthenticatorType
Type of authenticator.
Returns ​
Promise<User<Preferences>>
Throws ​
Call Signature ​
updateMFAAuthenticator<
Preferences>(type,otp):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:266
Verify an authenticator app after adding it using the add authenticator method.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
type ​
AuthenticatorType
Type of authenticator.
otp ​
string
Valid verification token.
Returns ​
Promise<User<Preferences>>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updateMfaChallenge() ​
Call Signature ​
updateMfaChallenge(
params):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:354
Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use createMfaChallenge method.
Parameters ​
params ​
challengeId ​
string
ID of the challenge.
otp ​
string
Valid verification token.
Returns ​
Promise<Session>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.updateMFAChallenge instead.
Call Signature ​
updateMfaChallenge(
challengeId,otp):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:367
Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use createMfaChallenge method.
Parameters ​
challengeId ​
string
ID of the challenge.
otp ​
string
Valid verification token.
Returns ​
Promise<Session>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updateMFAChallenge() ​
Call Signature ​
updateMFAChallenge(
params):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:376
Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use createMfaChallenge method.
Parameters ​
params ​
challengeId ​
string
ID of the challenge.
otp ​
string
Valid verification token.
Returns ​
Promise<Session>
Throws ​
Call Signature ​
updateMFAChallenge(
challengeId,otp):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:389
Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use createMfaChallenge method.
Parameters ​
challengeId ​
string
ID of the challenge.
otp ​
string
Valid verification token.
Returns ​
Promise<Session>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updateMfaRecoveryCodes() ​
updateMfaRecoveryCodes():
Promise<MfaRecoveryCodes>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:442
Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method. An OTP challenge is required to regenreate recovery codes.
Returns ​
Promise<MfaRecoveryCodes>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.updateMFARecoveryCodes instead.
updateMFARecoveryCodes() ​
updateMFARecoveryCodes():
Promise<MfaRecoveryCodes>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:449
Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method. An OTP challenge is required to regenreate recovery codes.
Returns ​
Promise<MfaRecoveryCodes>
Throws ​
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/account.d.mts:457
Update currently logged in user account name.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
params ​
name ​
string
User name. Max length: 128 chars.
Returns ​
Promise<User<Preferences>>
Throws ​
Call Signature ​
updateName<
Preferences>(name):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:468
Update currently logged in user account name.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
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/account.d.mts:477
Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
params ​
oldPassword? ​
string
Current user password. Must be at least 8 chars.
password ​
string
New user password. Must be at least 8 chars.
Returns ​
Promise<User<Preferences>>
Throws ​
Call Signature ​
updatePassword<
Preferences>(password,oldPassword?):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:490
Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
password ​
string
New user password. Must be at least 8 chars.
oldPassword? ​
string
Current 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/account.d.mts:499
Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the POST /account/verification/phone endpoint to send a confirmation SMS.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
params ​
password ​
string
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.
Returns ​
Promise<User<Preferences>>
Throws ​
Call Signature ​
updatePhone<
Preferences>(phone,password):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:512
Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the POST /account/verification/phone endpoint to send a confirmation SMS.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Parameters ​
phone ​
string
Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
password ​
string
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.
updatePhoneSession() ​
Call Signature ​
updatePhoneSession(
params):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:669
Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
Parameters ​
params ​
secret ​
string
Valid verification token.
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 ​
This API has been deprecated since 1.6.0. Please use Account.createSession instead.
Call Signature ​
updatePhoneSession(
userId,secret):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:682
Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
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.
secret ​
string
Valid verification token.
Returns ​
Promise<Session>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updatePhoneVerification() ​
Call Signature ​
updatePhoneVerification(
params):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:1007
Use this endpoint to complete the user phone verification process. Use the userId and secret that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
Parameters ​
params ​
secret ​
string
Valid verification token.
userId ​
string
User ID.
Returns ​
Promise<Token>
Throws ​
Call Signature ​
updatePhoneVerification(
userId,secret):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:1020
Use this endpoint to complete the user phone verification process. Use the userId and secret that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
Parameters ​
userId ​
string
User ID.
secret ​
string
Valid verification token.
Returns ​
Promise<Token>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updatePrefs() ​
Call Signature ​
updatePrefs<
Preferences>(params):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:527
Update currently logged in user account preferences. 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 ​
Partial<Preferences>
Prefs key-value JSON object.
Returns ​
Promise<User<Preferences>>
Throws ​
Call Signature ​
updatePrefs<
Preferences>(prefs):Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:538
Update currently logged in user account preferences. 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 ​
prefs ​
Partial<Preferences>
Prefs key-value JSON object.
Returns ​
Promise<User<Preferences>>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updateRecovery() ​
Call Signature ​
updateRecovery(
params):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:572
Use this endpoint to complete the user account password reset. Both the userId and secret arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the POST /account/recovery endpoint.
Please note that in order to avoid a Redirect Attack the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
Parameters ​
params ​
password ​
string
New user password. Must be between 8 and 256 chars.
secret ​
string
Valid reset token.
userId ​
string
User ID.
Returns ​
Promise<Token>
Throws ​
Call Signature ​
updateRecovery(
userId,secret,password):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:589
Use this endpoint to complete the user account password reset. Both the userId and secret arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the POST /account/recovery endpoint.
Please note that in order to avoid a Redirect Attack the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
Parameters ​
userId ​
string
User ID.
secret ​
string
Valid reset token.
password ​
string
New user password. Must be between 8 and 256 chars.
Returns ​
Promise<Token>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updateSession() ​
Call Signature ​
updateSession(
params):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:731
Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.
Parameters ​
params ​
sessionId ​
string
Session ID. Use the string 'current' to update the current device session.
Returns ​
Promise<Session>
Throws ​
Call Signature ​
updateSession(
sessionId):Promise<Session>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:742
Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.
Parameters ​
sessionId ​
string
Session ID. Use the string 'current' to update the current device session.
Returns ​
Promise<Session>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.
updateStatus() ​
updateStatus<
Preferences>():Promise<User<Preferences>>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:768
Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.
Type Parameters ​
Preferences ​
Preferences extends Preferences = {[key: string]: any; [___default]: true; }
Returns ​
Promise<User<Preferences>>
Throws ​
updateVerification() ​
Call Signature ​
updateVerification(
params):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:978
Use this endpoint to complete the user email verification process. Use both the userId and secret parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
Parameters ​
params ​
secret ​
string
Valid verification token.
userId ​
string
User ID.
Returns ​
Promise<Token>
Throws ​
Deprecated ​
This API has been deprecated since 1.8.0. Please use Account.updateEmailVerification instead.
Call Signature ​
updateVerification(
userId,secret):Promise<Token>
Defined in: node_modules/.pnpm/node-appwrite@23.1.0/node_modules/node-appwrite/dist/services/account.d.mts:991
Use this endpoint to complete the user email verification process. Use both the userId and secret parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
Parameters ​
userId ​
string
User ID.
secret ​
string
Valid verification token.
Returns ​
Promise<Token>
Throws ​
Deprecated ​
Use the object parameter style method for a better developer experience.