Skip to Content
🎉 New release with new features and improvements! V0.0.4 Release →

Initialize User

Initialize a new user account with profile data.

This endpoint is for admins to add new users to the system.

POST /api/users/init

To generate a random password, you can use the param ?generatePassword=true.
This will send an email with generated password to the user.

Request Body

{ "email": "user@example.com", "password": null, "roles": ["DEV_USER"], "profile": { "firstName": "first", "lastName": "last" } }
PropertyTypeRequiredDescription
emailstringyesThe email address of the user.
passwordstringnoThe password of the user.
rolesarrayyesThe roles of the user.
profileobjectyesThe profile of the user.

The profile object is customizable; define any fields you want to include in a user’s profile. This allows you to tailor user data storage to your application’s specific requirements.

Generate Password

To generate a random password for the new user, append the query parameter ?generatePassword=true to the endpoint:

POST /api/users/init?generatePassword=true

When generatePassword=true is set, the following will occur:

  • The engine will automatically generate a secure random password for the user.
  • An Activation Email with Password will be sent to the user’s provided email address, containing the generated password.

If generatePassword=true is not set and no password is provided, the user account will be created without a usable password until one is set manually, or via Reset Password flow.

Response

{ "data": [ { "userId": "user-123", "email": "user@example.com", "roles": ["DEV_USER"], "profile": { "firstName": "first", "lastName": "last" } } ], "status": "OK", "code": 200, "timestamp": 1234567890, "meta": {} }

User initialization creates a new user account with the specified profile data and roles. The system will send an Activation Email or Activation Email with Password to the user to notify him.