Skip to Content
IntegrationsWebhooks

Webhooks

HTTP callbacks fired when EEG conditions are met. Build rules in the dashboard or via WebSocket commands.

Trigger Types

TypeFires when…
band_power_aboveBand power exceeds threshold
band_power_belowBand power drops below threshold
amplitude_abovePeak amplitude exceeds threshold
amplitude_belowPeak amplitude drops below threshold
band_ratio_aboveBand ratio (e.g. β/θ) exceeds threshold
band_ratio_belowBand 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

  1. Client-side evaluation — the dashboard evaluates rules every 1 second
  2. Computes FFT on the rule’s target channel(s)
  3. Checks condition: band_power > threshold, etc.
  4. Sends webhook_fire to server if triggered
  5. Server relays HTTP — enforces cooldown, fires request in thread pool
  6. 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"}