Metadata
The metadata.json file is a flexible JSON structure that clients can send alongside the video file. It enhances the context of the video data and supports more tailored processing and analysis. All fields are optional.
Gaard uses the metadata to:
- find the site and the camera that the video comes from, and create them on first sight;
- set the display fields (name, description, location) of that site and camera;
- carry your own references (such as
file_id) back to you in results and webhooks.
Examples
Section titled “Examples”Minimal:
{ "site_id": 134188, "camera_id": "VI08"}Recommended, with explicit match ids and display fields:
{ "site": { "site_match_id": "acme-paris-warehouse", "name": "Paris warehouse", "description": "Main logistics site", "location": "12 rue de la Paix, 75002 Paris" }, "camera": { "camera_match_id": "acme-paris-warehouse/dock-north", "name": "Dock north", "description": "Loading dock, north side", "location": "Building B, exterior", "web_site": "https://192.0.2.10/" }, "file_id": "evt-2026-11-13-0001"}Fields
Section titled “Fields”Identity fields
Section titled “Identity fields”| Field | Type | Status | Description |
|---|---|---|---|
site.site_match_id | string | Preferred | Your stable, explicit key for the site. Wins over all other site fields. |
camera.camera_match_id | string | Preferred | Your stable, explicit key for the camera. Wins over all other camera fields. Must be unique across all your sites. |
site_id | string | int | Supported | Site identifier. Used when site.site_match_id is absent. |
camera_id | string | int | Supported | Camera identifier, unique within its site. Used when camera.camera_match_id is absent. |
client_id | string | int | Deprecated | Legacy site identifier. Used only when site.site_match_id and site_id are both absent. |
code_msg | string | Deprecated | Legacy camera identifier. Used only when camera.camera_match_id and camera_id are both absent. |
Site payload (site)
Section titled “Site payload (site)”An optional object that describes the site.
| Field | Type | Description |
|---|---|---|
site_match_id | string | Explicit site key (see Matching ids). |
name | string | Display name of the site. |
description | string | Free-text description. |
location | string | Address or other location text. |
rewrite | boolean | When true, all display fields are overwritten (see Updating display fields). |
Camera payload (camera)
Section titled “Camera payload (camera)”An optional object that describes the camera.
| Field | Type | Description |
|---|---|---|
camera_match_id | string | Explicit camera key (see Matching ids). |
name | string | Display name of the camera. |
description | string | Free-text description. |
location | string | Position of the camera on the site. |
web_site | string | URL linked to the camera, such as its web interface. |
rewrite | boolean | When true, all display fields are overwritten (see Updating display fields). |
Other keys in site and camera are ignored. You cannot change the type, the connection settings or the identity of a site or camera through metadata.
Reference fields
Section titled “Reference fields”| Field | Type | Description |
|---|---|---|
file_id | string | Your reference for the video file. Some integrations return it with the annotated video so you can link it to the source alarm. |
You can add any other field. Gaard keeps it and returns it unchanged in the metadata object of the classification result.
Matching ids
Section titled “Matching ids”Each request is linked to one site and one camera in your Gaard account. Gaard computes two match keys from the metadata, in this order:
site key = site.site_match_id || site_id || client_id (deprecated)
camera key = camera.camera_match_id || <site key> + "/" + camera_id || <site key> + "/" + code_msg (deprecated)Then:
- If a camera with this camera key exists, the request goes to that camera and its site.
- If not, Gaard finds the site with this site key, or creates it. Then it creates the camera on that site.
- A new site takes the site key as its name, and a new camera takes
camera_id(orcode_msg) as its name, unless you sendsite.nameorcamera.name.
The result contains the Gaard ids of the camera (cid) and the site (sid). Use these ids for all later work with the platform.
Important rules:
- Keep the keys stable. The same physical camera must always send the same values. If a key changes, Gaard creates a new site or a new camera, and the history of the old one is not moved.
- Without explicit match ids,
camera_idis unique only inside its site. Two camerasVI08on two different sites are two different cameras, because the site key is part of the camera key. - A
camera_match_idis global. If you send the samecamera_match_idfrom two sites, Gaard treats them as one camera. Include the site in the value (for exampleacme-paris-warehouse/dock-north) or use another globally unique value. - Without a site key and a camera key, no site or camera is linked. The video is still analyzed, but it is not attached to a camera in the platform, and camera settings such as exclusion zones do not apply.
- Values are compared as strings:
134188and"134188"give the same key. - Matching is done inside your tenant only.
Moving to explicit match ids
Section titled “Moving to explicit match ids”If you already send site_id/camera_id and want to keep the same sites and cameras, send match ids that equal the current keys:
{ "site": { "site_match_id": "134188" }, "camera": { "camera_match_id": "134188/VI08" }}Other values create new sites and cameras.
Updating display fields
Section titled “Updating display fields”Gaard reads the site and camera payloads on each request:
- Default (partial update): only the fields that you send are written. Fields that you do not send keep their current values, including edits made in the platform.
"rewrite": true: all display fields are written. Fields that you do not send are cleared. Ifnameis absent, the name becomes the site key (site_idorclient_id) or the camera identifier (camera_idorcode_msg). Edits made in the platform are overwritten.
Writes are skipped when the values do not change, so you can send the same payload with each video. A changed value is written with the next request.
Usage notes
Section titled “Usage notes”- All fields are optional, but sending a site key and a camera key is necessary to link videos to sites and cameras.
- For new integrations, use
site.site_match_idandcamera.camera_match_id.client_idandcode_msgare deprecated. - The entire metadata object is included in the classification result.

