[POST] .../v1/user/add
Creates a system user Use this method to create a local system user with login/password credentials and optional profile/additional-field values. The method validates group_id, first_name, login format, password confirmation and Base64 decoding, checks the current request user's user add permission, verifies that the login is free, validates password strength, writes the user, fires user-added side effects and returns new_id. The request body is required; first_name, login, group_id, new_password and new_password_confirm must be provided, login must be 3-15 Latin letters, digits or underscore and password fields must contain the same Base64 value. Missing fields, invalid login or email, duplicate login, denied permission, weak password, additional-field validation errors and database failures are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| active | Boolean | Optional | Indicates whether the user is active. |
| address | String | Optional | User address. |
| can_authorize | Boolean | Optional | Indicates whether the user can authorize in the system. |
| date_of_birth | String | Optional | User birth date. |
| description | String | Optional | User description or note. |
| String | Optional | User email address. | |
| fields | Array of FieldValueAdd | Optional | User additional field values. |
| first_name | String | Required | User first name. |
| group_id | Int64 | Required | User group ID in the system. |
| language_code | String | Optional | User language code. |
| last_name | String | Optional | User last name. |
| login | String | Required | User login. |
| middle_name | String | Optional | User middle name. |
| new_password | String | Required | New user password in Base64. |
| new_password_confirm | String | Required | User password confirmation in Base64. Must match new_password. |
| phones | String | Optional | Additional user phone numbers. |
| sex | String | Optional | User gender. Allowed values: none, male, female. |
Request Example
{
"group_id": 3,
"first_name": "Ivan",
"last_name": "Ivanov",
"middle_name": "Sergeevich",
"sex": "male",
"date_of_birth": "1990-05-12",
"address": "Main street 1",
"phones": "\u002B998901234568",
"email": "ivanov@example.com",
"description": "Store manager",
"login": "ivanov",
"can_authorize": true,
"active": true,
"language_code": "eng",
"new_password": "U2VjdXJlUGFzc3dvcmQhMjM=",
"new_password_confirm": "U2VjdXJlUGFzc3dvcmQhMjM=",
"fields": []
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 17
}
}