Skip to main content
Skip table of contents

Creating a group

Creating a group

Creating a custom group is only available for the custom Tree format

POST /api/admin/v1/camera-group

Method parameters

ip name, group name


int parent_id, ID of the group that will be considered as the parent for the created group

201 Created

Successful response

JSON
{
    "id": 1,
    "name": "Cameras",
    "full_pretty": null,
    "is_house": 0,
    "cameras_count": 0,
    "parent_id": null,
    "csa_id": null,
    "intercoms_count": 0
}

401 Unauthorized

Authorization token is not provided or is invalid. Obtaining a token

403 Forbidden

In case the tree format is not custom

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-domain/api/admin/v1/camera-group' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "name": "ip",
    "parent_id": 0
}'
PHP
PHP
$data = array (
  'name' => 'ip',
  'parent_id' => 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-domain/api/admin/v1/camera-group', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.