Documentación / Esencial
Verificar la firma
X-Connect-Signature-256: sha256=HMACSHA256(secret, "<X-Connect-Timestamp>.<cuerpo crudo>"). Calculá el HMAC sobre el timestamp + "." + los bytes crudos del request (re-serializar el JSON cambia el hash) y comparalo en tiempo constante. El timestamp va DENTRO del HMAC → un payload capturado no se puede reenviar; rechazá entregas de más de 5 minutos. El secret (whsec…) se muestra UNA vez al crear el 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"Es el punto donde más gente se traba y donde muchos terminan no validando nada (un agujero de seguridad). Este código está completo y correcto en los 4 lenguajes.
El secret real sale de tu endpoint en Webhooks (se muestra una sola vez; podés rotarlo).