Register a webhook
Payload shape
Verifying signatures
Every webhook request includes anX-Onlook-Signature header. Verify it to ensure the payload came from OnlookAI:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Receive real-time attention events via HTTP.
POST /v1/webhooks
{
"url": "https://your-backend.com/attention",
"events": ["score.drop", "score.recover", "session.stopped"],
"threshold": 40
}
{
"id": "evt_7hD1cM3s",
"type": "score.drop",
"sessionId": "sess_8xK2mP9q",
"userId": "alice@acme.com",
"score": 34,
"threshold": 40,
"timestamp": "2026-04-28T14:32:08Z"
}
X-Onlook-Signature header. Verify it to ensure the payload came from OnlookAI:
import { createHmac } from 'crypto'
function verify(payload: string, signature: string, secret: string) {
const expected = createHmac('sha256', secret)
.update(payload)
.digest('hex')
return `sha256=${expected}` === signature
}
| Event | Description |
|---|---|
score.drop | Score fell below threshold |
score.recover | Score rose above threshold |
session.stopped | Session ended |
intervention.fired | Intervention triggered |
intervention.resolved | User answered or dismissed |