Webhooks
Receive real-time notifications when events occur in your workspace
Webhooks let you receive HTTP POST notifications when events happen in your OperativeOps workspace. Instead of polling the API, configure a webhook endpoint and we'll push events to you.
Event Types
insight.createdFired when an agent generates a new proactive insight based on your data.
agent.respondedFired when an agent completes their response in a conversation.
metric.alertFired when a tracked metric crosses a threshold you've configured.
conversation.completedFired when all agents in a conversation have responded.
Setting Up Webhooks
Configure webhooks in your dashboard under Settings → Webhooks, or programmatically via the API.
Signature Verification
Every webhook request includes an X-OPS-Signature header containing an HMAC-SHA256 signature. Always verify this signature to ensure the request came from OperativeOps.
const crypto = require('crypto');
function verifySignature(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}Retry Policy
If your endpoint returns a non-2xx status code, we'll retry with exponential backoff: 1 minute, 5 minutes, 30 minutes, 2 hours. After 4 failed attempts, the webhook is marked as failing and you'll receive an email notification.
Example Webhook Handler
app.post('/webhooks/operativeops', (req, res) => {
const signature = req.headers['x-ops-signature'];
if (!verifySignature(JSON.stringify(req.body), signature, process.env.OPS_WEBHOOK_SECRET)) {
return res.status(401).send('Invalid signature');
}
const { type, data } = req.body;
switch (type) {
case 'insight.created':
handleNewInsight(data);
break;
case 'metric.alert':
handleMetricAlert(data);
break;
}
res.status(200).send('OK');
});