Skip to content

Consent API Reference

Last updated: March 19, 20268 min readAdvancedDeveloper

The Consent API lets you record consent events and query consent history programmatically.

Record Consent

javascript
POST /api/v1/consent/record

{
  "domain": "example.com",
  "visitorId": "abc123",
  "consent": {
    "analytics": true,
    "marketing": false,
    "preferences": true
  },
  "gpcDetected": false
}

Query Records

javascript
GET /api/v1/consent/records?domain=example.com&from=2026-01-01&to=2026-03-01&page=1&limit=50

Response Format

javascript
{
  "records": [
    {
      "id": "...",
      "domain": "example.com",
      "consent": { "analytics": true, "marketing": false },
      "createdAt": "2026-03-18T..."
    }
  ],
  "total": 1234,
  "page": 1,
  "pages": 25
}

Query Filters

  • domain — Filter by domain name
  • from/to — Date range (ISO 8601)
  • page/limit — Pagination (default: page=1, limit=50)
  • consentState — Filter by specific consent values
Use cursor-based pagination for large datasets. The response includes a 'nextCursor' field when more results are available.

Next Steps

Was this article helpful?