ConsentLayer
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

idstringrequired

Site ID (UUID)

Response fields

FieldTypeDescription
idstringService ID (UUID)
siteIdstringParent site ID
categoryIdstringThe cookie category this service belongs to
slugstringURL-safe identifier (e.g. google-analytics)
labelstringDisplay name (e.g. "Google Analytics")
descriptionstringWhat this service does
privacyPolicyUrlstringLink to the service's privacy policy
logoUrlstringService logo URL
cookiesarrayCookies 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

idstringrequired

Site ID (UUID)

serviceIdstringrequired

Service ID (UUID)

Error responses

StatusDescription
404Service 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
}