Webhooks & Security
Zonrad dispatches webhooks to your servers when long-running tasks finish or require approval.
Verifying Signatures
Every webhook includes an X-Zonrad-Signature header computed as an HMAC-SHA256 hex digest of the raw request payload using your webhook signing secret.
import hmacimport hashlib
def verify_zonrad_webhook(raw_payload: bytes, signature_header: str, secret: str) -> bool: computed_signature = hmac.new( secret.encode('utf-8'), raw_payload, hashlib.sha256 ).hexdigest() return hmac.compare_digest(computed_signature, signature_header)const crypto = require('crypto');
function verifyZonradWebhook(rawPayload, signatureHeader, secret) { const computedSignature = crypto .createHmac('sha256', secret) .update(rawPayload) .digest('hex'); return crypto.timingSafeEqual( Buffer.from(computedSignature, 'utf8'), Buffer.from(signatureHeader, 'utf8') );}