Create a user
Creates a back-office user and returns 201 with the profile. The username must be unique, the password needs upper and lower case, a digit and a special character, and a 4 to 6 digit PIN is required when enablePin is true.
How to use it
- Pick a roleId from List roles; it must not grant more access than your own role.
- Send a unique username, a strong password, the roleId and, if enablePin is true, a 4 to 6 digit pin.
- The user is created as active unless you send status inactive. Returns 201 with the profile; the password and PIN are stored only as hashes.
BearerAuthAuthorizationBearer <JWT>application/json- body
username*stringSign-in username, 3 to 255 characters. Required and must be unique.
3 <= length <= 255password*stringInitial password. Required. At least 8 characters with upper and lower case letters, a digit and a special character (@$!%*?&._^#).
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&._^#])[A-Za-z\d@$!%*?&._^#]+$8 <= length <= 255roleId*integerRole ID from List roles. Required. You cannot assign a role with more access than your own.
int64enablePin*booleanTrue to let the user also use a numeric PIN. Defaults to false.
pin?|PIN of 4 to 6 digits. Required when enablePin is true.
^\d{4,6}$firstName?|First name, up to 255 characters. Optional.
0 <= length <= 255lastName?|Last name, up to 255 characters. Optional.
0 <= length <= 255email?|Email address. Optional; must be a valid email.
status?|Account status: active or inactive (case-insensitive). Defaults to active.
^(?i)(active|inactive)$OK
*/*- response
status*stringOutcome of the call: SUCCESS when the request worked, ERROR when it did not.
message*stringShort human-readable message describing the result, for logs or display; do not parse it.
data?The user's profile as it now stands. Passwords and PINs are never returned.
curl -X POST 'https://beta.iotoms.com/api/v1/management/users' \ -H 'Content-Type: application/json' \ -d '{ "username": "string", "password": "stringst", "roleId": 0, "enablePin": true}'{ "status": "string", "message": "string", "data": { "userId": 0, "username": "string", "roleId": 0, "enablePin": true, "firstName": "string", "lastName": "string", "email": "string", "passwordUpdatedOn": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "status": "string" }}