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.
Register new user accounts with the Create Account, Create Magic URL session, or Create Phone session endpoint. 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's 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
- List Sessions
- List Logs
- Get Session
- Update Name
- Update Password
- Update Email
- Update Phone
- Update Preferences
- Update Status
- Delete Session
- Update OAuth Session (Refresh Tokens)
- Delete Sessions
- Create Password Recovery
- Create Password Recovery (confirmation)
- Create Email Verification
- Create Email Verification (confirmation)
- Create Phone Verification
- Create Phone 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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.get() puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); User result = await account.Get();
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/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 CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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()
-
query { accountGet { _id _createdAt _updatedAt name registration status passwordUpdate email phone emailVerification phoneVerification prefs { data } } }
-
GET /v1/account HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.get_prefs() puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); Preferences result = await account.GetPrefs();
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/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 CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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()
-
query { accountGetPrefs { data } }
-
GET /v1/account/prefs HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
List 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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const promise = account.listSessions(); 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://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.listSessions(); 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://cloud.appwrite.io/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->listSessions();
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.list_sessions()
-
require 'Appwrite' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.list_sessions() puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); SessionList result = await account.ListSessions();
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.listSessions(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account val client = Client(context) .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.listSessions()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.listSessions(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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.listSessions()
-
query { accountListSessions { total sessions { _id _createdAt userId expire provider providerUid providerAccessToken providerAccessTokenExpiry providerRefreshToken ip osCode osName osVersion clientType clientCode clientName clientVersion clientEngine clientEngineVersion deviceName deviceBrand deviceModel countryCode countryName current } } }
-
GET /v1/account/sessions HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
List 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 | |
queries | optional | array | Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Only supported methods are limit and offset |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Logs List Object |
-
const sdk = require('node-appwrite'); // Init SDK const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const promise = account.listLogs(); 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://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.listLogs(); 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://cloud.appwrite.io/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->listLogs();
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) result = account.list_logs()
-
require 'Appwrite' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.list_logs() puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); LogList result = await account.ListLogs();
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.listLogs( ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account val client = Client(context) .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.listLogs( )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.listLogs( new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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.listLogs()
-
query { accountListLogs { total logs { event userId userEmail userName mode ip time osCode osName osVersion clientType clientCode clientName clientVersion clientEngine clientEngineVersion deviceName deviceBrand deviceModel countryCode countryName } } }
-
GET /v1/account/logs HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
Get Session
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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.get_session(session_id: '[SESSION_ID]') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); Session result = await account.GetSession( sessionId: "[SESSION_ID]");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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]" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.getSession( "[SESSION_ID]" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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]" )
-
query { accountGetSession( sessionId: "[SESSION_ID]" ) { _id _createdAt userId expire provider providerUid providerAccessToken providerAccessTokenExpiry providerRefreshToken ip osCode osName osVersion clientType clientCode clientName clientVersion clientEngine clientEngineVersion deviceName deviceBrand deviceModel countryCode countryName current } }
-
GET /v1/account/sessions/{sessionId} HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
Update 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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.update_name(name: '[NAME]') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); User result = await account.UpdateName( name: "[NAME]");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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]" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/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]" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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]" )
-
mutation { accountUpdateName( name: "[NAME]" ) { _id _createdAt _updatedAt name registration status passwordUpdate email phone emailVerification phoneVerification prefs { data } } }
-
PATCH /v1/account/name HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... { "name": "[NAME]" }
Update 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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const promise = account.updatePassword(''); 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://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updatePassword(''); 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://cloud.appwrite.io/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updatePassword('');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/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('')
-
require 'Appwrite' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.update_password(password: '') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); User result = await account.UpdatePassword( password: "");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updatePassword( password: '', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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 = "", )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updatePassword( "", new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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: "" )
-
mutation { accountUpdatePassword( password: "" ) { _id _createdAt _updatedAt name registration status passwordUpdate email phone emailVerification phoneVerification prefs { data } } }
-
PATCH /v1/account/password HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... { "password": , "oldPassword": "password" }
Update 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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.update_email(email: 'email@example.com', password: 'password') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); User result = await account.UpdateEmail( email: "email@example.com", password: "password");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/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@example.com", "password" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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" )
-
mutation { accountUpdateEmail( email: "email@example.com", password: "password" ) { _id _createdAt _updatedAt name registration status passwordUpdate email phone emailVerification phoneVerification prefs { data } } }
-
PATCH /v1/account/email HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... { "email": "email@example.com", "password": "password" }
Update Phone
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.
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 | |
phone | required | string | Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. |
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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const promise = account.updatePhone('+12065550100', '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://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updatePhone('+12065550100', '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://cloud.appwrite.io/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updatePhone('+12065550100', 'password');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/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_phone('+12065550100', 'password')
-
require 'Appwrite' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.update_phone(phone: '+12065550100', password: 'password') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); User result = await account.UpdatePhone( phone: "+12065550100", password: "password");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updatePhone( phone: '+12065550100', password: 'password', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account val client = Client(context) .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.updatePhone( phone = "+12065550100", password = "password" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updatePhone( "+12065550100", "password" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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.updatePhone( phone: "+12065550100", password: "password" )
-
mutation { accountUpdatePhone( phone: "+12065550100", password: "password" ) { _id _createdAt _updatedAt name registration status passwordUpdate email phone emailVerification phoneVerification prefs { data } } }
-
PATCH /v1/account/phone HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... { "phone": "+12065550100", "password": "password" }
Update 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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.update_prefs(prefs: {}) puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); User result = await account.UpdatePrefs( prefs: [object]);
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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" ) )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updatePrefs( mapOf( "a" to "b" ) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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: [:] )
-
mutation { accountUpdatePrefs( prefs: "{}" ) { _id _createdAt _updatedAt name registration status passwordUpdate email phone emailVerification phoneVerification prefs { data } } }
-
PATCH /v1/account/prefs HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... { "prefs": {} }
Update 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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.update_status() puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); User result = await account.UpdateStatus();
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/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 CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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()
-
mutation { accountUpdateStatus { _id _createdAt _updatedAt name registration status passwordUpdate email phone emailVerification phoneVerification prefs { data } } }
-
PATCH /v1/account/status HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
Delete 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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.delete_session(session_id: '[SESSION_ID]') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); await account.DeleteSession( sessionId: "[SESSION_ID]");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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]" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.deleteSession( "[SESSION_ID]" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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]" )
-
mutation { accountDeleteSession( sessionId: "[SESSION_ID]" ) { status } }
-
DELETE /v1/account/sessions/{sessionId} HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
Update OAuth 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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.update_session(session_id: '[SESSION_ID]') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); Session result = await account.UpdateSession( sessionId: "[SESSION_ID]");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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]" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updateSession( "[SESSION_ID]" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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]" )
-
mutation { accountUpdateSession( sessionId: "[SESSION_ID]" ) { _id _createdAt userId expire provider providerUid providerAccessToken providerAccessTokenExpiry providerRefreshToken ip osCode osName osVersion clientType clientCode clientName clientVersion clientEngine clientEngineVersion deviceName deviceBrand deviceModel countryCode countryName current } }
-
PATCH /v1/account/sessions/{sessionId} HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
Delete 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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.delete_sessions() puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); await account.DeleteSessions();
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/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 CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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()
-
mutation { accountDeleteSessions { status } }
-
DELETE /v1/account/sessions HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.create_recovery(email: 'email@example.com', url: 'https://example.com') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); Token result = await account.CreateRecovery( email: "email@example.com", url: "https://example.com");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/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@example.com", "https://example.com" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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" )
-
mutation { accountCreateRecovery( email: "email@example.com", url: "https://example.com" ) { _id _createdAt userId secret expire } }
-
POST /v1/account/recovery HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... { "email": "email@example.com", "url": "https://example.com" }
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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.update_recovery(user_id: '[USER_ID]', secret: '[SECRET]', password: 'password', password_again: 'password') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); Token result = await account.UpdateRecovery( userId: "[USER_ID]", secret: "[SECRET]", password: "password", passwordAgain: "password");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updateRecovery( "[USER_ID]", "[SECRET]", "password", "password" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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" )
-
mutation { accountUpdateRecovery( userId: "[USER_ID]", secret: "[SECRET]", password: "password", passwordAgain: "password" ) { _id _createdAt userId secret expire } }
-
PUT /v1/account/recovery HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... { "userId": "[USER_ID]", "secret": "[SECRET]", "password": "password", "passwordAgain": "password" }
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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.create_verification(url: 'https://example.com') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); Token result = await account.CreateVerification( url: "https://example.com");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.createVerification( "https://example.com" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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" )
-
mutation { accountCreateVerification( url: "https://example.com" ) { _id _createdAt userId secret expire } }
-
POST /v1/account/verification HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... { "url": "https://example.com" }
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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const 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://cloud.appwrite.io/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://cloud.appwrite.io/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://cloud.appwrite.io/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' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.update_verification(user_id: '[USER_ID]', secret: '[SECRET]') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); Token result = await account.UpdateVerification( userId: "[USER_ID]", secret: "[SECRET]");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/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 val client = Client(context) .setEndpoint("https://cloud.appwrite.io/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]" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updateVerification( "[USER_ID]", "[SECRET]" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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]" )
-
mutation { accountUpdateVerification( userId: "[USER_ID]", secret: "[SECRET]" ) { _id _createdAt userId secret expire } }
-
PUT /v1/account/verification HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... { "userId": "[USER_ID]", "secret": "[SECRET]" }
Create Phone Verification
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.
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 Response
Status Code | Content Type | Payload |
201 Created | application/json | Token Object |
-
const sdk = require('node-appwrite'); // Init SDK const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const promise = account.createPhoneVerification(); 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://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.createPhoneVerification(); 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://cloud.appwrite.io/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->createPhoneVerification();
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/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_phone_verification()
-
require 'Appwrite' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.create_phone_verification() puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); Token result = await account.CreatePhoneVerification();
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.createPhoneVerification(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account val client = Client(context) .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.createPhoneVerification()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.createPhoneVerification(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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.createPhoneVerification()
-
mutation { accountCreatePhoneVerification { _id _createdAt userId secret expire } }
-
POST /v1/account/verification/phone HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
Create Phone Verification (confirmation)
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.
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 const client = new sdk.Client(); const account = new sdk.Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; const promise = account.updatePhoneVerification('[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://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; let promise = account.updatePhoneVerification('[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://cloud.appwrite.io/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; $account = new Account($client); $result = $account->updatePhoneVerification('[USER_ID]', '[SECRET]');
-
from appwrite.client import Client from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/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_phone_verification('[USER_ID]', '[SECRET]')
-
require 'Appwrite' include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token account = Account.new(client) response = account.update_phone_verification(user_id: '[USER_ID]', secret: '[SECRET]') puts response.inspect
-
using Appwrite; using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token var account = new Account(client); Token result = await account.UpdatePhoneVerification( userId: "[USER_ID]", secret: "[SECRET]");
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Account account = Account(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; Future result = account.updatePhoneVerification( userId: '[USER_ID]', secret: '[SECRET]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Account val client = Client(context) .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token val account = Account(client) val response = account.updatePhoneVerification( userId = "[USER_ID]", secret = "[SECRET]" )
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token Account account = new Account(client); account.updatePhoneVerification( "[USER_ID]", "[SECRET]" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }) );
-
import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/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.updatePhoneVerification( userId: "[USER_ID]", secret: "[SECRET]" )
-
mutation { accountUpdatePhoneVerification( userId: "[USER_ID]", secret: "[SECRET]" ) { _id _createdAt userId secret expire } }
-
PUT /v1/account/verification/phone HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... { "userId": "[USER_ID]", "secret": "[SECRET]" }