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

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

CRM settings

The CRM mode determines whether leads are enabled. This section lets you check the CRM mode of your Bitrix24 account before building a scenario around leads.

Bitrix24 API: crm.settings.mode.get, crm.enum.settings.mode

Scope: crm

CRM mode

GET /v1/crm-settings/mode

Returns the CRM mode of the Bitrix24 account, so you can check whether leads are enabled before working with them.

Examples

curl — personal key

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

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/crm-settings/mode" \
  -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/crm-settings/mode', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { data } = await res.json()
const leadsEnabled = data.mode === 1
console.log(data.name, leadsEnabled ? 'leads enabled' : 'leads disabled')

JavaScript — OAuth application

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

const { data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on a successful request
Fielddata.mode Typenumber DescriptionCurrent mode: 1 — classic CRM with leads, 2 — simple CRM without leads
Fielddata.name Typestring DescriptionName of the current mode in the Bitrix24 account language
Fielddata.modes Typearray DescriptionAll modes the Bitrix24 account supports
Fielddata.modes[].id Typenumber DescriptionMode identifier. The current mode is the item whose id equals data.mode
Fielddata.modes[].name Typestring DescriptionMode name in the Bitrix24 account language

Response example

JSON
{
  "success": true,
  "data": {
    "mode": 1,
    "name": "Classic CRM",
    "modes": [
      { "id": 1, "name": "Classic CRM" },
      { "id": 2, "name": "Simple CRM" }
    ]
  }
}

Error response example

401 — the X-Api-Key header is missing:

JSON
{
  "success": false,
  "error": {
    "code": "MISSING_API_KEY",
    "message": "API key required. Pass via X-Api-Key header."
  }
}

Errors

HTTP Code Description
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe key's user has no permission to read CRM settings in Bitrix24
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the request. The reason is in message
HTTP429 CodeRATE_LIMITED DescriptionBitrix24 request rate exceeded. Retry in 1-2 seconds
HTTP502 CodeBITRIX_RESPONSE_INVALID DescriptionBitrix24 returned the mode or the mode list in an unexpected shape, or the current mode is missing from the list
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable: it returned a server error or the connection dropped
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured
HTTP403 CodeSCOPE_DENIED DescriptionThe API key lacks the crm scope

Full list of common API errors — Errors.

Known specifics

  • Compare the mode by number. name comes in the Bitrix24 account language, so build conditions on mode, not on the name.
  • Query parameters are ignored. The method takes no parameters; anything passed in the URL does not affect the response.

See also