Developer API
Authenticated REST API for managing sites, categories, and consent events.
All /api/v1/* endpoints require an API key via the x-api-key header. API keys are managed in the dashboard and use the ck_ prefix.
Sites
List Sites
GET /api/v1/sitesReturns all sites belonging to the authenticated user.
Create Site
POST /api/v1/sites{
"name": "My Website",
"domain": "example.com",
"config": {}
}Automatically seeds three default categories: Necessary, Analytics, Marketing.
Get Site
GET /api/v1/sites/:siteIdReturns site details and consent categories:
{
"site": { "id": "...", "name": "...", "domain": "...", "status": "active", "config": {} },
"categories": [...]
}Update Site
PATCH /api/v1/sites/:siteId{
"name": "Updated Name",
"domain": "new-domain.com",
"config": {},
"status": "active"
}All fields are optional. At least one must be provided.
Delete Site (Soft)
DELETE /api/v1/sites/:siteIdSets site status to deleted.
Categories
List Categories
GET /api/v1/sites/:siteId/categoriesReturns categories ordered by sortOrder.
Create Category
POST /api/v1/sites/:siteId/categories{
"key": "preferences",
"nameEn": "Preferences",
"descriptionEn": "Remember your settings and preferences.",
"isRequired": false,
"isDefault": true
}Key must match pattern /^[a-z0-9_]{1,50}$/ and be unique within the site.
Update Category
PATCH /api/v1/sites/:siteId/categories/:categoryId{
"nameEn": "Updated Name",
"descriptionEn": "Updated description.",
"isDefault": false
}Delete Category
DELETE /api/v1/sites/:siteId/categories/:categoryIdFails if the category is marked as required.
Reorder Categories
PUT /api/v1/sites/:siteId/categories/reorder{
"order": [
{ "id": "cat-1", "sortOrder": 0 },
{ "id": "cat-2", "sortOrder": 1 },
{ "id": "cat-3", "sortOrder": 2 }
]
}Consent Events
List Consent Events
GET /api/v1/consent/events/:siteId?limit=50&offset=0| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 50 | Results per page |
offset | number | 0 | Pagination offset |
Record Consent Event
POST /api/v1/consent/eventsSame body as the widget events endpoint, but requires API key auth and site ownership verification.