API Reference
API Reference
The ConsentLayer API is a REST API that uses JSON request/response bodies and standard HTTP methods. All endpoints require authentication via API key.
Base URL: https://api.consentlayer.com/api/v1
Quick reference
Sites
| Method | Endpoint | Description |
|---|---|---|
| GET | /sites | List all sites for the authenticated account |
| GET | /sites/{id} | Get a single site by ID |
Banner
| Method | Endpoint | Description |
|---|---|---|
| GET | /sites/{id}/banner | Get the banner configuration for a site |
| PATCH | /sites/{id}/banner | Update the banner configuration |
Categories
| Method | Endpoint | Description |
|---|---|---|
| GET | /sites/{id}/categories | List all cookie categories for a site |
| POST | /sites/{id}/categories | Create a new cookie category |
| PATCH | /sites/{id}/categories/{catId} | Update a cookie category |
| DELETE | /sites/{id}/categories/{catId} | Delete a cookie category |
Services
| Method | Endpoint | Description |
|---|---|---|
| GET | /sites/{id}/services | List all detected services and their cookies |
| DELETE | /sites/{id}/services/{serviceId} | Delete a service and its cookies |
Scanner
| Method | Endpoint | Description |
|---|---|---|
| POST | /sites/{id}/scan | Trigger a new cookie/script scan |
| GET | /sites/{id}/scans | List all scan results |
| GET | /sites/{id}/scans/{scanId} | Get a single scan result |
| POST | /sites/{id}/scans/{scanId}/configure | Auto-create services from scan results |
Consent Records
| Method | Endpoint | Description |
|---|---|---|
| GET | /sites/{id}/consent-records | List paginated consent records with date filtering |