Quick Example
Delivery Methods
| Method | Latency | Use Case |
|---|---|---|
| WebSocket | Real-time | Dashboards, live UI updates |
| Webhook | Under 1s | Server-to-server, automation |
Webhook Delivery
Create Webhook Alert
Webhook Payload
When an event triggers, you receive a POST request:Payload Fields
| Field | Type | Description |
|---|---|---|
event_id | string | ID of the triggered event |
label | string | Human-readable event label |
confidence | float | Detection confidence (0-1) |
explanation | string | AI-generated description of what was detected |
timestamp | string | ISO 8601 timestamp |
start_time | float | Video timestamp where event starts (seconds) |
end_time | float | Video timestamp where event ends (seconds) |
stream_url | string | HLS stream URL for the clip |
player_url | string | Web player URL |
WebSocket Delivery
Connect and Listen
WebSocket Channels
| Channel | Source | Content |
|---|---|---|
alert | Event triggers | Alert notifications |
transcript | start_transcript() | Real-time speech |
scene_index | index_visuals() | Visual analysis |
audio_index | index_audio() | Audio analysis |
Managing Alerts
List Alerts
Enable/Disable Alerts
Delete Alert
Dual Delivery Pattern
Use both channels for critical alerts:- WebSocket delivers instantly to connected clients
- Webhook provides reliable server-side processing
- If WebSocket disconnects, webhook still works
Latency Profile
| Event Type | Typical Latency |
|---|---|
| Alert trigger | Under 1s |
| Transcript event | 1-2s |
| Visual index event | 2-5s |
| Audio index event | 2-5s |
Delivery Guarantees
| Method | Guarantee | Notes |
|---|---|---|
| WebSocket | At-most-once | May miss events if disconnected |
| Webhook | At-least-once | May receive duplicates; use idempotency |