Skip to main content
Skip table of contents

Temporary user update

Temporary user update

When updating users, the parameters cameras_to_attach and cameras_to_detach should only be sent when something has changed, and only the camera IDs that have been added or removed at the moment should be included. When adding or removing a large number of cameras, multiple requests will be required because a single request can only contain up to 500 cameras.

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

Method parameters

int user, unique identifier of the temporary user


string name, name


string login, unique login among other administrators


string password, password


string password_confirmation, re-enter the password to ensure it is entered correctly


array permissions, array of permission IDs


array cameras_to_attach, array of camera IDs to be added to the user. Maximum 500 elements


array cameras_to_detach, array of camera IDs to be removed from the user. Maximum 500 elements


date expired_at, date until which the temporary user will be valid


int ptz_priority, PTZ priority

200 OK

Returns the temporary user object

JSON
{
    "id": 117,
    "name": "user",
    "login": "user@mail.com",
    "created_at": "2022-05-11 18:40:46",
    "updated_at": "2022-05-11 18:40:46",
    "expired_at": null,
    "is_licence_limit_reached": false,
    "permissions": [
        {
            "id": 153,
            "name": "packs-destroy",
            "display_name": "Name",
            "group": "Group"
        }
    ],
    "ptz_priority": null,
    "admin_camera_groups": [],
    "dhcp_subnet_groups": [],
    "access_token_id": null
}

401 Unauthorized

Authorization token is not provided or is invalid

402 Payment Required

Exceeded the license limit for the selected analytics case

422 Unprocessable Entity

Returns a JSON object with an error. Validation

JSON
{
    "message": "There will be no informative message here",
    "errors": {
        "any_key": [
            "The reason for the error will be described here"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domainapi/admin/v1/special-users/{user}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "user": 0,
    "name": "string",
    "login": "string",
    "password": "string",
    "password_confirmation": "string",
    "permissions": [],
    "cameras_to_attach": [],
    "cameras_to_detach": [],
    "expired_at": "date",
    "ptz_priority": 0
}'
PHP
PHP
$data = array (
  'user' => 0,
  'name' => 'string',
  'login' => 'string',
  'password' => 'string',
  'password_confirmation' => 'string',
  'permissions' => 
  array (
  ),
  'cameras_to_attach' => 
  array (
  ),
  'cameras_to_detach' => 
  array (
  ),
  'expired_at' => 'date',
  'ptz_priority' => 0,
);
$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/special-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.