API Reference
Services
Services represent third-party tracking tools detected on your site (Google Analytics, Facebook Pixel, etc.). Each service belongs to a cookie category and has associated cookies. Services are typically created automatically from scan results.
GET
List services
GET /sites/{id}/services
Returns all detected services and their cookies for a site.
Path parameters
idstringrequiredSite ID (UUID)
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Service ID (UUID) |
siteId | string | Parent site ID |
categoryId | string | The cookie category this service belongs to |
slug | string | URL-safe identifier (e.g. google-analytics) |
label | string | Display name (e.g. "Google Analytics") |
description | string | What this service does |
privacyPolicyUrl | string | Link to the service's privacy policy |
logoUrl | string | Service logo URL |
cookies | array | Cookies set by this service |
curl https://api.consentlayer.com/api/v1/sites/e1a2b3c4-d5e6-7f89-0a1b-2c3d4e5f6789/services \
-H "Authorization: Bearer cl_key_live_a8f2b9c4d1e6f3a7"const res = await fetch(
`https://api.consentlayer.com/api/v1/sites/${siteId}/services`,
{ headers: { Authorization: 'Bearer cl_key_live_a8f2b9c4d1e6f3a7' } },
);
const services = await res.json();import requests
res = requests.get(
f"https://api.consentlayer.com/api/v1/sites/{site_id}/services",
headers={"Authorization": "Bearer cl_key_live_a8f2b9c4d1e6f3a7"},
)
services = res.json()Response 200
[
{
"id": "svc-1234-abcd-ef56-7890abcd1234",
"siteId": "e1a2b3c4-d5e6-7f89-0a1b-2c3d4e5f6789",
"categoryId": "d2e3f4a5-b6c7-8901-def0-234567890123",
"slug": "google-analytics",
"label": "Google Analytics",
"description": "Web analytics service that tracks and reports website traffic",
"privacyPolicyUrl": "https://policies.google.com/privacy",
"logoUrl": "https://api.consentlayer.com/logos/google-analytics.svg",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z",
"cookies": [
{
"name": "_ga",
"duration": "2 years",
"description": "Distinguishes unique users"
}
]
}
]DELETE
Delete a service
DELETE /sites/{id}/services/{serviceId}
Deletes a service and all its associated cookies.
Path parameters
idstringrequiredSite ID (UUID)
serviceIdstringrequiredService ID (UUID)
Error responses
| Status | Description |
|---|---|
404 | Service not found |
curl -X DELETE https://api.consentlayer.com/api/v1/sites/e1a2b3c4-d5e6-7f89-0a1b-2c3d4e5f6789/services/svc-1234-abcd-ef56-7890abcd1234 \
-H "Authorization: Bearer cl_key_live_a8f2b9c4d1e6f3a7"const res = await fetch(
`https://api.consentlayer.com/api/v1/sites/${siteId}/services/${serviceId}`,
{
method: 'DELETE',
headers: { Authorization: 'Bearer cl_key_live_a8f2b9c4d1e6f3a7' },
},
);
const result = await res.json();import requests
res = requests.delete(
f"https://api.consentlayer.com/api/v1/sites/{site_id}/services/{service_id}",
headers={"Authorization": "Bearer cl_key_live_a8f2b9c4d1e6f3a7"},
)
result = res.json()Response 200
{
"success": true
}