Skip to main content
Skip table of contents

Create а user

The method and parameters

POST /api/v1/billing/user/manage

JSON
{
    "login": "test@mail.com",
    "password": "qweasdzxc",
    "can_update_password": true,
    "type": "type_value",
    "billing_info": {
        "billing_id": "123123123",
        "billing_extra": []
    },
    "properties": [
        {
            "type": "phone",
            "value": "+80283289362"
        }
    ]
    "status": "active",
}

The parameters

string login – is a required parameter. This parameter is a unique identifier that the user will use to access and authenticate to the video surveillance system. It can be any string of characters (e.g., john_smith, etc.) and doesn’t necessarily have to be in an email format.

The login is automatically generated and provided by the customer's external system. It is received through a callback mechanism after the user has been successfully registered in the customer's system.


string password – is a required parameter with a maximum length of 100 characters. The password is automatically generated and provided by the customer's external system via a callback. For maximum security, all passwords are stored in the VMS database exclusively in a hashed format.


boolean can_update_password – is optional and determines if a user is allowed to change their password. If this parameter isn’t specified, the system will automatically set it to true, granting the user permission to change their password.


string type – the parameter is required and has a maximum length of 50 characters. It specifies the user type. The value must correspond to one of the valid types listed in the cctv.user_types configuration file. The list of allowed values is set by the specialist who installed the platform. To get the current list of types, contact that specialist.

Please note that the values special and subuser aren’t allowed; using these types will result in an error.


arraybilling_info – parameter is optional. It is an object that contains additional user information received from the external billing system, such as identifiers (IDs) or metadata. The billing_extra field is used to transmit technical data from the billing system (for example, internal identifiers, tags, and extra fields).


string properties – an optional parameter with a maximum of 10 elements. It's an array of objects that contain custom user attributes, which can be used by both an external system and the video surveillance platform internal logic. These attributes could include things like contact information (phone, email, address, etc.) and other user-specific characteristics.

The properties field allows for the flexible addition of any extra user attributes that aren't tied directly to the external system's billing logic. For example, it could be used for the email address a user uses to log in to the video surveillance system.

Each element in the array must contain the following:

  • type: A required parameter with a maximum length of 100 characters. This is the attribute type (e.g., phone, email).

  • value: A required parameter with a maximum length of 255 characters. This is the attribute's value (e.g., +80283289362).


string status – a user status. Available values:

  • active – the user in the Active status has access to the video surveillance system. This is the default value.

  • blocked– the user in the Blocked status is denied access to the system.


User permissions

When a user is created, permissions are assigned by default based on the user type. These default permissions are defined in the system settings (default_permissions_<user_type> within the system_settings table).

You can find the full list of permissions on the Permissions: user, admin page. To modify user permissions, you can use the PATCH API method (detailed in the Update a user section) or change them through the video surveillance system Administrator interface.

For additional information on platform configuration and settings, including related environment variables, refer to the Env variables page.

200 OK

Returns the user object

JSON
{
    "id": 1,
    "login": "test@mail.com",
    "name": null,
    "type": "type_value",
    "status": "active",
    "permissions": [
        {
            "id": 1,
            "name": "layouts-index"
        },
        {
            "id": 2,
            "name": "layouts-store"
        }
    ],
    "created_at": "2023-05-02T10:18:50.000000Z",
    "updated_at": "2023-05-02T10:18:50.000000Z",
    "deleted_at": null,
    "can_update_password": true,
    "billing_properties": [
        {
            "type": "phone",
            "value": "+80283289362"
        }
    ]
}

422 Unprocessable Entity

Returns a JSON object with an error

For details, see Validation.

JSON
{
    "message": "No error message here",
    "errors": {
        "any_key": [
            "Error details"
        ]
    }
}

cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/v1/billing/user/manage' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "login": "test@mail.com",
    "password": "qweasdzxc",
    "can_update_password": true,
    "type": "type_value",
    "billing_info": {
        "billing_id": "123123123",
        "billing_extra": []
    },
    "status": "active",
    "properties": [
        {
            "type": "phone",
            "value": "+80283289362"
        }
    ]
}'
PHP
PHP
$data = array(
    'login' => 'test@mail.com',
    'password' => 'qweasdzxc',
    'can_update_password' => true,
    'type' => 'type_value',
    'billing_info' => array(
        'billing_id' => '123123123',
        'billing_extra' => array()
    ),
    'status' => 'active',
    'properties' => array(
        array(
            'type' => 'phone',
            'value' => '+80283289362'
        )
    )
);

$context = stream_context_create([
    'ssl' => ['verify_peer' => false],
    'http' => [
        'method' => 'POST',
        'header' => "Content-Type: application/json\r\nAccept: application/json",
        'content' => json_encode($data)
    ]
]);

$result = file_get_contents('https://your-domain/api/v1/billing/user/manage', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.