# Get cookie consent config

**Publié le** : 2026-05-12
**Catégorie** : Analytics & Tracking

## `GET /cookie-consent/config`

**Get cookie consent config**

Return the cookie-consent banner configuration for the site:
layout, theme, primary color, texts, declared categories, and the
list of third-party scripts gated on consent. Consumed by the
consent widget at boot time.

### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |


> **Notes:** Cache: `Cache-Control: public, max-age=300`. Rate-limit bucket:
> general. When no settings row exists for the site, the controller
> returns a hardcoded default config with the same shape (simpler
> `categories` array).

### Examples

```curl
curl "https://api.lynkow.com/public/{siteId}/cookie-consent/config"
```

```javascript
const res = await fetch(`https://api.lynkow.com/public/${siteId}/cookie-consent/config`)
const { data } = await res.json()
```

### Response Example

```json
"{\n  \"data\": {\n    \"enabled\": true,\n    \"consentMode\": \"opt-in\",\n    \"showOnFirstVisit\": true,\n    \"position\": \"bottom-right\",\n    \"layout\": \"floating\",\n    \"theme\": \"light\",\n    \"primaryColor\": \"#1E40AF\",\n    \"borderRadius\": 12,\n    \"fontSize\": 14,\n    \"showCustomizeButton\": true,\n    \"orientation\": \"auto\",\n    \"maxWidth\": 480,\n    \"themeStyles\": {\n      \"light\": { \"primaryColor\": \"#1E40AF\", \"bgColor\": \"#FFFFFF\", \"textColor\": \"#0F172A\" },\n      \"dark\":  { \"primaryColor\": \"#60A5FA\", \"bgColor\": \"#0F172A\", \"textColor\": \"#F8FAFC\" }\n    },\n    \"texts\": {\n      \"description\": \"We use cookies to improve your experience.\",\n      \"acceptAll\": \"Accept all\",\n      \"rejectAll\": \"Reject all\",\n      \"customize\": \"Customize\",\n      \"save\": \"Save preferences\",\n      \"privacyPolicy\": \"Privacy policy\"\n    },\n    \"categories\": [\n      { \"id\": \"necessary\", \"name\": \"Necessary\", \"description\": \"Required for the site to function.\", \"required\": true, \"enabled\": true },\n      { \"id\": \"analytics\", \"name\": \"Analytics\",  \"description\": \"Helps us understand usage.\",         \"required\": false, \"enabled\": true }\n    ],\n    \"privacyPolicyUrl\": \"https://acme.io/privacy\",\n    \"cookiePolicyUrl\": \"https://acme.io/cookies\",\n    \"thirdPartyScripts\": []\n  }\n}\n"
```

---