SDK Dart v2.x

createUser #

Creates a new user.

Copied to clipboard!
Future<KuzzleUser> createUser(String id, 
      Map<String, dynamic> body,
      {bool waitForRefresh})

Property Type Description
User id
Map<String, dynamic>
User content & credentials

If set to true, Kuzzle will not respond until the created user is indexed

If the kuid is null, Kuzzle will generate an ID.

body #

The body property must contain two objects:

  • content: Contains the list of profile ids to attach the user to and potential additional information. At least the profileIds must be supplied. Any other attribute can be added. Make sure to update the user mapping collection to match your custom attributes.
  • credentials: Describes how the new administrator can be authenticated. This object must contain one or more properties, named after the target authentication strategy to use. Each one of these properties are objects containing the credentials information, corresponding to that authentication strategy.


Copied to clipboard!
  'content': {
    'profileIds': [
    'firstName': 'John',
    'lastName': 'Doe'
  'credentials': {
    'local': {
      'username': 'admin',
      'password': 'myPassword'

Resolves #

A User object containing information about the newly created user.

Usage #

Copied to clipboard!
final result = await'jdoe', {
  'content': {
    'profileIds': [ 'default' ]
  'credentials': {
    'local': {
      'username': 'jdoe',
      'password': 'password'
User {
  _id: 'john.doe',
    { profileIds: [ 'default' ],
      firstName: 'John',
      lastName: 'Doe',
      fullName: 'John Doe',
        { author: '-1',
          createdAt: 1561379086534,
          updatedAt: null,
          updater: null } } }