Skip to main content
Skip table of contents

Creating a temporary user

Creating a temporary user

Creating a temporary user

When creating users with a large number of cameras, it will be necessary to send multiple requests.

In one request, up to 500 cameras can be included.

See the description below in the parameter description.

POST api/admin/v1/special-users

Method parameters

string name, name


string login, unique login among all users


string password, password


string password_confirmation, password confirmation to ensure the correct input


array permissions, array of permission IDs


array cameras_to_attach, array of camera IDs that will be available to the user. You can send a maximum of 500 items in the request. If you need more, you need to send an Temporary user update request with the remaining cameras immediately after creation


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


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": 77,
            "name": "archives-preview-download",
            "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' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "name": "string",
    "login": "string",
    "password": "string",
    "password_confirmation": "string",
    "permissions": [],
    "cameras_to_attach": [],
    "expired_at": "date",
    "ptz_priority": 0
}'
PHP
PHP
$data = array (
  'name' => 'string',
  'login' => 'string',
  'password' => 'string',
  'password_confirmation' => 'string',
  'permissions' => 
  array (
  ),
  'cameras_to_attach' => 
  array (
  ),
  'expired_at' => 'date',
  'ptz_priority' => 0,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domainapi/admin/v1/special-users', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.