Skip to content

Webhooks

Gaard webhooks let you receive classification results as an HTTP POST to your own endpoint as soon as processing is finished.

For integrators, the main idea is simple:

  • your system sends a video to Gaard
  • Gaard classifies it asynchronously
  • when the final result is available, Gaard posts the result JSON to your webhook URL
Webhook flowYour system posts a video to the Gaard API, Gaard classifies it asynchronously and stores the result, then posts the result JSON to your webhook endpoint, which passes it to your queue, incident system or workflow.GAARDVIDEOWEBHOOK POSTYour systemPOST /api/classifyGaard APIqueues the jobClassificationasynchronousResult storedclassify_idYour webhook endpointHTTPS · result JSONYour workflowqueue · incident system

Gaard sends the final classification result. A webhook that opts in also receives camera health events.

The webhook payload uses the same JSON shape as the result returned by:

  • GET /api/result/{id}
  • POST /api/classify?sync=true

That means you can usually reuse the same parser for both polling and webhook-based integrations.

  1. Your application submits a video to POST /api/classify.
  2. Gaard accepts the job and processes it asynchronously.
  3. After classification is completed and the result is persisted, Gaard sends an HTTP POST request to each webhook configured for the flow.
  4. Your endpoint receives the result payload and can trigger downstream actions such as incident creation, alarm enrichment, or archival.

In the Gaard application:

  1. Open the integrations section. Platform integrations
  2. Create a new Webhook integration.
  3. Select the flow that should trigger the webhook.
  4. Enter the destination URL of your receiver.
  5. Save the integration.
  6. Submit a test classification and verify that your endpoint receives the payload.

If you need to send the same result to multiple systems, create multiple webhook integrations.

Gaard sends:

  • Method: POST
  • Header: Content-Type: application/json
  • Body: classification result JSON

Gaard does not currently add custom authentication headers or a signature header. If your receiver requires authentication, protect it at your edge, for example with a secret URL path, a reverse proxy, or another mechanism you control.

Classify WebHook payload
{
"id": "6662f5c1f897618de43f0bbd",
"status": {
"classify": "done",
"video": "done"
},
"parent_id": "000000000000000000000000",
"camera_id": "134188-VI08",
"tenant": "tenant",
"duration": 2968236,
"duration_seconds": 2,
"model": "noname",
"version": "2.0.16123",
"error_code": 0,
"error_msg": "",
"risk": "intrusion",
"labels": ["intrusion", "person"],
"result": "classified",
"scores": {
"flag": 0.049,
"plant": 0.03,
"web": 0.009,
"NOTHING": 0.0005,
"intrusion": 0.973,
"person": 0.973,
"rain": 0.002,
"spider": 0.007,
"text": 0.0006,
"wind": 0.021,
"animal": 0.035,
"other": 0.028,
"vehicule": 0.101
},
"video": {
"videoname": "video.mov",
"filename": "video.mov",
"filesize": 786800,
"specs": {
"height": 320,
"original.width": 640,
"duration": 4.217772,
"fps": 3.08,
"nframes": 13,
"original.fps": 3,
"original.height": 360,
"original.nframes": 12,
"width": 568
}
},
"metadata": {
"camera_id": "VI08",
"site_id": 134188
},
"created_at": "2024-05-14T16:13:37.156+02:00",
"started_at": "2024-05-14T16:13:37.156+02:00"
}
FieldTypeNotes
idstringStable classification identifier. Use it as your primary correlation key.
statusobjectFinal processing state for classification and video annotation.
camera_idstringCamera identifier derived from metadata.
tenantstringGaard tenant that produced the result.
riskstringHigh-level outcome such as safe, danger, or intrusion.
labelsstring[]Labels derived from the score set.
resultstringRaw engine result string such as classified.
scoresobjectPer-label confidence scores.
videoobjectVideo file name, size, and technical specs.
metadataobjectOriginal metadata submitted with the classification request.
created_atstringWhen the classification task was created.
started_atstringWhen processing started.

For the full field reference, see Response structure and Classification result.

A webhook integration can receive the result in the format of API v4 instead. In the integration, set Payload version to API v4. The default stays API v3.0, so a receiver that you have now continues to work.

The API v4 body has one field classification, the same Classification message that GetClassification gives, and the field sendTime. The JSON field names are in lowerCamelCase, and an enum value is its name:

{
"classification": {
"id": "66436fc66d24ab9cf81140eb",
"state": "STATE_DONE",
"risk": "RISK_INTRUSION",
"labels": ["person"],
"result": "intrusion",
"scores": { "person": 0.973, "vehicule": 0.101 },
"model": "noname",
"modelVersion": "2.0.16123",
"metadata": { "no_trans": "20818" },
"createTime": "2024-05-14T14:13:37.156Z",
"videoName": "66436fc66d24ab9cf81140eb.mp4"
},
"sendTime": "2024-05-14T14:13:41.020Z"
}

The message is gaard.webhooks.v4.ClassificationEvent in the SDKs. The request format, the delivery and the reliability are the same as for the API v3.0 payload.

A webhook can also receive an event when a camera stays offline and when it comes back. This is off by default, so a webhook for classification results does not start to receive camera alarms.

To turn it on:

  1. Open Settings › Platform configuration › Camera health, turn on the rule, and set the number of failed checks and the check interval. With the default rule, a camera must be offline for 3 minutes without a break.
  2. Open the webhook integration and turn on Send camera health events.
  3. Set the Offline code and the Restore code (defaults: YS and YK), and a Signing secret. A webhook without a signing secret receives no camera health event.
  4. Give each camera its Alarm zones, and give its site an Alarm platform site ID. A camera without them sends nothing.

Gaard sends one camera.offline event for an outage, also when the camera stays offline for days. It sends one camera.restored event when the camera comes back.

{
"event": "camera.offline",
"restore": false,
"siaCode": "YS",
"eventId": "a6d199120c2eefb4ec28bcd577322db6",
"occurredAt": "2026-10-30T10:05:03Z",
"offlineSeconds": 180,
"site": { "id": "6ae4673d345864687f631d35", "name": "North", "externalId": "0123456789abcdef" },
"camera": { "id": "6ae46afe598ef4ab7453217f", "name": "Loading bay", "zones": ["002", "009"] },
"zone": "002"
}
FieldMeaning
eventcamera.offline or camera.restored
restoretrue for camera.restored
siaCodeThe offline code or the restore code of the integration
eventIdThe ID of this event. A retry has the same ID, so use it to ignore a duplicate
occurredAtWhen Gaard made the event
offlineSecondsHow long the camera has been offline
siteThe site, with externalId as its alarm platform site ID
cameraThe camera, with all of its alarm zones
zoneThe lowest alarm zone of the camera. A restore has the zone of its failure

These events differ from classification results in two ways:

  • Signature. The X-Gaard-Signature header is sha256= and then the hex HMAC-SHA256 of the raw request body, with the signing secret as the key. Compute it on the raw bytes and compare it in constant time.
  • Retries. Gaard tries three times when the connection fails or the answer is not 2xx: at once, after 5 seconds, and after 30 more seconds. A restart of Gaard during these waits loses the delivery.

Webhook delivery is tied to classification completion.

  • Gaard does not send the webhook when the job is merely accepted.
  • Gaard sends the webhook after the classification result is stored and post-processing is complete.
  • In practice, webhook timing is usually very close to the moment the result becomes available from GET /api/result/{id}.

There is no separate webhook queue or scheduled batch window. End-to-end webhook latency is therefore:

Σ(t) = classify + post-processing + network

Gaard does not currently publish a fixed webhook latency SLA, because classification duration depends on the video, model, runtime load, and network distance to your receiver.

Webhook delivery is currently best effort.

  • Gaard sends one HTTP POST per configured webhook endpoint.
  • Gaard does not currently implement automatic retries.
  • Gaard does not currently treat non-2xx HTTP responses as retryable delivery failures.

Because of that, your receiver should:

  • accept the request quickly
  • return a response immediately after basic validation
  • move heavier work to an internal queue or background worker
  • store the payload id so your processing is idempotent

To make your integration robust:

  • Accept application/json requests.
  • Validate that id, tenant, and the fields you depend on are present.
  • Use the payload id as your deduplication key.
  • Treat error_code != 0 as a completed result with an error, not as a transport failure.
  • Keep your webhook endpoint fast and asynchronous.
  • Log the full payload during your initial rollout so you can confirm which metadata fields are present in your environment.

Your endpoint can return a minimal success response such as:

HTTP/1.1 200 OK
Content-Type: application/json
{"ok":true}

Use webhooks when:

  • you want near-real-time downstream processing
  • you already operate an HTTP service that can receive callbacks
  • you want to avoid repeated polling for result availability

Use polling with GET /api/result/{id} when:

  • inbound HTTP callbacks are not possible in your environment
  • you need explicit control over fetch timing
  • you want a simpler first integration before moving to event-driven delivery