## 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

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

### curl — OAuth application

```bash
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 |
|------|-----|----------|
| `success` | boolean | `true` on a successful request |
| `data.mode` | number | Current mode: `1` — classic CRM with leads, `2` — simple CRM without leads |
| `data.name` | string | Name of the current mode in the Bitrix24 account language |
| `data.modes` | array | All modes the Bitrix24 account supports |
| `data.modes[].id` | number | Mode identifier. The current mode is the item whose `id` equals `data.mode` |
| `data.modes[].name` | string | Mode 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 |
|------|-----|----------|
| 403 | `BITRIX_ACCESS_DENIED` | The key's user has no permission to read CRM settings in Bitrix24 |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request. The reason is in `message` |
| 429 | `RATE_LIMITED` | Bitrix24 request rate exceeded. Retry in 1-2 seconds |
| 502 | `BITRIX_RESPONSE_INVALID` | Bitrix24 returned the mode or the mode list in an unexpected shape, or the current mode is missing from the list |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable: it returned a server error or the connection dropped |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |
| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |

Full list of common API errors — [Errors](/docs/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

- [CRM settings](/docs/entities/crm-settings)
- [Leads](/docs/entities/leads)
- [CRM reference lists](/docs/entities/crm-enums)
