Skip to main content
Browse Documentation

Create a user

Created by Alex Pop on 04 Aug 2020

Creates a new user resource from a User object passed as an argument.

create(user: User): Promise<User>

Remarks

Only a member of the System Administrators group can create a user resource.

Example

let user = {    
    "userName": "tdurden",
    "email": "t.turden@fightclub.com",
    "firstname": "Tyler",
    "lastname": "Durden",
    "timezone": "America/New_York",
    "language": "en-US",
    "custom": {
        "department": "Soap sales"
    },
    "credentials": {
        "password": "pr0j3ctM4yh3m"
    }
};

client.security.users.create(user)
    .then(result => {
        console.log('API call result: ', result);
    })
    .catch(error => {
        console.log('API call fetch error: ', error);        
    });