API Reference
Integrate with the Conzent Consent Management Platform. These endpoints power the consent banner, geolocation targeting, consent audit logging, and cookie scanning.
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.
X-Api-Key header. The key must match the SCANNER_WEBHOOK_SECRET environment variable. | Auth Method | Used By | How |
|---|---|---|
| None | Health Check, Geolocation | No authentication required |
| Website Key | Pageview, Consent, Scan Data | Pass key in request body |
| API Key | Scan Webhook | X-Api-Key header |
Response Format
API responses use two formats depending on the endpoint:
Standard Response
Used by Health Check and Scan Webhook.
{
"success": true,
"data": {
"status": "ok"
}
} Lightweight Response
Used by beacon endpoints (Pageview, Consent, Scan Data) for minimal overhead.
{
"status": "ok"
} {"status": "ignored"} with HTTP 200 to avoid errors in navigator.sendBeacon(). Health Check
Returns the health status of the application and backing services. Use for monitoring, load balancer checks, and Docker healthcheck probes.
Response
{
"success": true,
"data": {
"status": "ok",
"services": {
"database": true,
"redis": true
},
"environment": "production",
"timestamp": "2026-03-16T12:00:00+00:00"
}
} {
"success": true,
"data": {
"status": "degraded",
"services": {
"database": true,
"redis": false
}
}
} Example
curl https://your-instance.example.com/health Geolocation
Returns the visitor's country code and EU membership status. Used by the consent script to apply geo-targeted regulations (GDPR, CCPA).
Response Fields
| Field | Type | Description |
|---|---|---|
| country | string | ISO 3166-1 alpha-2 code (lowercase) |
| in_eu | boolean | Whether the country is in the EU |
Response
{
"country": "dk",
"in_eu": true
} Example
curl https://your-instance.example.com/api/v1/geo_ip 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.
Request Body multipart/form-data
| Parameter | Type | Required | Description |
|---|---|---|---|
| key | string | Required | Your site's website key |
| request_type | string | Required | banner_load or banner_view |
| log_time | integer | Optional | Unix timestamp of the event |
| payload | JSON string | Optional | Object with consent_session_id, banner_id, url, cookies |
Response
{
"status": "ok"
} Example
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)" Consent Log
Records the GDPR consent audit trail when a visitor accepts, rejects, or customises consent. This is the primary compliance endpoint.
Request Body multipart/form-data
| Parameter | Type | Required | Description |
|---|---|---|---|
| key | string | Required | Your site's website key |
| conzent_id | string | Required | Session identifier (40-char random string) |
| log | JSON string | Optional | Consent choices per cookie category |
| consented_domain | string | Optional | Domain where consent was given |
| cookie_list_version | string | Optional | Cookie list version hash at consent time |
| language | string | Optional | Visitor's language code |
| country | string | Optional | Visitor's country code |
| consent_time | string | Optional | Client-side timestamp |
| tcf_data | string | Optional | IAB TCF v2.2 consent string |
| gacm_data | string | Optional | Google Consent Mode v2 data |
| variant_id | integer | Optional | A/B test variant ID |
Response
{
"status": "ok"
} Example
curl -X POST https://your-instance.example.com/api/v1/consent \
-F "key=YOUR_WEBSITE_KEY" \
-F "conzent_id=a1b2c3d4e5f6..." \
-F 'log=[{"category":"analytics","consented":true}]' \
-F "consented_domain=example.com" \
-F "language=en" \
-F "country=dk" 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.
Request Body multipart/form-data
| Parameter | Type | Required | Description |
|---|---|---|---|
| key | string | Required | Your site's website key |
| payload | JSON string | Required | Scan data object (see below) |
Payload Structure
{
"scan_id": 123,
"action": "runscan",
"scan_url": "https://example.com/",
"consent_phase": "pre_consent",
"data": {
"cookies": [
{ "name": "_ga", "domain": ".example.com" }
]
}
} Response
{
"status": "ok"
} Example
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/"}' 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.
Headers
| Header | Required | Description |
|---|---|---|
| X-Api-Key | Required | Must match SCANNER_WEBHOOK_SECRET |
| Content-Type | Required | application/json |
Request Body application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| action | string | Optional | webhook (default), runscan, or client_scan |
| scan_id | integer | Conditional | Required for runscan / client_scan |
| scan_url | string | Conditional | URL that was scanned |
| data | object | Optional | Scan result data (cookies, scripts) |
Response
{
"success": true,
"data": {
"status": "processed"
}
} Error
{
"success": false,
"error": "Unauthorized"
} Example
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"}
]
}
}'