Webhooks
Add an endpoint under Project settings → Integrations → Webhooks and choose which events to receive. Use Send test to check your endpoint.
For Zapier, Make or n8n, use their generic "webhook" trigger and paste its URL here.
Slack and Discord: paste a Slack incoming webhook URL (https://hooks.slack.com/…) or a Discord webhook URL and they get a readable message with a link to the dashboard, instead of the JSON below.
Events
| Event | Fires when |
|---|---|
alert.schema_change | A tool's description, input schema or annotations change |
alert.new_tool | A new tool is registered |
alert.tool_removed | A tool disappears |
alert.error_spike | A tool's error rate jumps (checked hourly) |
alert.new_ai_agent | An AI crawler or agent visits the site for the first time |
alert.robots_change | robots.txt now allows or blocks an AI bot differently (checked daily) |
alert.rule | One of your alert rules fires |
alert.rule_resolved | It recovers |
mcp.feedback | An agent or user sends feedback through an MCP server's send_feedback tool |
eval.finished | An eval run finishes: passed, failed or inconclusive |
tool_call.error | A tool call fails |
custom_event | Every AgentStats.track() call |
test | You press Send test |
Alert rules
Under Project settings → Notifications → Alert rules, set your own alerts on a tool source or one tool: error rate, failed calls, p95 latency, tool calls (below a threshold: traffic stopped), unreachable (requests the proxy got no answer to) or rejected sign-ins, over the last 5, 15 or 60 minutes. Rules are checked every minute. One fires after two bad checks in a row and recovers at the first good one; both are emailed as your notification settings say and sent here. Rates and latency wait for a minimum number of calls, so a quiet hour doesn't page anyone.
Payload
POST https://your-endpoint
Content-Type: application/json
X-Webhook-Id: whd_…
X-Webhook-Event: alert.schema_change
X-Webhook-Signature: t=1757900000,v1=<hex hmac-sha256>
{
"id": "whd_…",
"event": "alert.schema_change",
"created_at": "2026-09-15T10:00:00.000Z",
"site": { "id": "…", "name": "Storefront", "domain": "shop.example.com" },
"data": {
"type": "schema_change",
"severity": "warning",
"title": "Schema of \"search_products\" changed",
"details": {
"tool": "search_products",
"diff": ["parameter \"limit\" added (number)"],
"before": {},
"after": {}
},
"url": "https://agentstats.io/dashboard/sites/…/alerts"
}
}
X-Webhook-Id is unique per delivery and stays the same across retries. Use it to ignore duplicates.
Verify the signature
Compute HMAC-SHA256(secret, "${t}.${rawBody}") with the endpoint's signing secret and compare it with v1 in constant time. Reject requests where t is more than 5 minutes old.
import { createHmac, timingSafeEqual } from 'node:crypto'
function verify(secret: string, rawBody: string, header: string) {
const { t, v1 } = Object.fromEntries(header.split(',').map(p => p.split('=')))
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false
const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex')
return expected.length === v1.length && timingSafeEqual(Buffer.from(expected), Buffer.from(v1))
}
Retries
Respond with any 2xx within 10 seconds. Otherwise the delivery is retried up to 5 times, after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours. After 50 consecutive failures the endpoint is disabled.