Webhooks
Create one with POST /webhooks (scope webhooks:manage). The signing secret is returned once.
Events: note.created, note.updated, note.deleted, folder.created, folder.updated, folder.deleted.
json
{ "id": "…", "event": "note.updated", "created_at": "2026-12-06T18:00:00.000Z",
"data": { "id": "note-id", "type": "note", "seq": 1234 } }Payloads carry ids only. Fetch the note with the API if you need its content.
Verify the signature
Header: X-PalmNotes-Signature: t=<unix>,v1=<hex>, where v1 = HMAC_SHA256(secret, "<t>.<raw body>").
ts
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verify(secret: string, header: string, rawBody: string, toleranceSec = 300) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
if (Math.abs(Date.now() / 1000 - Number(parts.t)) > toleranceSec) return false;
const expected = createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
return timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 ?? ''));
}python
import hmac, hashlib, time
def verify(secret: str, header: str, raw_body: bytes, tolerance_sec: int = 300) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
if abs(time.time() - int(parts["t"])) > tolerance_sec:
return False
signed = parts["t"].encode() + b"." + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts.get("v1", ""))Delivery
- HTTPS only; private and internal addresses are rejected.
- Respond with any
2xxquickly. - Failures retry 5 times (30 s, 2 min, 10 min, 1 h, 6 h). After 10 consecutive failed deliveries the webhook is deactivated; re-enable it with
PATCH {"active": true}.