Documentation · Prynt Reveal

Webhooks

Every delivery is signed with the endpoint's secret. Verify the signature, reject stale timestamps, and you can trust the payload came from Prynt and was not altered.

Delivery

Add an endpoint in the console (Integrations → Webhook). You receive the secret once; store it where you keep other credentials. Deliveries are POST requests with a JSON body and three headers:

POST https://your-server.example/prynt
X-Prynt-Event: reveal.company_identified
X-Prynt-Timestamp: 1762164000
X-Prynt-Signature: sha256=3f2a…9c
Content-Type: application/json

{"type":"reveal.company_identified","data":{…},"createdAt":"2026-11-03T10:00:00Z"}
HeaderMeaning
X-Prynt-EventThe event type: reveal.company_identified, reveal.hot_lead, reveal.person_verified, reveal.session_ended (more arrive with segments; the console's event picker is the source of truth)
X-Prynt-TimestampUnix seconds when the delivery was signed — reject if more than 5 minutes away from your clock
X-Prynt-Signaturesha256= + hex HMAC-SHA256 with your secret over <timestamp>.<raw body>

Body: { "type": "<event>", "data": { … }, "createdAt": "<ISO 8601>" }. Respond with any 2xx promptly; a non-2xx response or a timeout is retried up to 3 attempts in total. Each delivery is visible in the console with its attempts, status code and a masked copy of the payload, and can be replayed.

Verifying the signature

Compute HMAC_SHA256(secret, timestamp + "." + raw_body) and compare it in constant time with the header. Always use the **raw** request bytes: re-serialising the JSON changes whitespace and key order and breaks the signature.

Python (Flask)

import hmac, hashlib, time
from flask import Flask, request, abort

app = Flask(__name__)
SECRET = os.environ["PRYNT_WEBHOOK_SECRET"]   # the endpoint's secret shown once in the console

@app.post("/prynt")
def prynt_webhook():
    ts = request.headers.get("X-Prynt-Timestamp", "")
    sig = request.headers.get("X-Prynt-Signature", "")
    body = request.get_data()                  # raw bytes — never re-serialise the JSON
    if not ts.isdigit() or abs(time.time() - int(ts)) > 300:
        abort(400)                             # replay window: 5 minutes
    expected = "sha256=" + hmac.new(SECRET.encode(), f"{ts}.".encode() + body, hashlib.sha256).hexdigest()
    if not hmac.compare_digest(expected, sig):
        abort(401)
    event = request.get_json()
    # event["type"], event["data"], event["createdAt"]
    return "", 204

Node (Express)

import { createHmac, timingSafeEqual } from 'node:crypto';
import express from 'express';

const app = express();
const SECRET = process.env.PRYNT_WEBHOOK_SECRET;

// Keep the raw body: the signature covers the bytes Prynt sent, not a re-serialised object.
app.post('/prynt', express.raw({ type: '*/*' }), (req, res) => {
  const ts = String(req.get('X-Prynt-Timestamp') || '');
  const sig = String(req.get('X-Prynt-Signature') || '');
  if (!/^\d+$/.test(ts) || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return res.sendStatus(400);
  const expected = 'sha256=' + createHmac('sha256', SECRET).update(ts + '.').update(req.body).digest('hex');
  const a = Buffer.from(expected), b = Buffer.from(sig);
  if (a.length !== b.length || !timingSafeEqual(a, b)) return res.sendStatus(401);
  const event = JSON.parse(req.body.toString('utf8'));
  // event.type, event.data, event.createdAt
  res.sendStatus(204);
});

PHP

<?php
$secret = getenv('PRYNT_WEBHOOK_SECRET');
$ts  = $_SERVER['HTTP_X_PRYNT_TIMESTAMP'] ?? '';
$sig = $_SERVER['HTTP_X_PRYNT_SIGNATURE'] ?? '';
$body = file_get_contents('php://input');          // raw body

if (!ctype_digit($ts) || abs(time() - (int) $ts) > 300) { http_response_code(400); exit; }
$expected = 'sha256=' . hash_hmac('sha256', $ts . '.' . $body, $secret);
if (!hash_equals($expected, $sig)) { http_response_code(401); exit; }

$event = json_decode($body, true);
// $event['type'], $event['data'], $event['createdAt']
http_response_code(204);

Go

package main

import (
	"crypto/hmac"
	"crypto/sha256"
	"encoding/hex"
	"io"
	"math"
	"net/http"
	"os"
	"strconv"
	"time"
)

func pryntWebhook(w http.ResponseWriter, r *http.Request) {
	secret := os.Getenv("PRYNT_WEBHOOK_SECRET")
	ts, sig := r.Header.Get("X-Prynt-Timestamp"), r.Header.Get("X-Prynt-Signature")
	body, _ := io.ReadAll(r.Body)
	t, err := strconv.ParseInt(ts, 10, 64)
	if err != nil || math.Abs(float64(time.Now().Unix()-t)) > 300 {
		http.Error(w, "stale", http.StatusBadRequest)
		return
	}
	mac := hmac.New(sha256.New, []byte(secret))
	mac.Write([]byte(ts + "."))
	mac.Write(body)
	expected := "sha256=" + hex.EncodeToString(mac.Sum(nil))
	if !hmac.Equal([]byte(expected), []byte(sig)) {
		http.Error(w, "bad signature", http.StatusUnauthorized)
		return
	}
	// json.Unmarshal(body, &event) → event.Type, event.Data, event.CreatedAt
	w.WriteHeader(http.StatusNoContent)
}

Ruby (Sinatra)

require 'openssl'
require 'json'

post '/prynt' do                      # Sinatra; Rails: request.raw_post + request.headers
  secret = ENV.fetch('PRYNT_WEBHOOK_SECRET')
  ts  = request.env['HTTP_X_PRYNT_TIMESTAMP'].to_s
  sig = request.env['HTTP_X_PRYNT_SIGNATURE'].to_s
  body = request.body.read                  # raw body

  halt 400 unless ts =~ /\A\d+\z/ && (Time.now.to_i - ts.to_i).abs <= 300
  expected = 'sha256=' + OpenSSL::HMAC.hexdigest('SHA256', secret, "#{ts}.#{body}")
  halt 401 unless Rack::Utils.secure_compare(expected, sig)

  event = JSON.parse(body)
  # event['type'], event['data'], event['createdAt']
  status 204
end

Good practice

  • Acknowledge fast (2xx) and process asynchronously; a slow handler is retried and you will see duplicates.
  • Be idempotent: the same delivery can arrive twice (retry after a timeout, or a manual replay). Key on data.account.id + type + createdAt.
  • Rotate the secret from the console if it leaks; old deliveries keep their original signature in the log.
  • People data (reveal.person_verified) only ever comes from first-party identities (your forms, logins, CRM import); treat it like your own customer data.

Next: Email links

Last updated 2026-11-03 · Limits · Visitor opt-out