Webhooks

Receive real-time notifications when consent events occur on your websites.

Overview

Webhooks allow you to receive HTTP POST notifications to your server whenever a consent event happens. This is useful for syncing consent data with your CRM, analytics platform, or compliance system.

Setting Up Webhooks

  1. Go to Integrations in your dashboard
  2. Click Add Webhook
  3. Enter your endpoint URL (must be HTTPS)
  4. Select the events you want to receive
  5. Save and test the webhook

Available Events

EventDescription
consent.givenA visitor has given consent (accepted all or selected categories)
consent.deniedA visitor has denied all optional cookies
consent.updatedA visitor has changed their consent preferences
scan.completedA cookie scan has finished
scan.failedA cookie scan has failed

Payload Format

Each webhook sends a JSON POST request with the following structure:

{
  "event": "consent.given",
  "timestamp": "2025-07-03T12:00:00Z",
  "website_id": "abc-123",
  "data": {
    "visitor_id": "v_xyz789",
    "preferences": {
      "necessary": true,
      "functional": true,
      "analytics": true,
      "marketing": false
    },
    "ip_country": "GB",
    "user_agent": "Mozilla/5.0..."
  }
}

Verifying Webhooks

Each webhook request includes an X-Cookiewise-Signature header containing an HMAC-SHA256 signature of the request body. Verify this signature using your webhook secret to ensure the request is authentic.

Retry Policy

If your endpoint returns a non-2xx status code, Cookiewise will retry the webhook up to 3 times with exponential backoff (1 minute, 5 minutes, 30 minutes).