Skip to main content

Developer REST API & HMAC Webhooks

Consent Shield AI exposes full REST APIs and real-time Webhook feeds for synchronizing consent states with backend databases, CRMs, and data clean rooms.


Generating API Keysโ€‹

  1. Navigate to Dashboard โ†’ Settings โ†’ API Keys.
  2. Click Generate New API Secret.
  3. Copy your key: cs_live_sec_....

Webhook Event Typesโ€‹

Event NameTrigger Condition
consent.grantedVisitor opted into one or more non-essential categories.
consent.revokedVisitor updated preferences to reject tracking.
gpc.signal_detectedVisitor browser transmitted a Global Privacy Control header.
tracker.quarantinedA new unclassified script was detected and blocked pre-DOM.

Verifying Webhook HMAC Signatures (Node.js)โ€‹

const crypto = require('crypto');

function verifyConsentWebhook(payload, signatureHeader, webhookSecret) {
const computedHash = crypto
.createHmac('sha256', webhookSecret)
.update(payload, 'utf8')
.digest('hex');

return crypto.timingSafeEqual(
Buffer.from(computedHash),
Buffer.from(signatureHeader)
);
}