[POST] .../v1/user/edit
Edits user. Use this method to update an existing system user profile, authorization flags, group assignment, internal phone and additional-field values. The method validates id, optional group_id, login format, email, internal_phone length after escaping, protected Administrator flags, checks the current request user's user edit permission, writes the changes, clears active session cache, fires user-edited side effects and returns row_affected. The request body is required, id must be positive, group_id may be 0 to leave it unchanged and user id 1 cannot be deactivated or blocked from authorization. Missing body, invalid id, invalid login or email, invalid group_id, protected Administrator changes, denied permission, duplicate login, 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 FieldValueEdit | Optional | User additional field value changes. |
| first_name | String | Optional | User first name. |
| group_id | Int64 | Optional | User group ID in the system. |
| id | Int64 | Required | System user ID. |
| internal_phone | String | Optional | User internal phone. Applies only to global users. |
| language_code | String | Optional | User language code. |
| last_name | String | Optional | User last name. |
| login | String | Optional | User login. |
| middle_name | String | Optional | User middle name. |
| phones | String | Optional | Additional user phone numbers. |
| sex | String | Optional | User gender. Allowed values: none, male, female. |
Request Example
{
"id": 17,
"first_name": "Ivan",
"last_name": "Ivanov",
"email": "ivanov@example.com",
"internal_phone": "1201",
"active": true,
"can_authorize": true,
"fields": []
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Update | Update operation result. |
Response Example
{
"ok": true,
"result": {
"row_affected": 1,
"ids": []
}
}