[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fcrm-settings\u002Fupdate":3,"docs-tabs-entities\u002Fcrm-settings\u002Fupdate":6},{"content":4,"lastmod":5},"## Change a CRM setting\n\n`PATCH \u002Fv1\u002Fcrm-settings\u002F:id`\n\nChange a CRM setting for the entire Bitrix24 account. Use a key with write access and check the value schema first.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|---|---|---|---|\n| `id` (path) | string | yes | Identifier from the [settings list](.\u002Flist.md). |\n\n## Request body\n\n| Field | Type | Required | Description |\n|---|---|---|---|\n| `value` | any JSON | yes | Complete value matching `meta.schema` from [get](.\u002Fget.md). Required even for `null`, `false` or `0`. |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-settings\u002Fcrm.layout.file_previewer.enabled\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"value\": true}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-settings\u002Fcrm.layout.file_previewer.enabled\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"value\": true}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst response = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-settings\u002Fcrm.layout.file_previewer.enabled', {\n  method: 'PATCH',\n  headers: {\"X-Api-Key\": \"YOUR_API_KEY\", \"Content-Type\": \"application\u002Fjson\"},\n  body: JSON.stringify({\"value\": true}),\n})\nconst result = await response.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst response = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-settings\u002Fcrm.layout.file_previewer.enabled', {\n  method: 'PATCH',\n  headers: {\"X-Api-Key\": \"YOUR_APP_KEY\", \"Authorization\": \"Bearer USER_SESSION_TOKEN\", \"Content-Type\": \"application\u002Fjson\"},\n  body: JSON.stringify({\"value\": true}),\n})\nconst result = await response.json()\n```\n\n## Response fields\n\n| Field | Description |\n|---|---|\n| `data.id` | Identifier. |\n| `data.value` | JSON value with its original type. |\n| `data.meta.title` | Setting title. |\n| `data.meta.description` | Setting description. |\n| `data.meta.schema` | Accepted value schema, validated by Bitrix24. |\n\n## Response example\n\nResponse structure with neutral sample data.\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": \"crm.layout.file_previewer.enabled\",\n    \"value\": true,\n    \"meta\": {\n      \"title\": \"File preview\",\n      \"description\": \"Preview files\",\n      \"schema\": {\n        \"type\": \"boolean\"\n      }\n    }\n  }\n}\n```\n\n## Error response example\n\n400 — unknown query parameter or a missing required field:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"MISSING_REQUIRED_FIELDS\",\n    \"message\": \"value is required\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|---|---|---|\n| 400 | `INVALID_PARAMS` | Invalid type or identifier. |\n| 400 | `UNKNOWN_FILTER_FIELD` | Unknown query parameter. |\n| 400 | `MISSING_REQUIRED_FIELDS` | Missing required body field. |\n| 400 | `UNKNOWN_FIELD` | Unknown body field. |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 credentials. |\n| 403 | `SCOPE_DENIED` | The `crm` scope is required. |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key access mode forbids writes. |\n| 404 | `ENTITY_NOT_FOUND` | The record is absent or inaccessible. |\n| 422 | `METHOD_NOT_YET_AVAILABLE` | The method is absent on the account. `error.release` names the required release. |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned an invalid response shape. |\n\nOther Bitrix24 refusals retain their original code and message. Common [API errors](\u002Fdocs\u002Ferrors).\n\n## Known behavior\n\nAn object in `value` replaces the complete setting value. A successful write is not rolled back if its readback fails. Never blindly retry an ambiguous write failure: read the setting first.\n\n## See also\n\n- [CRM settings](\u002Fdocs\u002Fentities\u002Fcrm-settings)\n- [CRM e-mails](\u002Fdocs\u002Fentities\u002Fcrm-emails)\n","2026-11-03",{},1794739359332]