Skip to content

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.

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"
}
FieldTypeStatusDescription
site.site_match_idstringPreferredYour stable, explicit key for the site. Wins over all other site fields.
camera.camera_match_idstringPreferredYour stable, explicit key for the camera. Wins over all other camera fields. Must be unique across all your sites.
site_idstring | intSupportedSite identifier. Used when site.site_match_id is absent.
camera_idstring | intSupportedCamera identifier, unique within its site. Used when camera.camera_match_id is absent.
client_idstring | intDeprecatedLegacy site identifier. Used only when site.site_match_id and site_id are both absent.
code_msgstringDeprecatedLegacy camera identifier. Used only when camera.camera_match_id and camera_id are both absent.

An optional object that describes the site.

FieldTypeDescription
site_match_idstringExplicit site key (see Matching ids).
namestringDisplay name of the site.
descriptionstringFree-text description.
locationstringAddress or other location text.
rewritebooleanWhen true, all display fields are overwritten (see Updating display fields).

An optional object that describes the camera.

FieldTypeDescription
camera_match_idstringExplicit camera key (see Matching ids).
namestringDisplay name of the camera.
descriptionstringFree-text description.
locationstringPosition of the camera on the site.
web_sitestringURL linked to the camera, such as its web interface.
rewritebooleanWhen 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.

FieldTypeDescription
file_idstringYour 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.

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:

  1. If a camera with this camera key exists, the request goes to that camera and its site.
  2. If not, Gaard finds the site with this site key, or creates it. Then it creates the camera on that site.
  3. A new site takes the site key as its name, and a new camera takes camera_id (or code_msg) as its name, unless you send site.name or camera.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_id is unique only inside its site. Two cameras VI08 on two different sites are two different cameras, because the site key is part of the camera key.
  • A camera_match_id is global. If you send the same camera_match_id from two sites, Gaard treats them as one camera. Include the site in the value (for example acme-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: 134188 and "134188" give the same key.
  • Matching is done inside your tenant only.

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.

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. If name is absent, the name becomes the site key (site_id or client_id) or the camera identifier (camera_id or code_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.

  • 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_id and camera.camera_match_id. client_id and code_msg are deprecated.
  • The entire metadata object is included in the classification result.