Skip to main content
Skip table of contents

Update group. VMS Client API

PUT/api/v1/groups/{group}

Headers

Authorization

Bearer token

Accept

application/json

X-Client

ios-cctv|android-cctv|thick-legal|web

X-UUID

unique device id

Body

json

JSON
{
    "name": "new name",
    "items": [
        1,
        2,
        3
    ]
}

groupoptional

int

Group identifier to update

namerequired

string

Group name

itemsrequired

array

Array of camera IDs to be retained in the group (new ones will be added, those not included in the array will be removed from the group)

Response

200

Successful response

JSON
{
    "id": 44,
    "name": "test1",
    "items": [
        {
            "id": 751,
            "group_id": 101,
            "status": "active",
            "type": "media_server_v2",
            "start_at": "2022-03-22 13:47:37",
            "created_at": "2022-01-27 19:46:27",
            "billing_id": null,
            "pretty_name": "Camera 1",
            "pretty_text": "Cameras",
            "short_address": "Cameras",
            "full_address": "Cameras",
            "lat": null,
            "lng": null,
            "azimuth": null,
            "streams": [
                {
                    "id": 744,
                    "type": "high",
                    "camera_id": 751,
                    "is_preview_from_server": true,
                    "is_archive_from_server": null,
                    "status": "active",
                    "has_sound": false,
                    "width": 2048,
                    "height": 1536
                },
                {
                    "id": 745,
                    "type": "low",
                    "camera_id": 751,
                    "is_preview_from_server": true,
                    "is_archive_from_server": null,
                    "status": "active",
                    "has_sound": false,
                    "width": 2048,
                    "height": 1536
                }
            ],
            "has_sound": false,
            "archive_ranges": [
                {
                    "end": 1648340879,
                    "from": 1647945613,
                    "duration": 395266
                },
                {
                    "end": 1649146798,
                    "from": 1648429544,
                    "duration": 717254
                },
                {
                    "end": 1649159638,
                    "from": 1649158213,
                    "duration": 1425
                },
                {
                    "end": 1649221070,
                    "from": 1649159719,
                    "duration": 61351
                },
                {
                    "end": 1649240719,
                    "from": 1649222038,
                    "duration": 18681
                }
            ],
            "is_archive_recording": true,
            "is_bridge": false,
            "is_favorite": false,
            "user_status": "active",
            "name": "Camera 1"
        }
    ],
    "items_count": 1
}
404

If the group does not belong to the user or does not exist

401

Authorization token not provided or invalid, see Obtaining a token

422

Returns a JSON object with an error, see Validation

JSON
{
    "message": "There won't be any informative message here",
    "errors": {
        "any_key": [
            "Here the error cause will be described"
        ]
    }
}

Example

JSON
curl -k --location --request PUT 'https://vms.local/api/v1/groups/{group}' \
--header 'Authorization:Bearer token' \
--header 'Accept:application/json' \
--header 'X-Client:ios-cctv|android-cctv|thick-legal|web' \
--header 'X-UUID:unique device id' \
--header 'Content-Type: application/json \
--data-raw '{
    "name": "new name",
    "items": [
        1,
        2,
        3
    ]
}'
JavaScript errors detected

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

If this problem persists, please contact our support.