Consent Records API
Last updated: September 8, 2026
Requires an Authorization: Bearer <token> header, see Authentication.
GET /v1/consent/org-stats
Aggregate stats across every domain in the organization: a breakdown by decision type (accept_all/reject_all/custom/withdraw) over the last 30 days, plus raw records from the last 7 days — the same query the dashboard's home page uses.
GET /v1/consent/:domainId/stats
Stats for a single domain over an arbitrary period — required query params from and to (ISO dates). Returns the total record count and a breakdown by decision type.
curl "https://api.cookiestack.dev/v1/consent/DOMAIN_ID/stats?from=2026-08-01&to=2026-08-31" \ -H "Authorization: Bearer eyJhbGciOi..."
GET /v1/consent/:domainId/records
A paginated log of individual consent records for a domain — query params page and limit (default 50). Only available on plans that include the consent log feature (consentLog) — other plans get an access error. Once a plan's monthly record limit is reached, results are capped to the first page with a reduced page size.
Recording consent (used by the widget)
POST /v1/consent/:domainId/record is a public endpoint the widget itself uses to report a visitor's decision. It takes an x-api-key header with the domain's key instead of a Bearer token. You normally don't need to call it directly — the widget does so automatically on every consent change.