Documentation

Everything you need to know for quick Consentio implementation

Public API

Complete Consentio REST API documentation for developers

Overview

The Consentio Public API provides programmatic access to your consent data. You can use it for:

  • Integration with your own analytics tools
  • Data export for reports
  • Automating website management
  • Creating custom dashboards
Important: The Public API is only available on the Pro plan. The Free plan does not have API access.

Authentication

The API uses API key authentication. Pass the key in the Authorization header:

HTTP Header
Authorization: ApiKey sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Obtaining an API key

  1. Sign in to the Consentio dashboard
  2. Go to Settings → API Keys
  3. Click Generate new key
  4. Copy the key and store it securely
Security: Never share your API key or store it in public repositories. The key provides access to all data in your account.

Base URL

Direct all API requests to:

URL
https://consentio.cz/api/v1

Rate Limiting

The API has a limit on the number of requests per hour:

Plan Requests/hour
Pro 1,000

The response includes headers with rate limit information:

Response Headers
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1704067200

Response format

All responses are in JSON format with a consistent structure:

Successful response

JSON
{
  "success": true,
  "data": { ... }
}

Error response

JSON
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Error description"
  }
}

Endpoints

GET /websites

Returns a list of all websites assigned to your account.

Request example

curl
curl -X GET "https://consentio.cz/api/v1/websites" \
  -H "Authorization: ApiKey sk_live_xxx"

Response example

JSON
{
  "success": true,
  "data": [
    {
      "id": "clx1234567890",
      "name": "My e-shop",
      "domain": "my-eshop.com",
      "description": "Main e-shop",
      "status": "active",
      "cookieCount": 15,
      "consentCount": 1250,
      "consentRate": 78,
      "viewsThisMonth": 450,
      "lastScanAt": "2025-01-15T10:30:00.000Z",
      "createdAt": "2024-06-01T08:00:00.000Z",
      "updatedAt": "2025-01-15T10:30:00.000Z"
    }
  ]
}

GET /websites/:id

Returns details of a specific website including settings.

Parameters

Parameter Type Description
id string Website ID (in URL)

Request example

curl
curl -X GET "https://consentio.cz/api/v1/websites/clx1234567890" \
  -H "Authorization: ApiKey sk_live_xxx"

GET /websites/:id/cookies

Returns a list of cookies detected on the website.

Request example

curl
curl -X GET "https://consentio.cz/api/v1/websites/clx1234567890/cookies" \
  -H "Authorization: ApiKey sk_live_xxx"

GET /analytics

Returns analytics data for a website - consent statistics, geography, devices and trends.

Query parameters

Parameter Type Required Description
websiteId string Yes Website ID
period string No Period: 7d, 30d, 90d, all (default: 30d)

Request example

curl
curl -X GET "https://consentio.cz/api/v1/analytics?websiteId=clx123&period=30d" \
  -H "Authorization: ApiKey sk_live_xxx"

Response example

JSON
{
  "success": true,
  "data": {
    "summary": {
      "totalViews": 1250,
      "consentRate": 78.5,
      "acceptedCount": 850,
      "rejectedCount": 275,
      "customCount": 125,
      "uniqueVisitors": 980,
      "totalImpressions": 2500
    },
    "consentBreakdown": {
      "acceptAll": 68,
      "rejectAll": 22,
      "custom": 10
    },
    "categoryConsent": {
      "necessary": 100,
      "analytics": 72,
      "marketing": 45,
      "functionality": 58
    },
    "geographic": [
      {
        "country": "Czechia",
        "countryCode": "CZ",
        "flag": "🇨🇿",
        "count": 850,
        "percentage": 68
      }
    ],
    "devices": {
      "desktop": 55,
      "mobile": 40,
      "tablet": 5
    },
    "trend": [
      {
        "date": "2025-01-01",
        "views": 45,
        "accepted": 35,
        "rejected": 10
      }
    ],
    "utmBreakdown": {
      "sources": [...],
      "mediums": [...],
      "campaigns": [...]
    }
  }
}

GET /consents

Returns a list of individual consents with pagination.

Query parameters

Parameter Type Required Description
websiteId string Yes Website ID
startDate ISO 8601 No From date (e.g. 2025-01-01)
endDate ISO 8601 No To date
limit number No Number of records (default: 100, max: 1000)
offset number No Records to skip (default: 0)

Request example

curl
curl -X GET "https://consentio.cz/api/v1/consents?websiteId=clx123&limit=50&offset=0" \
  -H "Authorization: ApiKey sk_live_xxx"

Response example

JSON
{
  "success": true,
  "data": [
    {
      "id": "consent_abc123",
      "visitorId": "v_xyz789",
      "action": "ACCEPT_ALL",
      "categories": {
        "necessary": true,
        "analytics": true,
        "marketing": true,
        "functionality": true
      },
      "ipCountry": "CZ",
      "device": "desktop",
      "utmSource": "google",
      "utmMedium": "cpc",
      "utmCampaign": "brand",
      "createdAt": "2025-01-15T14:30:00.000Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 50,
    "total": 1250,
    "hasMore": true
  }
}

POST /consents/export

Exports consents to a CSV or JSON file.

Body parameters

Parameter Type Required Description
websiteId string Yes Website ID
startDate ISO 8601 No From date
endDate ISO 8601 No To date
format string No "csv" or "json" (default: json)

Request example

curl
curl -X POST "https://consentio.cz/api/v1/consents/export" \
  -H "Authorization: ApiKey sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "websiteId": "clx1234567890",
    "startDate": "2025-01-01",
    "endDate": "2025-01-31",
    "format": "csv"
  }' \
  -o consents.csv

GET /account/usage

Returns current account usage vs. plan limits.

Request example

curl
curl -X GET "https://consentio.cz/api/v1/account/usage" \
  -H "Authorization: ApiKey sk_live_xxx"

Response example

JSON
{
  "success": true,
  "data": {
    "plan": "PRO",
    "websites": {
      "used": 3,
      "limit": 15
    },
    "pageviews": {
      "used": 45000,
      "limit": 250000,
      "periodStart": "2025-01-01T00:00:00.000Z",
      "periodEnd": "2025-01-31T23:59:59.999Z"
    },
    "analyticsRetention": "unlimited",
    "scanInterval": "1 day",
    "apiRequests": {
      "used": 150,
      "limit": 1000,
      "resetAt": "2025-01-15T15:00:00.000Z"
    }
  }
}

Error codes

HTTP Status Code Description
400 MISSING_WEBSITE_ID Required websiteId parameter is missing
400 INVALID_FORMAT Invalid export format
401 UNAUTHORIZED Missing or invalid API key
403 API_ACCESS_DENIED Your plan does not have API access
404 WEBSITE_NOT_FOUND Website not found or access denied
429 RATE_LIMIT_EXCEEDED Request limit exceeded
500 INTERNAL_ERROR Internal server error

SDKs and libraries

We are preparing official SDKs for popular languages:

  • JavaScript/TypeScript (npm)
  • Python (pip)
  • PHP (composer)
Tip: Want to be notified when SDKs are released? Follow our news or contact us at [email protected].
Languages