Create User - Lagoon/LagoonSecurity-API GitHub Wiki

New application users can be created associated to a context. If application is configured to not use context all users are created in the same by default. An user can have serveral profiles, which must be in the same context as he is. If no profile is specified the user will be associated to the profile configured as default , which may or may not have active permissions. The option field "ghost" allows the creation of ghost users which are users who don't receive any kind of notification whenever they are activated/deactivated. When the user is created a token is returned, which must than be used to activate the newly created user ( users are create being disabled).

POST /users

If your application is configured to use contexts use:

POST /contexts/{cname}/users

Input Example:

{
    *"login": "user",
    *"email": "[email protected]",
    *"name": "User",
     "ghost":false,
     "profiles": [
         {
             "name": "admin" 
         }
    ]
}

Output Example:

{
     "id": 13,
     "enable": false,
     "ghost": false,
     "login": "user",
     "name": "User",
     "email": "[email protected]",
     "profiles": [{
        "id": 16,
        "description": "admin profile",
        "name": "admin" 
    }],
    "token": "7fcebcdeb9f84a329d84ef56d11ee89a1343212496121" 
}

Note: The token is only returned if an activation URL was specified.

⚠️ **GitHub.com Fallback** ⚠️