Update a user
|
PATCH /api/v1/billing/user/manage |
This method allows an external system to update a user. The user is identified by id or login. Omitted parameters remain unchanged, except for properties: if omitted, all user attributes are deleted.
{
"id": 1,
"login": "test@mail.com",
"password": "qweasdzxc",
"status": "active",
"billing_info": {
"billing_id": "123123123",
"billing_extra": []
},
"properties": [
{
"type": "phone",
"value": "+80283289362"
}
],
"permissions_to_attach": [
"archives-show",
"archives-download"
],
"permissions_to_detach": [
"archives-preview-download"
],
"session_limits": {
"intercom": 10,
"cctv": 5
}
}
Method parameters
int id required , User ID (required if `login` is omitted). Returns 422 for the ID of an administrator, special user, subuser, deleted user, or system account
string login required , User login (required if `id` is omitted). Returns 422 for the login of an administrator, special user, subuser, deleted user, or system account. The external system sets the login when creating the user; this method cannot change it
string password, New password, up to 100 characters. VMS stores only its hash
bool can_update_password, Whether the user can change their own password
string status, User status: `active` — the user can access VMS; `blocked` — access is denied
array billing_info, Arbitrary object containing user data from the external billing system (for example, `billing_id`, `billing_extra`). Replaces the stored object entirely; an empty value is ignored
array properties, Complete list of user attributes (for example, phone, email, address), up to 10 items. Attributes whose types are omitted are deleted; if this parameter is omitted, all attributes are deleted. Returned in the `billing_properties` response field
array permissions_to_attach, Permission names to grant to the user. Each name must be a user permission from the list in VMS Billing / Settings (billing) / Static data. Video analytics permissions can be added only if video analytics is configured on the platform. Legacy device permission names `bridges`, `bridges-archive`, `camera-agents`, and `camera-agents-archive` are accepted here and in `permissions_to_detach` and mapped to detailed `bridges-*` / `camera-agents-*` permissions
array permissions_to_detach, Permission names to revoke from the user. Each name must be a user permission from the same list
array session_limits, User session limits by module. An omitted module receives a limit of 0; at least one limit must be greater than 0. Any key other than `intercom` or `cctv` is rejected with 422. `null` removes the user's individual limits
|
200 |
|
Returns a user object JSON
|
|
422 |
|
Returns a JSON error object. For more information, see General information > Validation. JSON
|