لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/sites/settings.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

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
Parameterid (path) Typenumber Requiredyes DescriptionSite identifier — a positive integer. List: GET /v1/sites
Parameterscope (query) Typestring Requiredno DescriptionInternal 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

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

curl — OAuth application

Terminal
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
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata Typeobject DescriptionSite settings. The key is the setting name, the value is a string, a number or an array of strings
Fielddata.<NAME>_USE Typestring DescriptionWhether the feature is on: Y / N. For example, GACOUNTER_USE — analytics counter, COOKIES_USE — cookie banner
Fielddata.COOKIES_* Typestring DescriptionCookie banner settings: colors, position, agreement
Fielddata.B24BUTTON_* Typestring DescriptionThe Bitrix24 widget on the site. B24BUTTON_CODE — the widget script URL, or N when the widget is off
Fielddata.THEME_*, data.THEMEFONTS_* Typestring DescriptionTheme: color, fonts and their sizes
Fielddata.CSSBLOCK_CODE Typestring DescriptionCustom site CSS
Fielddata.SETTINGS_* Typestring | number | string[] DescriptionStore 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 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
HTTP400 CodeINVALID_PARAMS Descriptionid is not a positive integer
HTTP400 CodeINVALID_SCOPE Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo site with this id, the site is not accessible to the key's user, or it belongs to a different scope
HTTP409 CodeLANDING_MODULE_NOT_ENABLED DescriptionThe Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned the settings in a form other than an object, or rejected the request. The reason is in message
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionBitrix24 denied access: the key's user is not an administrator, or the feature is unavailable on the Bitrix24 account
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the landing scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing

The full list of common API errors — 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