Overview
When you start a Live Monitor job, Trio sends webhook notifications to your server when conditions are met. This guide explains webhook payloads and best practices for handling them.Webhook Events
Your webhook URL receives POST requests with different event types depending on what happened:Condition Triggered
Sent when your condition is detected as true:timestamp: When the condition was detectedsource_url: The stream URL being monitoredtriggered: Alwaystruefor this eventexplanation: VLM’s detailed observation of what was detectedframe_b64: The actual frame that triggered the condition (useful for verification)
Job Status Change
Sent when the job stops (either manually or auto-stop after 10 minutes):status: Current job status (pending,running,stopped,completed,failed)auto_stopped: Whether the job stopped due to 10-minute limitreason: Why the job stopped (max_duration_reached,condition_triggered, etc.)elapsed_seconds: Total runtime if auto-stopped
Handling Webhooks
Basic Setup
Continuous Monitoring with Auto-Restart
Since jobs auto-stop after 10 minutes, you’ll want to restart them:Best Practices
1. Validate Webhook Authenticity
In production, validate that webhooks are actually from Trio:2. Handle Timeouts
Webhooks should respond quickly (< 5 seconds). Do heavy work asynchronously:3. Idempotent Processing
Webhooks may be delivered multiple times. Make your handlers idempotent:4. Log Everything
Keep detailed logs for debugging:Troubleshooting
Webhooks not arriving?
- Check that your webhook URL is publicly accessible
- Verify your firewall isn’t blocking Trio’s requests
- Check Job Status to see if the job is still running
- Review Logs for “webhooks_failed” entries
Webhook payload missing frame?
You need to request the frame when creating the job:frame_b64 field.
Related Endpoints
- Live Monitor - Create jobs that trigger webhooks
- Get Logs - Debug webhook delivery failures
- Get Metrics - Check webhook success/failure stats