Webhooks — CRM integration

One universal outbound webhook covers any CRM. Pravia sends lead.created to your n8n / Make / Zapier / backend — you route it to AmoCRM, Bitrix24, HubSpot, Pipedrive, etc.

Pravia ── lead.created ──► Webhook ──► n8n / Make / Zapier / Backend ──► CRM

Payload — lead.created v1

{
  "event": "lead.created",
  "version": "1",
  "idempotencyKey": "lead:<uuid>",
  "timestamp": "2026-08-18T10:00:00.000Z",
  "tenantId": "user_xxx",
  "botId": "uuid",
  "botName": "Support bot",
  "lead": {
    "id": "uuid",
    "contactName": "Ivan" | null,
    "contactInfo": "+7... / email / t.me/...",
    "taskDescription": "...",
    "siteUrl": "client-site.com" | null,
    "status": "new",
    "createdAt": "ISO8601"
  }
}

Headers

Signature is HMAC-SHA256(secret, timestamp + "." + rawBody). Verify v1= after t=, use timingSafeEqual and a ±5 min window on X-Pravia-Timestamp — replay protection.

Verify signature (Node.js)

import { createHmac, timingSafeEqual } from "crypto";

function verifyWithTimestamp(rawBody, signature, timestamp, secret, toleranceSec = 300) {
  const now = Math.floor(Date.now() / 1000);
  const ts = parseInt(timestamp, 10);
  if (Math.abs(now - ts) > toleranceSec) return false; // replay guard
  const m = signature.match(/v1=([a-f0-9]+)/i);
  if (!m) return false;
  const expected = createHmac("sha256", secret).update(timestamp + "." + rawBody, "utf8").digest("hex");
  return timingSafeEqual(Buffer.from(expected, "utf8"), Buffer.from(m[1], "utf8"));
}
// rawBody = exact request body string, not re-stringified JSON
// timestamp = X-Pravia-Timestamp (unix seconds), check ±300s
// version is in payload.version and header X-Pravia-Version: 1

n8n quick start

  1. Webhook node → URL from Pravia dashboard → n8n gives you a URL → paste into Pravia Webhooks.
  2. Add CRM node (AmoCRM / Bitrix24 / HubSpot) → map lead.contactName, lead.contactInfo, etc.
  3. Save in Pravia → Send test → check n8n execution.

Delivery