Skip to main content
Skip table of contents

Update of a billing user

User update

User update.

PUT api/admin/v1/users/{user}

Parameters

int user, Unique user identifier


array permissions, Array of id permissions (belonging to regular users)

200 OK

Returns the user object

JSON
{
    "id": 5,
    "name": "170500",
    "login": "170500",
    "created_at": "2022-11-16 18:05:06",
    "user_type": "user",
    "cameras": [
        {
            "id": 1,
            "name": "manual MS. 7 - stand 1",
            "status": "inactive",
            "type": "media_server_v2",
            "start_at": null,
            "group_id": 2,
            "top_group_id": 1,
            "order": 0,
            "created_at": "2022-11-16T15:22:00.000000Z",
            "updated_at": "2022-11-16T15:22:14.000000Z",
            "origin": null,
            "group_type": "public",
            "folder_id": null,
            "is_sensitive": false,
            "is_buffer_enabled": false,
            "is_public": 0,
            "count_issues": 0,
            "azimuth": null,
            "location": null,
            "is_user_owner": false,
            "pack_id": null,
            "source": "manual",
            "archive_storage_days": null,
            "is_archive_recording": false,
            "is_increased_reconnect": 0,
            "model_id": null,
            "is_sound_enabled": true,
            "is_need_replace": false,
            "ip": "192.168.204.13",
            "bridge_id": null,
            "uuid": null,
            "deleted_at": null,
            "archive_recording_type": "fulltime",
            "is_auto_create_streams": false,
            "host_id": null,
            "is_enabled": 1,
            "is_editable": true,
            "is_intercom": 1,
            "services_list": {
                "ptz": false,
                "motion_detect": false
            },
            "pivot": {
                "user_id": 5,
                "camera_id": 1,
                "order": 0,
                "name": "manual MS. 7 - stand 1",
                "login_id": 1,
                "is_favorite": 0,
                "status": "blocked"
            },
            "group": {
                "id": 2,
                "parent_id": 1,
                "depth": 1,
                "path_index": 0,
                "name": "manual cameras",
                "is_house": 1,
                "type": "cameras",
                "uuid": null,
                "created_at": "2022-11-16T15:22:00.000000Z",
                "updated_at": "2022-11-17T09:48:10.000000Z",
                "user_id": null,
                "is_legal": 0,
                "cameras_count": 0,
                "short_pretty": "Test cameras, manual cameras",
                "full_pretty": "Test cameras, manual cameras",
                "top_group_id": 1,
                "intercoms_count": 0
            },
            "services": []
        }
    ],
    "subusers": [
        {
            "id": 11,
            "name": "subuser@mail.com",
            "login": "",
            "created_at": "2022-11-16 18:05:07",
            "permissions": [
                {
                    "id": 9,
                    "name": "layouts-store",
                    "display_name": "Creating Layout",
                    "group": "Layouts"
                }
            ]
        }
    ],
    "permissions": [
        {
            "id": 9,
            "name": "layouts-store",
            "display_name": "Creating Layout",
            "group": "Layouts"
        }
    ],
    "billing_info": {
        "data": [
            {
                "login": "login",
                "status": "status",
                "user_type": "user_type",
                "billing_id": "billing_id",
                "billing_extra": {
                    "data": {
                        "key_1": "value_1",
                        "key_2": "value_2",
                        "key_3": "value_3",
                        "key_4": "value_4",
                        "key_5": "value_5",
                        "key_6": "value_6"
                    },
                    "extra": [
                        {
                            "key_1": "value_1",
                            "key_2": "value_2",
                            "key_3": "value_3",
                            "key_4": "value_4",
                            "key_5": "value_5",
                            "key_6": "value_6"
                        }
                    ]
                }
            }
        ]
    },
    "events": [],
    "analytic_license": [
        {
            "type": "analytic_l1",
            "type_pretty": "LIC-XXXX-VA-L1",
            "all": 20,
            "free": 20,
            "used": 0
        },
        {
            "type": "analytic_l2",
            "type_pretty": "LIC-XXXX-VA-L2",
            "all": 20,
            "free": 20,
            "used": 0
        },
        {
            "type": "analytic_l3",
            "type_pretty": "LIC-XXXX-VA-L3",
            "all": 20,
            "free": 20,
            "used": 0
        }
    ],
    "intercoms": [
        {
            "id": 1,
            "title": null,
            "is_online": false,
            "group_id": 4,
            "camera_id": 1,
            "flat_from": 1,
            "flat_to": 41,
            "flat_offset": null,
            "department": 1,
            "department_name": "department_name",
            "department_type": "main",
            "department_type_pretty": "Main entrance",
            "uuid": "9f44078b-0326-4143-a0c2-932a3137ba90",
            "address": "City, street Street 1",
            "created_at": "2022-11-16 18:08:36",
            "updated_at": "2022-11-17 11:27:48",
            "mac": "08:13:c0:00:00:82",
            "vendor": "interconnection",
            "vendor_pretty": "Intercommunication",
            "status": "installed",
            "status_pretty": "Installed",
            "switch": "metakom",
            "switch_pretty": "Metacom",
            "schema": "http",
            "ip": "192.168.18.207",
            "port": 8080,
            "login": "root",
            "password": "123456",
            "commutators_count": 2
        }
    ],
    "intercom_flats": [
        {
            "id": 1,
            "flat": 1,
            "key_count": null,
            "users_count": null,
            "intercom_id": 1,
            "number": "91201692@vgw1.vms.local",
            "landline_number": "+375292769284",
            "is_smartphone_sip_line_available": true,
            "is_landline_sip_line_available": true,
            "is_analog_line_enable": false,
            "is_sip_line_enable": false
        }
    ],
    "intercom_keys": [
        {
            "id": 1,
            "key": "131231",
            "intercom_id": 1,
            "created_at": "2022-11-28 10:58:19",
            "updated_at": "2022-11-28 11:13:25"
        }
    ]
}

401 Unauthorized

Authorization token not sent or not valid

422 Unprocessable Entity

Returns a JSON object with an error.

JSON
{
    "message": "There will be no informative message here",
    "errors": {
        "any_key": [
            "The cause of the error will be described here"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domainapi/admin/v1/users/{user}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "user": 0,
    "permissions": []
}'
PHP
PHP
$data = array (
  'user' => 0,
  'permissions' => 
  array (
  ),
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'PUT',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domainapi/admin/v1/users/{user}', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.