Why webhooks matter
AI products fail in production. A user gets frustrated, sentiment tanks, your quality index drops—and you don’t know until it’s too late. Webhooks solve this. They give you instant visibility into quality issues so you can intervene, automate responses, or trigger alerts before damage compounds. Whether you’re escalating to human support, logging incidents in your internal systems, or building auto-recovery flows, webhooks allow for the real-time intervention in your AI product.Available events
Greenflash tracks quality across conversations and products. You can subscribe to the following events:Conversations
conversation.started: Triggered when a new conversation startsconversation.quality_index: Triggered when a conversation quality index (CQI) drops below 60%conversation.sentiment: Triggered when a conversation’s average sentiment becomes negativeconversation.frustration: Triggered when user frustration is detected (score > 0.5)conversation.struggle: Triggered when user struggle is detected (score > 0.5)conversation.commercial_intent: Triggered when commercial intent is detected (score > 0.4 with medium or high label)conversation.rating: Triggered when a user gives a rating for a conversation
Products
product.quality_index: Triggered when a product quality index (PQI) drops below 60product.sentiment: Triggered when product sentiment drops below 60%
Custom Analyses
custom_analysis.guardrail_triggered: Triggered when a guardrail is violatedcustom_analysis.expectation_failed: Triggered when an expectation check is not metcustom_analysis.evidence_found: Triggered when an evidence finder surfaces a match
Want alerts that match your product? Custom Analyses let you define your own guardrails, expectations, and evidence finders—then trigger webhooks when they fire.
Set up your webhook endpoint
Create a webhook endpoint in your settings, choose which events you want to subscribe to, and we’ll start pushing event payloads to your URL. Your endpoint should:- Respond with a
2xxstatus code within 5 seconds - Verify the webhook signature (see below)
- Process events asynchronously to avoid timeouts
Verify webhook signatures
Every webhook we send includes three headers you must verify to ensure the request actually came from Greenflash:X-Greenflash-Signature: HMAC signature of the payloadX-Greenflash-Timestamp: Unix timestamp when the webhook was sentX-Greenflash-Delivery: Unique delivery ID for this webhook
- TypeScript
- Python
verify-webhook.ts
Test your endpoint
Once you’ve set up your webhook endpoint, use the “Test Delivery” button in settings to send a sample payload and verify everything works. You’ll see the response status, headers, and body so you can debug before real events start flowing.Best practices
- Respond quickly: Acknowledge webhooks with a
200 OKimmediately, then process events in the background - Monitor failures: Check your webhook logs in settings to catch and fix delivery issues fast
- Validate timestamps: Reject webhooks older than 5 minutes to prevent replay attacks
What’s next?
Now that you’re receiving real-time quality events, you can:- Auto-escalate low-sentiment conversations to human support
- Log quality incidents in your internal monitoring systems
- Build custom alerting workflows based on PQI drops
- Trigger automated recovery flows when things go wrong

