Skip to main content

Webhook Events Overview

Viewtron devices can push real-time AI detection events to your HTTP server as webhooks. There are two sources of HTTP POST data:

  1. IP Camera (direct) -- The camera sends posts directly to your server using the IPC v1.x XML format (config version 1.0 or 1.7). Supports the full httpPostV2 subscription system including real-time traject tracking.

  2. NVR (forwarded) -- The NVR receives events from cameras on its PoE ports and forwards them to your server using the NVR v2.0 XML format (config version 2.0.0). Does not support traject.

For full coverage, configure both sources simultaneously:

  1. Configure the NVR HTTP Post to send to your server (alarm events with images, v2.0 format)
  2. Configure the IPC httpPostV2 to send to your server with traject subscribed (real-time tracking, v1.x format)
  3. Your server receives both streams simultaneously

This dual-source approach gives you alarm events with images from the NVR and continuous real-time tracking from the camera.

Working Python Server

A complete working implementation is available at github.com/mikehaldas/IP-Camera-API. It handles both IPC and NVR formats, extracts images, logs events to CSV, and supports traject-based relay control.

Event Flow

When a detection event occurs, you receive these message types:

Message TypeDescriptionSource
keepalivePeriodic heartbeatIPC and NVR
alarmStatusAlarm state change (true/false)IPC and NVR
alarmData / smartDataFull detection event with coordinates and imagesIPC and NVR
trajectContinuous real-time target position trackingIPC only

Format Differences

The two sources use different XML formats. See the dedicated pages for each:

Section Guide

PageWhat You'll Find
Detection TypesComplete table of all detection types with IPC and NVR codes
IPC FormatXML structure for direct camera posts (v1.x)
NVR FormatXML structure for NVR-forwarded posts (v2.0)
Data TypesHow httpPostV2 subscription types interact
traject TrackingContinuous real-time target position data
Image DataBase64 image encoding, source vs target images
TimestampsTimestamp formats across IPC and NVR
Application Guides

For step-by-step setup instructions, see Webhook Event Notification API in the Applications section.