Webhooks
A signed post to your endpoint when the risk level moves, a peak is set or beaten, or a forecast updates. Create one below, no sign-up.
Verify a webhook in 6 lines
# X-Watt-Signature: t=<unix>,v1=<hex> v1 = HMAC-SHA256(secret, f"{t}.{raw_body}")
import hmac, hashlib, time
def verify(secret, sig_header, raw_body, tolerance=300):
parts = dict(p.split("=", 1) for p in sig_header.split(","))
if abs(time.time() - int(parts["t"])) > tolerance: return False # replay guard
expected = hmac.new(secret.encode(), f"{parts['t']}.{raw_body}".encode(), hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts["v1"])The management endpoints are in the API reference.