## Site settings

`GET /v1/sites/:id/settings`

Returns the site's additional settings: analytics counters, the cookie banner, theme and fonts, the Bitrix24 widget, store parameters.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Site identifier — a positive integer. List: [`GET /v1/sites`](/docs/entities/sites/list) |
| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` / `GROUP` / `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned. An ordinary site requested with `scope` also returns `404` |

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/sites/109/settings" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/sites/109/settings" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/109/settings', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Analytics counter enabled:', data.GACOUNTER_USE === 'Y')
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/109/settings', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()
```

## Response fields

Setting keys are returned as is, in uppercase. The key set differs from site to site. If the site has no settings, `data` is `{}`.

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` on success |
| `data` | object | Site settings. The key is the setting name, the value is a string, a number or an array of strings |
| `data.<NAME>_USE` | string | Whether the feature is on: `Y` / `N`. For example, `GACOUNTER_USE` — analytics counter, `COOKIES_USE` — cookie banner |
| `data.COOKIES_*` | string | Cookie banner settings: colors, position, agreement |
| `data.B24BUTTON_*` | string | The Bitrix24 widget on the site. `B24BUTTON_CODE` — the widget script URL, or `N` when the widget is off |
| `data.THEME_*`, `data.THEMEFONTS_*` | string | Theme: color, fonts and their sizes |
| `data.CSSBLOCK_CODE` | string | Custom site CSS |
| `data.SETTINGS_*` | string \| number \| string[] | Store parameters: currency `SETTINGS_CURRENCY_ID`, price types `SETTINGS_PRICE_CODE`, showing the old price and discount, cart position |

The same settings, except the store parameters `SETTINGS_*` and `B24BUTTON_CODE`, come in the full site export — in the `fields.ADDITIONAL_FIELDS` field of the [`GET /v1/sites/:id/export`](/docs/entities/sites/export) response.

## Response example

Showing 11 of 49 settings:

```json
{
  "success": true,
  "data": {
    "COOKIES_USE": "N",
    "B24BUTTON_CODE": "N",
    "B24BUTTON_COLOR": "site",
    "GACOUNTER_USE": "N",
    "ROBOTS_USE": "N",
    "SETTINGS_PRICE_CODE": [
      "BASE"
    ],
    "SETTINGS_SHOW_PRICE_COUNT": 1,
    "THEME_COLOR": "#4fd2c2",
    "THEMEFONTS_CODE": "Open Sans",
    "UP_SHOW": "Y",
    "HEADBLOCK_USE": "N"
  }
}
```

## Error response example

404 — site not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Site not found or not visible"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `id` is not a positive integer |
| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |
| 404 | `ENTITY_NOT_FOUND` | No site with this `id`, the site is not accessible to the key's user, or it belongs to a different `scope` |
| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |
| 422 | `BITRIX_ERROR` | Bitrix24 returned the settings in a form other than an object, or rejected the request. The reason is in `message` |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access: the key's user is not an administrator, or the feature is unavailable on the Bitrix24 account |
| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |

The full list of common API errors — [Errors](/docs/errors).

## Known specifics

- **Setting values are data, not code to run.** `CSSBLOCK_CODE` holds CSS, and the map and counter settings hold keys and identifiers of external services. Output such values as text and do not embed them in your own pages.
- **The value type of the same key can differ.** `SETTINGS_SHOW_PRICE_COUNT` comes as the number `1` on some sites and as the string `"1"` on others. Compare values regardless of type or convert them to a string.

## See also

- [Full site export](/docs/entities/sites/export)
- [Get a site](/docs/entities/sites/get)
- [Sites](/docs/entities/sites)
