Docs

Users API


Server integration with  

The Users service allows you to manage your project users. Use this service to search, block, and view your users' info, current sessions, and latest activity logs. You can also use the Users service to edit your users' preferences and personal info.

Users API vs Account API

While the Users API is integrated from the server-side and operates in an admin scope with access to all your project users, the Account API operates in the scope of the current logged in user and usually using a client-side integration.

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.

Create User

POST/v1/users

Create a new user.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

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

email optional string

User email.

phone optional string

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

password optional string

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

name optional string

User name. Max length: 128 chars.

HTTP Response

Status Code Content Type Payload
201  Created application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.create('[USER_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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.create('[USER_ID]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->create('[USER_ID]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.create('[USER_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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.create(user_id: '[USER_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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.Create(
        userId: "[USER_ID]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.create(
        userId: '[USER_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.create(
        userId = "[USER_ID]",
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.create(
        "[USER_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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.create(
        userId: "[USER_ID]"
    )
    
    
  • mutation {
        usersCreate(
            userId: "[USER_ID]"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • POST /v1/users HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "userId": "[USER_ID]",
      "email": "email@example.com",
      "phone": "+12065550100",
      "password": ,
      "name": "[NAME]"
    }
    

Create User with Bcrypt Password

POST/v1/users/bcrypt

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

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

email required string

User email.

password required string

User password hashed using Bcrypt.

name optional string

User name. Max length: 128 chars.

HTTP Response

Status Code Content Type Payload
201  Created application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.createBcryptUser('[USER_ID]', '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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.createBcryptUser('[USER_ID]', 'email@example.com', 'password');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->createBcryptUser('[USER_ID]', 'email@example.com', 'password');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.create_bcrypt_user('[USER_ID]', '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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.create_bcrypt_user(user_id: '[USER_ID]', 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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.CreateBcryptUser(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.createBcryptUser(
        userId: '[USER_ID]',
        email: 'email@example.com',
        password: 'password',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.createBcryptUser(
        userId = "[USER_ID]",
        email = "email@example.com",
        password = "password",
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.createBcryptUser(
        "[USER_ID]",
        "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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.createBcryptUser(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password"
    )
    
    
  • mutation {
        usersCreateBcryptUser(
            userId: "[USER_ID]",
            email: "email@example.com",
            password: "password"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • POST /v1/users/bcrypt HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "userId": "[USER_ID]",
      "email": "email@example.com",
      "password": "password",
      "name": "[NAME]"
    }
    

Create User with MD5 Password

POST/v1/users/md5

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

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

email required string

User email.

password required string

User password hashed using MD5.

name optional string

User name. Max length: 128 chars.

HTTP Response

Status Code Content Type Payload
201  Created application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.createMD5User('[USER_ID]', '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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.createMD5User('[USER_ID]', 'email@example.com', 'password');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->createMD5User('[USER_ID]', 'email@example.com', 'password');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.create_md5_user('[USER_ID]', '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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.create_md5_user(user_id: '[USER_ID]', 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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.CreateMD5User(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.createMD5User(
        userId: '[USER_ID]',
        email: 'email@example.com',
        password: 'password',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.createMD5User(
        userId = "[USER_ID]",
        email = "email@example.com",
        password = "password",
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.createMD5User(
        "[USER_ID]",
        "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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.createMD5User(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password"
    )
    
    
  • mutation {
        usersCreateMD5User(
            userId: "[USER_ID]",
            email: "email@example.com",
            password: "password"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • POST /v1/users/md5 HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "userId": "[USER_ID]",
      "email": "email@example.com",
      "password": "password",
      "name": "[NAME]"
    }
    

Create User with Argon2 Password

POST/v1/users/argon2

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

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

email required string

User email.

password required string

User password hashed using Argon2.

name optional string

User name. Max length: 128 chars.

HTTP Response

Status Code Content Type Payload
201  Created application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.createArgon2User('[USER_ID]', '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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.createArgon2User('[USER_ID]', 'email@example.com', 'password');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->createArgon2User('[USER_ID]', 'email@example.com', 'password');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.create_argon2_user('[USER_ID]', '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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.create_argon2_user(user_id: '[USER_ID]', 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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.CreateArgon2User(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.createArgon2User(
        userId: '[USER_ID]',
        email: 'email@example.com',
        password: 'password',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.createArgon2User(
        userId = "[USER_ID]",
        email = "email@example.com",
        password = "password",
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.createArgon2User(
        "[USER_ID]",
        "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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.createArgon2User(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password"
    )
    
    
  • mutation {
        usersCreateArgon2User(
            userId: "[USER_ID]",
            email: "email@example.com",
            password: "password"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • POST /v1/users/argon2 HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "userId": "[USER_ID]",
      "email": "email@example.com",
      "password": "password",
      "name": "[NAME]"
    }
    

Create User with SHA Password

POST/v1/users/sha

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

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

email required string

User email.

password required string

User password hashed using SHA.

passwordVersion optional string

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

name optional string

User name. Max length: 128 chars.

HTTP Response

Status Code Content Type Payload
201  Created application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.createSHAUser('[USER_ID]', '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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.createSHAUser('[USER_ID]', 'email@example.com', 'password');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->createSHAUser('[USER_ID]', 'email@example.com', 'password');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.create_sha_user('[USER_ID]', '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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.create_sha_user(user_id: '[USER_ID]', 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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.CreateSHAUser(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.createSHAUser(
        userId: '[USER_ID]',
        email: 'email@example.com',
        password: 'password',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.createSHAUser(
        userId = "[USER_ID]",
        email = "email@example.com",
        password = "password",
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.createSHAUser(
        "[USER_ID]",
        "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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.createSHAUser(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password"
    )
    
    
  • mutation {
        usersCreateSHAUser(
            userId: "[USER_ID]",
            email: "email@example.com",
            password: "password"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • POST /v1/users/sha HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "userId": "[USER_ID]",
      "email": "email@example.com",
      "password": "password",
      "passwordVersion": "sha1",
      "name": "[NAME]"
    }
    

Create User with PHPass Password

POST/v1/users/phpass

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

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

email required string

User email.

password required string

User password hashed using PHPass.

name optional string

User name. Max length: 128 chars.

HTTP Response

Status Code Content Type Payload
201  Created application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.createPHPassUser('[USER_ID]', '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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.createPHPassUser('[USER_ID]', 'email@example.com', 'password');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->createPHPassUser('[USER_ID]', 'email@example.com', 'password');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.create_ph_pass_user('[USER_ID]', '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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.create_ph_pass_user(user_id: '[USER_ID]', 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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.CreatePHPassUser(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.createPHPassUser(
        userId: '[USER_ID]',
        email: 'email@example.com',
        password: 'password',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.createPHPassUser(
        userId = "[USER_ID]",
        email = "email@example.com",
        password = "password",
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.createPHPassUser(
        "[USER_ID]",
        "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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.createPHPassUser(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password"
    )
    
    
  • mutation {
        usersCreatePHPassUser(
            userId: "[USER_ID]",
            email: "email@example.com",
            password: "password"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • POST /v1/users/phpass HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "userId": "[USER_ID]",
      "email": "email@example.com",
      "password": "password",
      "name": "[NAME]"
    }
    

Create User with Scrypt Password

POST/v1/users/scrypt

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

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

email required string

User email.

password required string

User password hashed using Scrypt.

passwordSalt required string

Optional salt used to hash password.

passwordCpu required integer

Optional CPU cost used to hash password.

passwordMemory required integer

Optional memory cost used to hash password.

passwordParallel required integer

Optional parallelization cost used to hash password.

passwordLength required integer

Optional hash length used to hash password.

name optional string

User name. Max length: 128 chars.

HTTP Response

Status Code Content Type Payload
201  Created application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.createScryptUser('[USER_ID]', 'email@example.com', 'password', '[PASSWORD_SALT]', null, null, null, null);
    
    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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.createScryptUser('[USER_ID]', 'email@example.com', 'password', '[PASSWORD_SALT]', null, null, null, null);
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->createScryptUser('[USER_ID]', 'email@example.com', 'password', '[PASSWORD_SALT]', null, null, null, null);
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.create_scrypt_user('[USER_ID]', 'email@example.com', 'password', '[PASSWORD_SALT]', None, None, None, None)
    
  • require 'Appwrite'
    
    include Appwrite
    
    client = Client.new
        .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
        .set_project('5df5acd0d48c2') # Your project ID
        .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.create_scrypt_user(user_id: '[USER_ID]', email: 'email@example.com', password: 'password', password_salt: '[PASSWORD_SALT]', password_cpu: null, password_memory: null, password_parallel: null, password_length: null)
    
    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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.CreateScryptUser(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password",
        passwordSalt: "[PASSWORD_SALT]",
        passwordCpu: 0,
        passwordMemory: 0,
        passwordParallel: 0,
        passwordLength: 0);
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.createScryptUser(
        userId: '[USER_ID]',
        email: 'email@example.com',
        password: 'password',
        passwordSalt: '[PASSWORD_SALT]',
        passwordCpu: 0,
        passwordMemory: 0,
        passwordParallel: 0,
        passwordLength: 0,
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.createScryptUser(
        userId = "[USER_ID]",
        email = "email@example.com",
        password = "password",
        passwordSalt = "[PASSWORD_SALT]",
        passwordCpu = 0,
        passwordMemory = 0,
        passwordParallel = 0,
        passwordLength = 0,
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.createScryptUser(
        "[USER_ID]",
        "email@example.com",
        "password",
        "[PASSWORD_SALT]",
        0,
        0,
        0,
        0,
        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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.createScryptUser(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password",
        passwordSalt: "[PASSWORD_SALT]",
        passwordCpu: 0,
        passwordMemory: 0,
        passwordParallel: 0,
        passwordLength: 0
    )
    
    
  • mutation {
        usersCreateScryptUser(
            userId: "[USER_ID]",
            email: "email@example.com",
            password: "password",
            passwordSalt: "[PASSWORD_SALT]",
            passwordCpu: 0,
            passwordMemory: 0,
            passwordParallel: 0,
            passwordLength: 0
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • POST /v1/users/scrypt HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "userId": "[USER_ID]",
      "email": "email@example.com",
      "password": "password",
      "passwordSalt": "[PASSWORD_SALT]",
      "passwordCpu": 0,
      "passwordMemory": 0,
      "passwordParallel": 0,
      "passwordLength": 0,
      "name": "[NAME]"
    }
    

Create User with Scrypt Modified Password

POST/v1/users/scrypt-modified

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

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

email required string

User email.

password required string

User password hashed using Scrypt Modified.

passwordSalt required string

Salt used to hash password.

passwordSaltSeparator required string

Salt separator used to hash password.

passwordSignerKey required string

Signer key used to hash password.

name optional string

User name. Max length: 128 chars.

HTTP Response

Status Code Content Type Payload
201  Created application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.createScryptModifiedUser('[USER_ID]', 'email@example.com', 'password', '[PASSWORD_SALT]', '[PASSWORD_SALT_SEPARATOR]', '[PASSWORD_SIGNER_KEY]');
    
    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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.createScryptModifiedUser('[USER_ID]', 'email@example.com', 'password', '[PASSWORD_SALT]', '[PASSWORD_SALT_SEPARATOR]', '[PASSWORD_SIGNER_KEY]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->createScryptModifiedUser('[USER_ID]', 'email@example.com', 'password', '[PASSWORD_SALT]', '[PASSWORD_SALT_SEPARATOR]', '[PASSWORD_SIGNER_KEY]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.create_scrypt_modified_user('[USER_ID]', 'email@example.com', 'password', '[PASSWORD_SALT]', '[PASSWORD_SALT_SEPARATOR]', '[PASSWORD_SIGNER_KEY]')
    
  • require 'Appwrite'
    
    include Appwrite
    
    client = Client.new
        .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
        .set_project('5df5acd0d48c2') # Your project ID
        .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.create_scrypt_modified_user(user_id: '[USER_ID]', email: 'email@example.com', password: 'password', password_salt: '[PASSWORD_SALT]', password_salt_separator: '[PASSWORD_SALT_SEPARATOR]', password_signer_key: '[PASSWORD_SIGNER_KEY]')
    
    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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.CreateScryptModifiedUser(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password",
        passwordSalt: "[PASSWORD_SALT]",
        passwordSaltSeparator: "[PASSWORD_SALT_SEPARATOR]",
        passwordSignerKey: "[PASSWORD_SIGNER_KEY]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.createScryptModifiedUser(
        userId: '[USER_ID]',
        email: 'email@example.com',
        password: 'password',
        passwordSalt: '[PASSWORD_SALT]',
        passwordSaltSeparator: '[PASSWORD_SALT_SEPARATOR]',
        passwordSignerKey: '[PASSWORD_SIGNER_KEY]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.createScryptModifiedUser(
        userId = "[USER_ID]",
        email = "email@example.com",
        password = "password",
        passwordSalt = "[PASSWORD_SALT]",
        passwordSaltSeparator = "[PASSWORD_SALT_SEPARATOR]",
        passwordSignerKey = "[PASSWORD_SIGNER_KEY]",
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.createScryptModifiedUser(
        "[USER_ID]",
        "email@example.com",
        "password",
        "[PASSWORD_SALT]",
        "[PASSWORD_SALT_SEPARATOR]",
        "[PASSWORD_SIGNER_KEY]",
        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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.createScryptModifiedUser(
        userId: "[USER_ID]",
        email: "email@example.com",
        password: "password",
        passwordSalt: "[PASSWORD_SALT]",
        passwordSaltSeparator: "[PASSWORD_SALT_SEPARATOR]",
        passwordSignerKey: "[PASSWORD_SIGNER_KEY]"
    )
    
    
  • mutation {
        usersCreateScryptModifiedUser(
            userId: "[USER_ID]",
            email: "email@example.com",
            password: "password",
            passwordSalt: "[PASSWORD_SALT]",
            passwordSaltSeparator: "[PASSWORD_SALT_SEPARATOR]",
            passwordSignerKey: "[PASSWORD_SIGNER_KEY]"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • POST /v1/users/scrypt-modified HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "userId": "[USER_ID]",
      "email": "email@example.com",
      "password": "password",
      "passwordSalt": "[PASSWORD_SALT]",
      "passwordSaltSeparator": "[PASSWORD_SALT_SEPARATOR]",
      "passwordSignerKey": "[PASSWORD_SIGNER_KEY]",
      "name": "[NAME]"
    }
    

List Users

GET/v1/users

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.read" scope.

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. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification

search optional string

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

HTTP Response

Status Code Content Type Payload
200  OK application/json Users List Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.list();
    
    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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.list();
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->list();
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.list()
    
  • require 'Appwrite'
    
    include Appwrite
    
    client = Client.new
        .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
        .set_project('5df5acd0d48c2') # Your project ID
        .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.list()
    
    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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    UserList result = await users.List();
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.list(
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.list(
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.list(
        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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let userList = try await users.list()
    
    
  • query {
        usersList {
            total
            users {
                _id
                _createdAt
                _updatedAt
                name
                registration
                status
                passwordUpdate
                email
                phone
                emailVerification
                phoneVerification
                prefs {
                    data
                }
            }
        }
    }
    
  • GET /v1/users HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    

Get User

GET/v1/users/{userId}

Get a user by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.read" scope.

HTTP Request

Name Type Description
userId required string

User ID.

HTTP Response

Status Code Content Type Payload
200  OK application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.get('[USER_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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.get('[USER_ID]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->get('[USER_ID]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.get('[USER_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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.get(user_id: '[USER_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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.Get(
        userId: "[USER_ID]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.get(
        userId: '[USER_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.get(
        userId = "[USER_ID]"
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.get(
        "[USER_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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.get(
        userId: "[USER_ID]"
    )
    
    
  • query {
        usersGet(
            userId: "[USER_ID]"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • GET /v1/users/{userId} HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    

Get User Preferences

GET/v1/users/{userId}/prefs

Get the user preferences by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.read" scope.

HTTP Request

Name Type Description
userId required string

User ID.

HTTP Response

Status Code Content Type Payload
200  OK application/json Preferences Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.getPrefs('[USER_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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.getPrefs('[USER_ID]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->getPrefs('[USER_ID]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.get_prefs('[USER_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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.get_prefs(user_id: '[USER_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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    Preferences result = await users.GetPrefs(
        userId: "[USER_ID]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.getPrefs(
        userId: '[USER_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.getPrefs(
        userId = "[USER_ID]"
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.getPrefs(
        "[USER_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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let preferences = try await users.getPrefs(
        userId: "[USER_ID]"
    )
    
    
  • query {
        usersGetPrefs(
            userId: "[USER_ID]"
        ) {
            data
        }
    }
    
  • GET /v1/users/{userId}/prefs HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    

List User Sessions

GET/v1/users/{userId}/sessions

Get the user sessions list by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.read" scope.

HTTP Request

Name Type Description
userId required string

User ID.

HTTP Response

Status Code Content Type Payload
200  OK application/json Sessions List Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.listSessions('[USER_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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.listSessions('[USER_ID]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->listSessions('[USER_ID]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.list_sessions('[USER_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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.list_sessions(user_id: '[USER_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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    SessionList result = await users.ListSessions(
        userId: "[USER_ID]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.listSessions(
        userId: '[USER_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.listSessions(
        userId = "[USER_ID]"
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.listSessions(
        "[USER_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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let sessionList = try await users.listSessions(
        userId: "[USER_ID]"
    )
    
    
  • query {
        usersListSessions(
            userId: "[USER_ID]"
        ) {
            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/users/{userId}/sessions HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    

List User Memberships

GET/v1/users/{userId}/memberships

Get the user membership list by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.read" scope.

HTTP Request

Name Type Description
userId required string

User ID.

HTTP Response

Status Code Content Type Payload
200  OK application/json Memberships List Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.listMemberships('[USER_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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.listMemberships('[USER_ID]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->listMemberships('[USER_ID]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.list_memberships('[USER_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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.list_memberships(user_id: '[USER_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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    MembershipList result = await users.ListMemberships(
        userId: "[USER_ID]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.listMemberships(
        userId: '[USER_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.listMemberships(
        userId = "[USER_ID]"
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.listMemberships(
        "[USER_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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let membershipList = try await users.listMemberships(
        userId: "[USER_ID]"
    )
    
    
  • query {
        usersListMemberships(
            userId: "[USER_ID]"
        ) {
            total
            memberships {
                _id
                _createdAt
                _updatedAt
                userId
                userName
                userEmail
                teamId
                teamName
                invited
                joined
                confirm
                roles
            }
        }
    }
    
  • GET /v1/users/{userId}/memberships HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    

List User Logs

GET/v1/users/{userId}/logs

Get the user activity logs list by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.read" scope.

HTTP Request

Name Type Description
userId required string

User ID.

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
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.listLogs('[USER_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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.listLogs('[USER_ID]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->listLogs('[USER_ID]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.list_logs('[USER_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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.list_logs(user_id: '[USER_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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    LogList result = await users.ListLogs(
        userId: "[USER_ID]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.listLogs(
        userId: '[USER_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.listLogs(
        userId = "[USER_ID]",
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.listLogs(
        "[USER_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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let logList = try await users.listLogs(
        userId: "[USER_ID]"
    )
    
    
  • query {
        usersListLogs(
            userId: "[USER_ID]"
        ) {
            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/users/{userId}/logs HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    

Update User Status

PATCH/v1/users/{userId}/status

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

status required boolean

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

HTTP Response

Status Code Content Type Payload
200  OK application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.updateStatus('[USER_ID]', false);
    
    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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.updateStatus('[USER_ID]', false);
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->updateStatus('[USER_ID]', false);
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.update_status('[USER_ID]', False)
    
  • require 'Appwrite'
    
    include Appwrite
    
    client = Client.new
        .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
        .set_project('5df5acd0d48c2') # Your project ID
        .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.update_status(user_id: '[USER_ID]', status: false)
    
    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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.UpdateStatus(
        userId: "[USER_ID]",
        status: false);
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.updateStatus(
        userId: '[USER_ID]',
        status: false,
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.updateStatus(
        userId = "[USER_ID]",
        status = false
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.updateStatus(
        "[USER_ID]",
        false
        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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.updateStatus(
        userId: "[USER_ID]",
        status: xfalse
    )
    
    
  • mutation {
        usersUpdateStatus(
            userId: "[USER_ID]",
            status: false
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • PATCH /v1/users/{userId}/status HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "status": false
    }
    

Update Phone Verification

PATCH/v1/users/{userId}/verification/phone

Update the user phone verification status by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

phoneVerification required boolean

User phone verification status.

HTTP Response

Status Code Content Type Payload
200  OK application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.updatePhoneVerification('[USER_ID]', false);
    
    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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.updatePhoneVerification('[USER_ID]', false);
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->updatePhoneVerification('[USER_ID]', false);
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.update_phone_verification('[USER_ID]', False)
    
  • require 'Appwrite'
    
    include Appwrite
    
    client = Client.new
        .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
        .set_project('5df5acd0d48c2') # Your project ID
        .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.update_phone_verification(user_id: '[USER_ID]', phone_verification: false)
    
    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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.UpdatePhoneVerification(
        userId: "[USER_ID]",
        phoneVerification: false);
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.updatePhoneVerification(
        userId: '[USER_ID]',
        phoneVerification: false,
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.updatePhoneVerification(
        userId = "[USER_ID]",
        phoneVerification = false
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.updatePhoneVerification(
        "[USER_ID]",
        false
        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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.updatePhoneVerification(
        userId: "[USER_ID]",
        phoneVerification: xfalse
    )
    
    
  • mutation {
        usersUpdatePhoneVerification(
            userId: "[USER_ID]",
            phoneVerification: false
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • PATCH /v1/users/{userId}/verification/phone HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "phoneVerification": false
    }
    

Update Name

PATCH/v1/users/{userId}/name

Update the user name by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

name required string

User name. Max length: 128 chars.

HTTP Response

Status Code Content Type Payload
200  OK application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.updateName('[USER_ID]', '[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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.updateName('[USER_ID]', '[NAME]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->updateName('[USER_ID]', '[NAME]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.update_name('[USER_ID]', '[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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.update_name(user_id: '[USER_ID]', 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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.UpdateName(
        userId: "[USER_ID]",
        name: "[NAME]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.updateName(
        userId: '[USER_ID]',
        name: '[NAME]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.updateName(
        userId = "[USER_ID]",
        name = "[NAME]"
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.updateName(
        "[USER_ID]",
        "[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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.updateName(
        userId: "[USER_ID]",
        name: "[NAME]"
    )
    
    
  • mutation {
        usersUpdateName(
            userId: "[USER_ID]",
            name: "[NAME]"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • PATCH /v1/users/{userId}/name HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "name": "[NAME]"
    }
    

Update Password

PATCH/v1/users/{userId}/password

Update the user password by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

password required string

New user password. Must be at least 8 chars.

HTTP Response

Status Code Content Type Payload
200  OK application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.updatePassword('[USER_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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.updatePassword('[USER_ID]', '');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->updatePassword('[USER_ID]', '');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.update_password('[USER_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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.update_password(user_id: '[USER_ID]', 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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.UpdatePassword(
        userId: "[USER_ID]",
        password: "");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.updatePassword(
        userId: '[USER_ID]',
        password: '',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.updatePassword(
        userId = "[USER_ID]",
        password = ""
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.updatePassword(
        "[USER_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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.updatePassword(
        userId: "[USER_ID]",
        password: ""
    )
    
    
  • mutation {
        usersUpdatePassword(
            userId: "[USER_ID]",
            password: ""
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • PATCH /v1/users/{userId}/password HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "password": 
    }
    

Update Email

PATCH/v1/users/{userId}/email

Update the user email by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

email required string

User email.

HTTP Response

Status Code Content Type Payload
200  OK application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.updateEmail('[USER_ID]', 'email@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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.updateEmail('[USER_ID]', 'email@example.com');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->updateEmail('[USER_ID]', 'email@example.com');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.update_email('[USER_ID]', 'email@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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.update_email(user_id: '[USER_ID]', email: 'email@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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.UpdateEmail(
        userId: "[USER_ID]",
        email: "email@example.com");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.updateEmail(
        userId: '[USER_ID]',
        email: 'email@example.com',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.updateEmail(
        userId = "[USER_ID]",
        email = "email@example.com"
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.updateEmail(
        "[USER_ID]",
        "email@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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.updateEmail(
        userId: "[USER_ID]",
        email: "email@example.com"
    )
    
    
  • mutation {
        usersUpdateEmail(
            userId: "[USER_ID]",
            email: "email@example.com"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • PATCH /v1/users/{userId}/email HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "email": "email@example.com"
    }
    

Update Phone

PATCH/v1/users/{userId}/phone

Update the user phone by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

number required string

User phone number.

HTTP Response

Status Code Content Type Payload
200  OK application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.updatePhone('[USER_ID]', '+12065550100');
    
    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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.updatePhone('[USER_ID]', '+12065550100');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->updatePhone('[USER_ID]', '+12065550100');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.update_phone('[USER_ID]', '+12065550100')
    
  • require 'Appwrite'
    
    include Appwrite
    
    client = Client.new
        .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
        .set_project('5df5acd0d48c2') # Your project ID
        .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.update_phone(user_id: '[USER_ID]', number: '+12065550100')
    
    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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.UpdatePhone(
        userId: "[USER_ID]",
        number: "+12065550100");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.updatePhone(
        userId: '[USER_ID]',
        number: '+12065550100',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.updatePhone(
        userId = "[USER_ID]",
        number = "+12065550100"
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.updatePhone(
        "[USER_ID]",
        "+12065550100"
        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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.updatePhone(
        userId: "[USER_ID]",
        number: "+12065550100"
    )
    
    
  • mutation {
        usersUpdatePhone(
            userId: "[USER_ID]",
            number: "+12065550100"
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • PATCH /v1/users/{userId}/phone HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "number": "+12065550100"
    }
    

Update Email Verification

PATCH/v1/users/{userId}/verification

Update the user email verification status by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

emailVerification required boolean

User email verification status.

HTTP Response

Status Code Content Type Payload
200  OK application/json User Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.updateEmailVerification('[USER_ID]', false);
    
    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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.updateEmailVerification('[USER_ID]', false);
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->updateEmailVerification('[USER_ID]', false);
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.update_email_verification('[USER_ID]', False)
    
  • require 'Appwrite'
    
    include Appwrite
    
    client = Client.new
        .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
        .set_project('5df5acd0d48c2') # Your project ID
        .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.update_email_verification(user_id: '[USER_ID]', email_verification: false)
    
    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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    User result = await users.UpdateEmailVerification(
        userId: "[USER_ID]",
        emailVerification: false);
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.updateEmailVerification(
        userId: '[USER_ID]',
        emailVerification: false,
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.updateEmailVerification(
        userId = "[USER_ID]",
        emailVerification = false
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.updateEmailVerification(
        "[USER_ID]",
        false
        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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let user = try await users.updateEmailVerification(
        userId: "[USER_ID]",
        emailVerification: xfalse
    )
    
    
  • mutation {
        usersUpdateEmailVerification(
            userId: "[USER_ID]",
            emailVerification: false
        ) {
            _id
            _createdAt
            _updatedAt
            name
            registration
            status
            passwordUpdate
            email
            phone
            emailVerification
            phoneVerification
            prefs {
                data
            }
        }
    }
    
  • PATCH /v1/users/{userId}/verification HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "emailVerification": false
    }
    

Update User Preferences

PATCH/v1/users/{userId}/prefs

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

prefs required object

Prefs key-value JSON object.

HTTP Response

Status Code Content Type Payload
200  OK application/json Preferences Object
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.updatePrefs('[USER_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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.updatePrefs('[USER_ID]', {});
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->updatePrefs('[USER_ID]', []);
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.update_prefs('[USER_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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.update_prefs(user_id: '[USER_ID]', 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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    Preferences result = await users.UpdatePrefs(
        userId: "[USER_ID]",
        prefs: [object]);
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.updatePrefs(
        userId: '[USER_ID]',
        prefs: {},
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.updatePrefs(
        userId = "[USER_ID]",
        prefs = mapOf( "a" to "b" )
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.updatePrefs(
        "[USER_ID]",
        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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let preferences = try await users.updatePrefs(
        userId: "[USER_ID]",
        prefs: [:]
    )
    
    
  • mutation {
        usersUpdatePrefs(
            userId: "[USER_ID]",
            prefs: "{}"
        ) {
            data
        }
    }
    
  • PATCH /v1/users/{userId}/prefs HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    {
      "prefs": {}
    }
    

Delete User Session

DELETE/v1/users/{userId}/sessions/{sessionId}

Delete a user sessions by its unique ID.

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

sessionId required string

Session ID.

HTTP Response

Status Code Content Type Payload
204  No Content - -
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.deleteSession('[USER_ID]', '[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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.deleteSession('[USER_ID]', '[SESSION_ID]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->deleteSession('[USER_ID]', '[SESSION_ID]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.delete_session('[USER_ID]', '[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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.delete_session(user_id: '[USER_ID]', 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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    await users.DeleteSession(
        userId: "[USER_ID]",
        sessionId: "[SESSION_ID]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.deleteSession(
        userId: '[USER_ID]',
        sessionId: '[SESSION_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.deleteSession(
        userId = "[USER_ID]",
        sessionId = "[SESSION_ID]"
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.deleteSession(
        "[USER_ID]",
        "[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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let result = try await users.deleteSession(
        userId: "[USER_ID]",
        sessionId: "[SESSION_ID]"
    )
    
    
  • mutation {
        usersDeleteSession(
            userId: "[USER_ID]",
            sessionId: "[SESSION_ID]"
        ) {
            status
        }
    }
    
  • DELETE /v1/users/{userId}/sessions/{sessionId} HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    

Delete User Sessions

DELETE/v1/users/{userId}/sessions

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

HTTP Response

Status Code Content Type Payload
204  No Content - -
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.deleteSessions('[USER_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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.deleteSessions('[USER_ID]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->deleteSessions('[USER_ID]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.delete_sessions('[USER_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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.delete_sessions(user_id: '[USER_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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    await users.DeleteSessions(
        userId: "[USER_ID]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.deleteSessions(
        userId: '[USER_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.deleteSessions(
        userId = "[USER_ID]"
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.deleteSessions(
        "[USER_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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let result = try await users.deleteSessions(
        userId: "[USER_ID]"
    )
    
    
  • mutation {
        usersDeleteSessions(
            userId: "[USER_ID]"
        ) {
            status
        }
    }
    
  • DELETE /v1/users/{userId}/sessions HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2
    
    

Delete User

DELETE/v1/users/{userId}

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

Authentication

To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is create with the "users.write" scope.

HTTP Request

Name Type Description
userId required string

User ID.

HTTP Response

Status Code Content Type Payload
204  No Content - -
Example Request
  • const sdk = require('node-appwrite');
    
    // Init SDK
    const client = new sdk.Client();
    
    const users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    const promise = users.delete('[USER_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 users = new sdk.Users(client);
    
    client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    
    let promise = users.delete('[USER_ID]');
    
    promise.then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
  • <?php
    
    use Appwrite\Client;
    use Appwrite\Services\Users;
    
    $client = new Client();
    
    $client
        ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        ->setProject('5df5acd0d48c2') // Your project ID
        ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
    ;
    
    $users = new Users($client);
    
    $result = $users->delete('[USER_ID]');
  • from appwrite.client import Client
    from appwrite.services.users import Users
    
    client = Client()
    
    (client
      .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
      .set_project('5df5acd0d48c2') # Your project ID
      .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    )
    
    users = Users(client)
    
    result = users.delete('[USER_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_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
    
    users = Users.new(client)
    
    response = users.delete(user_id: '[USER_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
        .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    var users = new Users(client);
    
    await users.Delete(
        userId: "[USER_ID]");
  • import 'package:dart_appwrite/dart_appwrite.dart';
    
    void main() { // Init SDK
      Client client = Client();
      Users users = Users(client);
    
      client
        .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
        .setProject('5df5acd0d48c2') // Your project ID
        .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      ;
    
      Future result = users.delete(
        userId: '[USER_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • import io.appwrite.Client
    import io.appwrite.services.Users
    
    val client = Client(context)
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    val users = Users(client)
    
    val response = users.delete(
        userId = "[USER_ID]"
    )
    
  • import io.appwrite.Client;
    import io.appwrite.coroutines.CoroutineCallback;
    import io.appwrite.services.Users;
    
    Client client = new Client()
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
    
    Users users = new Users(client);
    
    users.delete(
        "[USER_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
        .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    
    let users = Users(client)
    
    let result = try await users.delete(
        userId: "[USER_ID]"
    )
    
    
  • mutation {
        usersDelete(
            userId: "[USER_ID]"
        ) {
            status
        }
    }
    
  • DELETE /v1/users/{userId} HTTP/1.1
    Host: HOSTNAME
    Content-Type: application/json
    X-Appwrite-Response-Format: 1.0.0
    X-Appwrite-Project: 5df5acd0d48c2
    X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2