Account API
The Account service allows you to authenticate and manage a user account. You can use the account service to update user information, retrieve the user sessions across different devices, and fetch the user security logs with his or her recent activity.
You can authenticate the user account by using multiple sign-in methods available. Once the user is authenticated, a new session object will be created to allow the user to access his or her private data and settings.
This service also exposes an endpoint to save and read the user preferences as a key-value object. This feature is handy if you want to allow extra customization in your app. Common usage for this feature may include saving the user preferred locale, timezone, or custom app theme.
Account API vs Users API
While the Account API operates in the scope of the current logged-in user and usually using a client-side integration, the Users API is integrated from the server-side and operates in an admin scope with access to all your project users.
Some of the Account API methods are available from the server SDK when you authenticate with JWT. This allows you to perform server-side actions on behalf of your project user.
- Get Account
- Get Account Preferences
- Get Account Sessions
- Get Account Logs
- Get Session By ID
- Update Account Name
- Update Account Password
- Update Account Email
- Update Account Preferences
- Update Account Status
- Delete Account Session
- Update Session (Refresh Tokens)
- Delete All Account Sessions
- Create Password Recovery
- Create Password Recovery (confirmation)
- Create Email Verification
- Create Email Verification (confirmation)
Get Account
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | User Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.get(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.get(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->get();
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.get()
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.get() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.get(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.get() val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.get(new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } }); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let user = try await account.get() print(String(describing: user) }
Get Account Preferences
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Preferences Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.getPrefs(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.getPrefs(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->getPrefs();
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.get_prefs()
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.get_prefs() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.getPrefs(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.getPrefs() val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.getPrefs(new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } }); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let preferences = try await account.getPrefs() print(String(describing: preferences) }
Get Account Sessions
Get currently logged in user list of active sessions across different devices.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Sessions List Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.getSessions(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.getSessions(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->getSessions();
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.get_sessions()
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.get_sessions() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.getSessions(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.getSessions() val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.getSessions(new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } }); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let sessionList = try await account.getSessions() print(String(describing: sessionList) }
Get Account Logs
Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
HTTP Request
Name | Type | Description | |
limit | optional | integer | Maximum number of logs to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request. |
offset | optional | integer | Offset value. The default value is 0. Use this value to manage pagination. learn more about pagination |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Logs List Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.getLogs(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.getLogs(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->getLogs();
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.get_logs()
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.get_logs() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.getLogs( ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.getLogs( ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.getLogs( new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let logList = try await account.getLogs() print(String(describing: logList) }
Get Session By ID
Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
HTTP Request
Name | Type | Description | |
sessionId | required | string | Session ID. Use the string 'current' to get the current device session. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Session Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.getSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.getSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->getSession('[SESSION_ID]');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.get_session('[SESSION_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.get_session(session_id: '[SESSION_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.getSession( sessionId: '[SESSION_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.getSession( sessionId = "[SESSION_ID]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.getSession( sessionId = "[SESSION_ID]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let session = try await account.getSession( sessionId: "[SESSION_ID]" ) print(String(describing: session) }
Update Account Name
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
HTTP Request
Name | Type | Description | |
name | required | string | User name. Max length: 128 chars. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | User Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateName('[NAME]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateName('[NAME]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updateName('[NAME]');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.update_name('[NAME]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.update_name(name: '[NAME]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updateName( name: '[NAME]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.updateName( name = "[NAME]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updateName( name = "[NAME]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let user = try await account.updateName( name: "[NAME]" ) print(String(describing: user) }
Update Account Password
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.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
HTTP Request
Name | Type | Description | |
password | required | string | New user password. Must be at least 8 chars. |
oldPassword | optional | string | Current user password. Must be at least 8 chars. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | User Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updatePassword('password'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updatePassword('password'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updatePassword('password');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.update_password('password')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.update_password(password: 'password') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updatePassword( password: 'password', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.updatePassword( password = "password", ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updatePassword( password = "password", new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let user = try await account.updatePassword( password: "password" ) print(String(describing: user) }
Update Account Email
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.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
HTTP Request
Name | Type | Description | |
required | string | User email. | |
password | required | string | User password. Must be at least 8 chars. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | User Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateEmail('email@example.com', 'password'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateEmail('email@example.com', 'password'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updateEmail('email@example.com', 'password');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.update_email('email@example.com', 'password')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.update_email(email: 'email@example.com', password: 'password') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updateEmail( email: 'email@example.com', password: 'password', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.updateEmail( email = "email@example.com", password = "password" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updateEmail( email = "email@example.com", password = "password" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let user = try await account.updateEmail( email: "email@example.com", password: "password" ) print(String(describing: user) }
Update Account Preferences
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.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
HTTP Request
Name | Type | Description | |
prefs | required | object | Prefs key-value JSON object. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | User Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updatePrefs({}); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updatePrefs({}); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updatePrefs([]);
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.update_prefs({})
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.update_prefs(prefs: {}) puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updatePrefs( prefs: {}, ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.updatePrefs( prefs = mapOf( "a" to "b" ) ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updatePrefs( prefs = mapOf( "a" to "b" ) new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let user = try await account.updatePrefs( prefs: ) print(String(describing: user) }
Update Account Status
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.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | User Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateStatus(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateStatus(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updateStatus();
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.update_status()
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.update_status() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updateStatus(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.updateStatus() val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updateStatus(new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } }); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let user = try await account.updateStatus() print(String(describing: user) }
Delete Account Session
Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the Session ID argument, only the unique session ID provided is deleted.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
Rate Limits
This endpoint is limited to 100 requests in every 60 minutes per IP address. We use rate limits to avoid service abuse by users and as a security practice. Learn more about rate limiting.
HTTP Request
Name | Type | Description | |
sessionId | required | string | Session ID. Use the string 'current' to delete the current device session. |
HTTP Response
Status Code | Content Type | Payload |
204 No Content | - | - |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.deleteSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.deleteSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->deleteSession('[SESSION_ID]');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.delete_session('[SESSION_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.delete_session(session_id: '[SESSION_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.deleteSession( sessionId: '[SESSION_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.deleteSession( sessionId = "[SESSION_ID]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.deleteSession( sessionId = "[SESSION_ID]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let result = try await account.deleteSession( sessionId: "[SESSION_ID]" ) print(String(describing: result) }
Update Session (Refresh Tokens)
Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to "refresh" the access token.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
Rate Limits
This endpoint is limited to 10 requests in every 60 minutes per IP address. We use rate limits to avoid service abuse by users and as a security practice. Learn more about rate limiting.
HTTP Request
Name | Type | Description | |
sessionId | required | string | Session ID. Use the string 'current' to update the current device session. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Session Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updateSession('[SESSION_ID]');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.update_session('[SESSION_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.update_session(session_id: '[SESSION_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updateSession( sessionId: '[SESSION_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.updateSession( sessionId = "[SESSION_ID]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updateSession( sessionId = "[SESSION_ID]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let session = try await account.updateSession( sessionId: "[SESSION_ID]" ) print(String(describing: session) }
Delete All Account Sessions
Delete all sessions from the user account and remove any sessions cookies from the end client.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
Rate Limits
This endpoint is limited to 100 requests in every 60 minutes per IP address. We use rate limits to avoid service abuse by users and as a security practice. Learn more about rate limiting.
HTTP Response
Status Code | Content Type | Payload |
204 No Content | - | - |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.deleteSessions(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.deleteSessions(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->deleteSessions();
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.delete_sessions()
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.delete_sessions() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.deleteSessions(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.deleteSessions() val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.deleteSessions(new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } }); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let result = try await account.deleteSessions() print(String(describing: result) }
Create Password Recovery
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.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
Rate Limits
This endpoint is limited to 10 requests in every 60 minutes per email address and IP address. We use rate limits to avoid service abuse by users and as a security practice. Learn more about rate limiting.
HTTP Request
Name | Type | Description | |
required | string | User email. | |
url | required | 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. |
HTTP Response
Status Code | Content Type | Payload |
201 Created | application/json | Token Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.createRecovery('email@example.com', 'https://example.com'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.createRecovery('email@example.com', 'https://example.com'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->createRecovery('email@example.com', 'https://example.com');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.create_recovery('email@example.com', 'https://example.com')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.create_recovery(email: 'email@example.com', url: 'https://example.com') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.createRecovery( email: 'email@example.com', url: 'https://example.com', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.createRecovery( email = "email@example.com", url = "https://example.com" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.createRecovery( email = "email@example.com", url = "https://example.com" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let token = try await account.createRecovery( email: "email@example.com", url: "https://example.com" ) print(String(describing: token) }
Create Password Recovery (confirmation)
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.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
Rate Limits
This endpoint is limited to 10 requests in every 60 minutes per user account. We use rate limits to avoid service abuse by users and as a security practice. Learn more about rate limiting.
HTTP Request
Name | Type | Description | |
userId | required | string | User ID. |
secret | required | string | Valid reset token. |
password | required | string | New user password. Must be at least 8 chars. |
passwordAgain | required | string | Repeat new user password. Must be at least 8 chars. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Token Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.update_recovery('[USER_ID]', '[SECRET]', 'password', 'password')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.update_recovery(user_id: '[USER_ID]', secret: '[SECRET]', password: 'password', password_again: 'password') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updateRecovery( userId: '[USER_ID]', secret: '[SECRET]', password: 'password', passwordAgain: 'password', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.updateRecovery( userId = "[USER_ID]", secret = "[SECRET]", password = "password", passwordAgain = "password" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updateRecovery( userId = "[USER_ID]", secret = "[SECRET]", password = "password", passwordAgain = "password" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let token = try await account.updateRecovery( userId: "[USER_ID]", secret: "[SECRET]", password: "password", passwordAgain: "password" ) print(String(describing: token) }
Create Email Verification
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.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
Rate Limits
This endpoint is limited to 10 requests in every 60 minutes per user account. We use rate limits to avoid service abuse by users and as a security practice. Learn more about rate limiting.
HTTP Request
Name | Type | Description | |
url | required | 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. |
HTTP Response
Status Code | Content Type | Payload |
201 Created | application/json | Token Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.createVerification('https://example.com'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.createVerification('https://example.com'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->createVerification('https://example.com');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.create_verification('https://example.com')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.create_verification(url: 'https://example.com') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.createVerification( url: 'https://example.com', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.createVerification( url = "https://example.com" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.createVerification( url = "https://example.com" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let token = try await account.createVerification( url: "https://example.com" ) print(String(describing: token) }
Create Email Verification (confirmation)
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.
Authentication
To access this route, init your SDK with your project unique ID and a valid JWT. Using the JWT authentication you will be able to perform API actions on behalf of your user.
Rate Limits
This endpoint is limited to 10 requests in every 60 minutes per user account. We use rate limits to avoid service abuse by users and as a security practice. Learn more about rate limiting.
HTTP Request
Name | Type | Description | |
userId | required | string | User ID. |
secret | required | string | Valid verification token. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Token Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateVerification('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updateVerification('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Account; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updateVerification('[USER_ID]', '[SECRET]');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.update_verification('[USER_ID]', '[SECRET]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Appwrite::Account.new(client) response = account.update_verification(user_id: '[USER_ID]', secret: '[SECRET]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updateVerification( userId: '[USER_ID]', secret: '[SECRET]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.updateVerification( userId = "[USER_ID]", secret = "[SECRET]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Account public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updateVerification( userId = "[USER_ID]", secret = "[SECRET]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let token = try await account.updateVerification( userId: "[USER_ID]", secret: "[SECRET]" ) print(String(describing: token) }