Webhooks
HTTP callbacks fired when EEG conditions are met. Build rules in the dashboard or via WebSocket commands.
Trigger Types
| Type | Fires when… |
|---|---|
band_power_above | Band power exceeds threshold |
band_power_below | Band power drops below threshold |
amplitude_above | Peak amplitude exceeds threshold |
amplitude_below | Peak amplitude drops below threshold |
band_ratio_above | Band ratio (e.g. β/θ) exceeds threshold |
band_ratio_below | Band ratio drops below threshold |
Payload
{
"event": "band_power_above",
"rule": "Alpha alert",
"value": 23.45,
"threshold": 20,
"channel": 0,
"timestamp": 1711234567.12
}Each rule has an independent cooldown (seconds) to prevent spam. Enforced server-side.
How It Works
- Client-side evaluation — the dashboard evaluates rules every 1 second
- Computes FFT on the rule’s target channel(s)
- Checks condition:
band_power > threshold, etc. - Sends
webhook_fireto server if triggered - Server relays HTTP — enforces cooldown, fires request in thread pool
- Broadcast — server notifies all clients of the fired event
Rule Definition
{
"id": "abc123",
"name": "My trigger",
"enabled": true,
"trigger_type": "band_power_above",
"params": {
"band": "alpha",
"channel": 0,
"threshold": 10
},
"url": "https://webhook.site/abc",
"method": "POST",
"headers": { "Authorization": "Bearer xyz" },
"cooldown": 10,
"last_fired": 0,
"fire_count": 0
}The channel parameter accepts a channel index (0–15) or "avg" to average all channels.
WebSocket Commands
{"cmd": "webhook_list"}
{"cmd": "webhook_create", "rule": {...}}
{"cmd": "webhook_update", "rule": {"id": "abc123", "enabled": false}}
{"cmd": "webhook_delete", "id": "abc123"}
{"cmd": "webhook_test", "id": "abc123"}