Updating a tree element

When updating a tree element, you can rename it or change the key.

When the key is changed, the tree element does not lose dependencies that were created through the old key.

The tree element can be updated by id or by external_id.

502 Bad Gateway

Headers

Accept

application/json

Body

json

JSON
{
    "name": "new name",
    "type": "cameras|intercoms",
    "id": null,
    "external_id": "current_value",
    "new_external_id": "new_value"
}

namerequired

string

Tree element name

idrequired

int

Tree element ID to be updated

external_idrequired

string|int

Key for tree element

typerequired

string

The type of tree within which the update occurs

new_external_idrequired

string|int

New unique own key for tree element

Response

Invalid License

To continue using Just Add+ Embed Markdown, Diagrams, & Code in Confluence Git , a valid license is required.

Successful response

JSON
{
                "id": 15,
                "name": "Name of item",
                "external_id": "unique_key",
                "has_items": true
            }

Invalid License

To continue using Just Add+ Embed Markdown, Diagrams, & Code in Confluence Git , a valid license is required.

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."
        ]
    }
}

Example

JSON
curl -k --location --request PATCH 'https://vms.local/api/v1/billing/tree' \
--header 'Accept:application/json' \
--header 'Content-Type: application/json \
--data-raw '{
    "name": "new name",
    "type": "cameras|intercoms",
    "id": null,
    "external_id": "current_value",
    "new_external_id": "new_value"
}'