Proud winners of the 2026 CFIN Foodtech Frontier Awards. Learn more →

Vision Events

Webhook events for vision alerts

Vision events are triggered when a vision rule on one of your cameras raises an alert, and when that alert is resolved.

#TypeScript Interfaces

Copy these interfaces to type your webhook handlers:

/** Base event properties included in all webhook events */
interface BaseEvent {
  /** Unique event identifier (UUID) */
  id: string;
  /** Event type */
  kind: string;
  /** ISO 8601 timestamp */
  time: string;
  /** Transaction identifier (UUID) */
  transactionId: string;
}
 
/** Fields every vision alert event carries */
interface VisionAlertFields {
  /** Alert UUID */
  alertId: string;
  /** The rule that raised the alert */
  ruleId: string;
  ruleName: string;
  cameraId: string;
  cameraName: string;
  regionId: string;
  regionName: string;
  /** The Tracktile Edge relay the camera reports through */
  relayId: string;
  /** The location the alert reports against: the region's, else the camera's */
  nodeId?: string;
  severity: "info" | "warning" | "critical";
  /** When the alert started */
  triggeredAt: string;
  /** The measured value that tripped the rule, when the rule measures one */
  value?: number;
  /** The rule's named recipients. Empty means everyone who receives vision alerts. */
  recipientUserIds: string[];
}

#vision.alert.triggered

Triggered when a vision rule enters its alert state.

{
  "id": "3f1c2b9a-8e4d-4f30-92ab-45cd6f1c2b9a",
  "kind": "vision.alert.triggered",
  "time": "2026-01-15T10:30:00.000Z",
  "transactionId": "9b2e7c1d-4a5f-4e3b-8c6d-2f1a0b9c8d7e",
  "alertId": "a1c3e5b7-d9f1-4a3c-8e5b-7d9f1a3c5e7b",
  "ruleId": "b2d4f6a8-c0e2-4b4d-9f6a-8c0e2b4d6f8a",
  "ruleName": "No hard hat",
  "cameraId": "c3e5a7b9-d1f3-4c5e-a7b9-d1f3c5e7a9b1",
  "cameraName": "Line 2 camera",
  "regionId": "d4f6b8c0-e2a4-4d6f-b8c0-e2a4d6f8b0c2",
  "regionName": "Packing area",
  "relayId": "e5a7c9d1-f3b5-4e7a-9c1d-3f5b7e9a1c3d",
  "nodeId": "2b4d6f8a-1c3e-4a5b-8d7f-9e1c3a5b7d9f",
  "severity": "warning",
  "triggeredAt": "2026-01-15T10:29:58.000Z",
  "recipientUserIds": []
}

#vision.alert.resolved

Triggered when an open vision alert is resolved: it cleared on the device, a user resolved it, or its rule or camera stopped being checked.

{
  "id": "3f1c2b9a-8e4d-4f30-92ab-45cd6f1c2b9a",
  "kind": "vision.alert.resolved",
  "time": "2026-01-15T10:30:00.000Z",
  "transactionId": "9b2e7c1d-4a5f-4e3b-8c6d-2f1a0b9c8d7e",
  "alertId": "a1c3e5b7-d9f1-4a3c-8e5b-7d9f1a3c5e7b",
  "ruleId": "b2d4f6a8-c0e2-4b4d-9f6a-8c0e2b4d6f8a",
  "ruleName": "No hard hat",
  "cameraId": "c3e5a7b9-d1f3-4c5e-a7b9-d1f3c5e7a9b1",
  "cameraName": "Line 2 camera",
  "regionId": "d4f6b8c0-e2a4-4d6f-b8c0-e2a4d6f8b0c2",
  "regionName": "Packing area",
  "relayId": "e5a7c9d1-f3b5-4e7a-9c1d-3f5b7e9a1c3d",
  "nodeId": "2b4d6f8a-1c3e-4a5b-8d7f-9e1c3a5b7d9f",
  "severity": "warning",
  "triggeredAt": "2026-01-15T10:29:58.000Z",
  "recipientUserIds": [],
  "resolvedAt": "2026-01-15T10:34:12.000Z",
  "resolvedBy": "edge"
}

#All Vision Event Types

Union type for handling any vision event:

type VisionEvent =
  | VisionAlertTriggeredEvent
  | VisionAlertResolvedEvent;
 
// Type guard for vision events
function isVisionEvent(event: BaseEvent): event is VisionEvent {
  return event.kind.startsWith("vision.");
}