Webhook Reference

Contract v1.0.0
Back to board

Outbound Signed Webhooks

Every field rep voice action writes an append-only event record and delivers a signed HTTP POST. When no external receiver is configured, events deliver to the built-in echo receiver at /api/webhooks/echo.

# Signed headers

HeaderDescription
x-rep-eventEvent type name from the catalog below.
x-rep-deliveryUnique event delivery identifier (evt_...).
x-rep-timestampUnix epoch seconds when signed (reject drift over 300s).
x-rep-signaturesha256=<hex HMAC-SHA256 of "<timestamp>.<raw body>">.

# Verification snippets

Node.js

javascript
import { createHmac, timingSafeEqual } from "node:crypto";

export function verifyRepWebhook(rawBody, tsHeader, sigHeader, secret) {
  if (Math.abs(Math.floor(Date.now() / 1000) - Number(tsHeader)) > 300) return false;
  const expected = "sha256=" + createHmac("sha256", secret).update(`${tsHeader}.${rawBody}`).digest("hex");
  const a = Buffer.from(String(sigHeader || ""), "utf8");
  const b = Buffer.from(expected, "utf8");
  return a.length === b.length && timingSafeEqual(a, b);
}

Python

python
import hashlib, hmac, time

def verify_rep_webhook(raw_body: bytes, ts_header: str, sig_header: str, secret: str) -> bool:
    if abs(int(time.time()) - int(ts_header)) > 300:
        return False
    expected = "sha256=" + hmac.new(secret.encode(), f"{ts_header}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(sig_header or "", expected)

# Event catalog

All 11 event types emitted by the voice line and board.

# call.started

json
{
  "id": "evt_sample_call_started",
  "type": "call.started",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "call": {
      "call_id": "call_demo_001",
      "status": "live",
      "caller": {
        "display": "Audrey Miller",
        "territory": "Mid-Atlantic and Southeast",
        "number_masked": "(916) ***-0111"
      }
    }
  }
}

# call.completed

json
{
  "id": "evt_sample_call_completed",
  "type": "call.completed",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "call": {
      "call_id": "call_demo_001",
      "status": "ended",
      "outcome": "note_logged",
      "duration_seconds": 62
    }
  }
}

# note.logged

json
{
  "id": "evt_sample_note_logged",
  "type": "note.logged",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "note": {
      "id": "NOTE-5001",
      "account_name": "University of Florida",
      "contact_name": "Dr. David Okonkwo",
      "summary": "Requested revised Q1 single-cell ATAC-seq scope."
    },
    "approval": {
      "id": "GATE-8001",
      "kind": "salesforce_activity",
      "status": "pending"
    }
  }
}

# contact.added

json
{
  "id": "evt_sample_contact_added",
  "type": "contact.added",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "contact": {
      "contact_id": "CNT-6001",
      "name": "Dr. Samuel Ortiz",
      "role": "Sample Submitter",
      "staged": true
    },
    "approval": {
      "id": "GATE-8002",
      "kind": "salesforce_contact_new",
      "status": "pending"
    }
  }
}

# contact.updated

json
{
  "id": "evt_sample_contact_updated",
  "type": "contact.updated",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "contact_id": "cnt_okonkwo",
    "contact_name": "Dr. David Okonkwo",
    "field": "phone",
    "old_value": "(352) 555-0131",
    "new_value": "(352) 555-0199",
    "approval": {
      "id": "GATE-8003",
      "kind": "salesforce_contact_update",
      "status": "pending"
    }
  }
}

# followup.created

json
{
  "id": "evt_sample_followup_created",
  "type": "followup.created",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "followup": {
      "id": "FUP-7001",
      "account_name": "Vanguard BioTherapeutics Inc.",
      "contact_name": "Marcus Vance",
      "due_date": "2026-12-08",
      "task": "Confirm Q1 WGS batch count"
    },
    "approval": {
      "id": "GATE-8004",
      "kind": "salesforce_task",
      "status": "pending"
    }
  }
}

# drafts.approved

json
{
  "id": "evt_sample_drafts_approved",
  "type": "drafts.approved",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "count": 4,
    "sent": false,
    "approved_by": "Audrey Miller",
    "drafts": [
      {
        "draft_id": "d3",
        "who": "Dr. David Okonkwo",
        "sent": false
      }
    ]
  }
}

# approval.updated

json
{
  "id": "evt_sample_approval_updated",
  "type": "approval.updated",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "approval": {
      "id": "GATE-8001",
      "status": "approved",
      "decided_by": "Operator"
    },
    "decision": "approved",
    "live_crm_written": false
  }
}

# escalation.created

json
{
  "id": "evt_sample_escalation_created",
  "type": "escalation.created",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "escalation": {
      "id": "ESC-1001",
      "reason": "pricing",
      "priority": "urgent",
      "transferred": false
    }
  }
}

# escalation.claimed

json
{
  "id": "evt_sample_escalation_claimed",
  "type": "escalation.claimed",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "escalation": {
      "id": "ESC-1001",
      "status": "claimed",
      "claimed_by": "Sales Lead"
    },
    "changes": [
      "status",
      "claimed_by"
    ]
  }
}

# escalation.resolved

json
{
  "id": "evt_sample_escalation_resolved",
  "type": "escalation.resolved",
  "created_at": "2026-12-04T15:30:00.000Z",
  "tenant": "novogene",
  "data": {
    "escalation": {
      "id": "ESC-1001",
      "status": "resolved",
      "resolved_at": "2026-12-04T15:40:00.000Z"
    },
    "changes": [
      "status",
      "resolved_at"
    ]
  }
}