Documentation / Essential
Verify the signature
X-Connect-Signature-256: sha256=HMACSHA256(secret, "<X-Connect-Timestamp>.<raw body>"). Compute the HMAC over the timestamp + "." + the raw bytes of the request (re-serializing the JSON changes the hash) and compare it in constant time. The timestamp is INSIDE the HMAC → a captured payload cannot be replayed; reject deliveries older than 5 minutes. The secret (whsec…) is shown ONCE when you create the endpoint.
# Verify X-Connect-Signature-256 on the server that RECEIVES the webhook.
# The header is: sha256=HMAC_SHA256(secret, "<X-Connect-Timestamp>.<raw body>")
# Recompute it over the timestamp + "." + the EXACT raw request body and compare.
# (Shell alone can't compare in constant time — use one of the snippets below.)
echo -n "${TIMESTAMP}.${RAW_BODY}" | openssl dgst -sha256 -hmac "whsec_YOUR_ENDPOINT_SECRET"This is where most people get stuck and where many end up validating nothing (a security hole). This code is complete and correct in all four languages.
The real secret comes from your endpoint in Webhooks (shown once; you can rotate it).