Skip to content

Webhooks

Deprecated: The standalone Webhooks page (/webhooks) now shows an EmptyStateMessage (“Los webhooks se gestionan desde Reglas” → Ir a Reglas /rules). Create webhooks as Rule Actions instead.

Preferred way: Rule with Webhook Action

In Rules (/rules/new → CreateEditRulePage.vue):

  1. Choose a patient and a trigger (e.g. glucose > 200 or always).
  2. Pick up to 3 action services (e.g. Webhook via webhook.provider.ts + Telegram + Home Assistant).
  3. Configure each action payload (URL, method, headers, body with {{sgv}} variables).

The engine (rule.engine.ts + RuleEngine) evaluates triggerConditions and executes each rule_action.payload in executionOrder order via IntegrationFactory (max 3 actions per rule, MAX_ACTIONS_PER_RULE).

Legacy standalone webhooks (removed)

  • The old tables webhooks / webhook_logs, their API routes (/api/v1/webhooks) and the per-reading triggers were removed (migration 0061). The UI at WebhooksPage.vue (/webhooks) only shows the notice pointing to Rules. (The session-authenticated /api/v1/wsChannels routes are unrelated: they manage dashboard WebSocket channels, mirrored for API keys as GET/POST /api/v1/public/channels — see the API reference.)
  • Payload (when used via Rules) remains:
{
"event": "glucose.reading",
"patient": { "id": "uuid", "name": "John Doe" },
"reading": { "value": 8.2, "unit": "mmol/L", "trend": "rising" }
}
  • Retry: 3× exponential backoff, X-Levelcast-Signature: sha256=... HMAC.

Use Rules for all automations.