26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Create private folder

Create a private folder

POST  /api/v1/billing/tree/folders/private

Only cameras can be placed in a private folder.

Folders are used to control access to cameras within a single tree element.

Folders can be created only in a leaf tree element.

A folder key must be unique within its leaf tree element.

JSON
{
    "key": "random_key",
    "external_id": "external_id_of_tree_element",
    "id": null,
    "is_editable": false,
    "log_extra": {
        "some": "information"
    }
}

Method parameters

string key  required , Folder key. This can be provided instead of the ID when creating a camera to add it to the folder


string|int external_id  required , Tree element key (required if `id` is not provided)


int id  required , Tree element ID (required if `external_id` is not provided)


string|array log_extra, Additional information received from an external system


boolean is_editable, Whether the folder can be edited and deleted (optional; defaults to `false`)

201  Created

Successful response

JSON
{
    "id": 15,
    "key": "random_key"
}

422  Unprocessable Entity

Returns a JSON error object. For more information, see General information > Validation.

JSON
{
    "message": "No informative message is provided here",
    "errors": {
        "any_key": [
            "The reason for the error is described here"
        ]
    }
}
cURL
Bash
curl -k --request POST \
	--url 'https://your-domain/api/v1/billing/tree/folders/private' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "key": "string",
    "external_id": "string|int",
    "id": 0,
    "log_extra": "string|array",
    "is_editable": "boolean"
}'
PHP
PHP
$data = array (
  'key' => 'string',
  'external_id' => 'string|int',
  'id' => 0,
  'log_extra' => 'string|array',
  'is_editable' => 'boolean',
);
$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/v1/billing/tree/folders/private', false, $context);