API Reference

Integrate with the Conzent Consent Management Platform. These endpoints power the consent banner, geolocation targeting, consent audit logging, and cookie scanning.

Base URL
https://your-instance.example.com

All endpoints are relative to your self-hosted Conzent instance. Replace the base URL with your actual domain.

Authentication

Most endpoints are public — they are called from the consent banner script running on your visitors' browsers.

Endpoints that accept data use a Website Key to identify which site the request belongs to. Find your website key in the Conzent dashboard under Sites.

Scanner Webhook is the only endpoint requiring an API key. Pass it via the X-Api-Key header. The key must match the SCANNER_WEBHOOK_SECRET environment variable.
Auth MethodUsed ByHow
NoneHealth Check, GeolocationNo authentication required
Website KeyPageview, Consent, Scan DataPass key in request body
API KeyScan WebhookX-Api-Key header

Response Format

API responses use two formats depending on the endpoint:

Standard Response

Used by Health Check and Scan Webhook.

JSON
{
  "success": true,
  "data": {
    "status": "ok"
  }
}

Lightweight Response

Used by beacon endpoints (Pageview, Consent, Scan Data) for minimal overhead.

JSON
{
  "status": "ok"
}
Beacon endpoints always return 200. Invalid requests return {"status": "ignored"} with HTTP 200 to avoid errors in navigator.sendBeacon().
GET /health

Health Check

Returns the health status of the application and backing services. Use for monitoring, load balancer checks, and Docker healthcheck probes.

No auth

Response

200 OK
{
  "success": true,
  "data": {
    "status": "ok",
    "services": {
      "database": true,
      "redis": true
    },
    "environment": "production",
    "timestamp": "2026-03-16T12:00:00+00:00"
  }
}
503 — Degraded
{
  "success": true,
  "data": {
    "status": "degraded",
    "services": {
      "database": true,
      "redis": false
    }
  }
}

Example

curl
curl https://your-instance.example.com/health
GET /api/v1/geo_ip

Geolocation

Returns the visitor's country code and EU membership status. Used by the consent script to apply geo-targeted regulations (GDPR, CCPA).

No auth Cached 1hr CORS

Response Fields

FieldTypeDescription
countrystringISO 3166-1 alpha-2 code (lowercase)
in_eubooleanWhether the country is in the EU

Response

200 OK
{
  "country": "dk",
  "in_eu": true
}

Example

curl
curl https://your-instance.example.com/api/v1/geo_ip
POST /api/v1/log

Pageview Beacon

Records pageview and banner-load events. Sent via navigator.sendBeacon() as multipart/form-data. Increments the daily pageview counter and buffers cookie observations for async processing.

Website Key CORS

Request Body multipart/form-data

ParameterTypeRequiredDescription
keystringRequiredYour site's website key
request_typestringRequiredbanner_load or banner_view
log_timeintegerOptionalUnix timestamp of the event
payloadJSON stringOptionalObject with consent_session_id, banner_id, url, cookies

Response

200 OK
{
  "status": "ok"
}

Example

curl
curl -X POST https://your-instance.example.com/api/v1/log \
  -F "key=YOUR_WEBSITE_KEY" \
  -F "request_type=banner_load" \
  -F "log_time=$(date +%s)"
POST /api/v1/scan_data

Scan Data Beacon

Receives client-side cookie scan data. The consent script detects cookies on the visitor's browser and reports them for automatic categorisation. Data is buffered in Redis and processed asynchronously.

Website Key 600 req/min CORS

Request Body multipart/form-data

ParameterTypeRequiredDescription
keystringRequiredYour site's website key
payloadJSON stringRequiredScan data object (see below)

Payload Structure

payload (JSON string)
{
  "scan_id": 123,
  "action": "runscan",
  "scan_url": "https://example.com/",
  "consent_phase": "pre_consent",
  "data": {
    "cookies": [
      { "name": "_ga", "domain": ".example.com" }
    ]
  }
}

Response

200 OK
{
  "status": "ok"
}

Example

curl
curl -X POST https://your-instance.example.com/api/v1/scan_data \
  -F "key=YOUR_WEBSITE_KEY" \
  -F 'payload={"scan_id":123,"action":"runscan","scan_url":"https://example.com/"}'
POST /api/v1/scan-webhook

Scanner Webhook

Receives scan results from external scanner servers when a cookie scan completes. Authenticated via X-Api-Key header matching the SCANNER_WEBHOOK_SECRET environment variable.

API Key

Headers

HeaderRequiredDescription
X-Api-KeyRequiredMust match SCANNER_WEBHOOK_SECRET
Content-TypeRequiredapplication/json

Request Body application/json

ParameterTypeRequiredDescription
actionstringOptionalwebhook (default), runscan, or client_scan
scan_idintegerConditionalRequired for runscan / client_scan
scan_urlstringConditionalURL that was scanned
dataobjectOptionalScan result data (cookies, scripts)

Response

200 OK
{
  "success": true,
  "data": {
    "status": "processed"
  }
}

Error

401 Unauthorized
{
  "success": false,
  "error": "Unauthorized"
}

Example

curl
curl -X POST https://your-instance.example.com/api/v1/scan-webhook \
  -H "X-Api-Key: YOUR_SCANNER_WEBHOOK_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "webhook",
    "scan_id": 456,
    "scan_url": "https://example.com/",
    "data": {
      "cookies": [
        {"name": "_ga", "domain": ".example.com", "category": "analytics"}
      ]
    }
  }'