Webhooks

SecondSight tells you when something changes by sending an HTTPS POST to the webhook URL on your partner account. You do not need to poll, although every resource can also be read with a GET.

Events

Event Sent when
quote.updated A quote changes status or options, including an underwriter's decision on a referral.
quote.documents_ready The quote's documents are ready to download.
bind.updated (coming) A bind changes status.
bind.documents_ready (coming) The binder and invoice are ready to download.
policy.issued (coming) A policy is issued.
policy.updated (coming) A policy changes.
endorsement.updated (coming) An endorsement changes status, for example when it is priced.
cancellation.updated (coming) A cancellation changes status.
enrichment.job.completed (coming) An enrichment job finishes. Read the job with GET /v1/enrichment/jobs/{job_id}.

Every body has the same small envelope: ids and statuses only, never names, addresses or premiums.

{
  "id": "9c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "type": "quote.updated",
  "occurred_at": "2026-12-01T14:03:00Z",
  "sequence": 3,
  "data": { "quote_id": "3f2a1b0c-9d8e-4f7a-8b6c-5d4e3f2a1b0c", "status": "quoted" }
}

Read the resource with its GET endpoint for everything else. The resource is the source of truth; the event tells you when to read it.

Delivery

Verifying the signature

Every delivery is signed with your webhook signing secret:

X-SecondSight-Timestamp: 1700000000
X-SecondSight-Signature: sha256=<hex HMAC-SHA256(secret, "<timestamp>.<raw body>")>

To verify a delivery:

  1. Read the raw request body as bytes, before any JSON parsing. Re-serialising the JSON changes the bytes and the signature will not match.
  2. Refuse a timestamp more than 5 minutes from your clock. The timestamp is inside the signed message, so a captured delivery cannot be replayed later with a new time.
  3. Compute HMAC-SHA256(secret, timestamp + "." + raw body) as lowercase hex.
  4. Compare it, in constant time, with each sha256= value in the header. Accept the delivery if any one matches.

When you rotate your signing secret, deliveries for the next 24 hours carry two values, sha256=<new>,sha256=<old>, so a receiver still holding the old secret keeps working. Accepting any matching value handles this with no extra code.

Test vector

Check your implementation against this vector before going live. Each snippet below prints valid for it.

secret: test-signing-secret
timestamp: 1700000000
body: {"job_id":"j1"}
signature: sha256=3120e3a3c1eef81bc1aa667fb72b21463813ea7386342cf912b112aa6fd83e1a
rotation_signature: sha256=3120e3a3c1eef81bc1aa667fb72b21463813ea7386342cf912b112aa6fd83e1a,sha256=ca6cc1de4f7d98ef629e26f263f46b0ee3f4ca770afc6427335f41f806001295
previous_secret: old-signing-secret

body is exactly the 15 bytes shown, with no trailing newline. Pass the timestamp itself as "now" when you test, since the vector is older than 5 minutes. rotation_signature is the header during a rotation: the first value is signed with secret, the second with previous_secret, so a receiver holding either secret accepts it.

Each snippet refuses to run with an empty secret. An empty HMAC key is public knowledge, so a receiver that started without its secret configured would otherwise accept forged events.

Node.js

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

// rawBody: the request body exactly as received (Buffer or string).
export function verifySecondSightSignature(secret, timestamp, rawBody, signatureHeader, nowSeconds = Math.floor(Date.now() / 1000)) {
  if (!secret) throw new Error('webhook signing secret is not configured');
  if (!/^[0-9]+$/.test(timestamp) || Math.abs(nowSeconds - Number(timestamp)) > 300) return false;
  const expected = createHmac('sha256', secret)
    .update(Buffer.concat([Buffer.from(`${timestamp}.`), Buffer.from(rawBody)]))
    .digest();
  return String(signatureHeader).split(',').some((part) => {
    const m = /^sha256=([0-9a-f]{64})$/.exec(part.trim());
    return m !== null && timingSafeEqual(Buffer.from(m[1], 'hex'), expected);
  });
}

Python

Python 3.10 or later.

import hashlib
import hmac
import re
import time


def verify_secondsight_signature(secret: str, timestamp: str, raw_body: bytes, signature_header: str, now: int | None = None) -> bool:
    """raw_body: the request body exactly as received, as bytes."""
    if not secret:
        raise ValueError("webhook signing secret is not configured")
    now = int(time.time()) if now is None else now
    if not re.fullmatch(r"[0-9]+", timestamp) or abs(now - int(timestamp)) > 300:
        return False
    expected = hmac.new(secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256).hexdigest()
    for part in signature_header.split(","):
        m = re.fullmatch(r"sha256=([0-9a-f]{64})", part.strip())
        if m and hmac.compare_digest(m.group(1), expected):
            return True
    return False

C#

using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;

static class SecondSightWebhook
{
    // rawBody: the request body exactly as received, as bytes.
    public static bool Verify(string secret, string timestamp, byte[] rawBody, string signatureHeader, long? nowSeconds = null)
    {
        if (string.IsNullOrEmpty(secret)) throw new InvalidOperationException("webhook signing secret is not configured");
        long now = nowSeconds ?? DateTimeOffset.UtcNow.ToUnixTimeSeconds();
        if (!Regex.IsMatch(timestamp, "^[0-9]+$") || !long.TryParse(timestamp, out long ts) || Math.Abs(now - ts) > 300) return false;
        byte[] message = [.. Encoding.UTF8.GetBytes(timestamp + "."), .. rawBody];
        byte[] expected = HMACSHA256.HashData(Encoding.UTF8.GetBytes(secret), message);
        foreach (string part in signatureHeader.Split(','))
        {
            Match m = Regex.Match(part.Trim(), "^sha256=([0-9a-f]{64})$");
            if (m.Success && CryptographicOperations.FixedTimeEquals(Convert.FromHexString(m.Groups[1].Value), expected)) return true;
        }
        return false;
    }
}

Enrichment callbacks

Partners already receiving job callbacks from the older enrichment endpoint keep the same headers and the same signature, so an existing verifier works unchanged. On the Partner API the body is the thin enrichment.job.completed event above; read the job with GET /v1/enrichment/jobs/{job_id}.