## Enable leads

`POST /v1/leads/enable`

Switches the entire Bitrix24 account to Classic CRM with leads.

> **This method requires a CRM update after `26.2200.0`; no released version number is available yet. It is not available on all Bitrix24 accounts. An administrator must enable the feature.**

**Warning:** this changes CRM mode for the **whole Bitrix24 account**, affecting all users. CRM administrator permissions are required; plan restrictions also apply. Use a `READWRITE` key with the `crm` scope.

## Request body

The request takes no path or query parameters. Send no body or an empty object `{}`. Body fields are rejected.

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/leads/enable" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/leads/enable" \
  -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/leads/enable', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})
const result = await res.json()
console.log(result)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/leads/enable', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const result = await res.json()
console.log(result)
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `success` | boolean | `true` on success |
| `data.enabled` | boolean | Whether leads are enabled after the action |

## Response example

HTTP 200.

```json
{
  "success": true,
  "data": {
    "enabled": true
  }
}
```

## Error response example

400 — a body field was supplied:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "This action takes no body fields"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|------|-------------|
| 400 | `INVALID_PARAMS` | Invalid path or request body |
| 400 | `UNKNOWN_FILTER_FIELD` | Unknown or repeated query parameter |
| 403 | `BITRIX_ACCESS_DENIED` | Insufficient Bitrix24 permissions |
| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | A `READONLY` key cannot write |
| 401 | `TOKEN_MISSING` | The key has no configured Bitrix24 credentials |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 422 | `METHOD_NOT_YET_AVAILABLE` | The feature is disabled or the method is unavailable on this portal. `error.release` identifies the update |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 returned a malformed response |

Other native Bitrix24 refusals retain their HTTP status, code and message, with credentials removed. For common API errors, see [Errors](/docs/errors).

## Known specifics

Do not blindly retry after a timeout or connection failure: the mode may have changed. First read `GET /v1/crm-settings/mode` and compare the current mode with the intended result.

## See also

- [Disable leads](./leads-disable.md)
- [CRM dictionaries and actions](/docs/entities/crm-v3-dictionaries)
