[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fsettings\u002Fupdate":3,"docs-tabs-chats\u002Fsettings\u002Fupdate":6},{"content":4,"lastmod":5},"## Change a setting\n\n`PATCH \u002Fv1\u002Fchats\u002Fsettings`\n\nChanges one of the user's general messenger settings — sound, theme, sending with Enter, privacy, the notification scheme and more.\n\n## Request fields (body)\n\nThe request body is a JSON object:\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `name` | string | yes | Setting name — a key from the [read settings](\u002Fdocs\u002Fchats\u002Fsettings\u002Flist) response: a letter followed by letters, digits or `_`, up to 64 characters. The value `status` is not accepted |\n| `value` | string \\| boolean | yes | The new value: a string or `true` \u002F `false`. Example string: `dark` for `enableDarkTheme` |\n| `userId` | number | no | ID of the user whose setting to change, a positive integer. Defaults to the key owner. Only a Bitrix24 administrator can change another user's settings. User list: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n\nAny other body field and any query parameter are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsettings\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"name\": \"enableDarkTheme\", \"value\": \"dark\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsettings\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"name\": \"enableDarkTheme\", \"value\": \"dark\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsettings', {\n  method: 'PATCH',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application\u002Fjson' },\n  body: JSON.stringify({ name: 'enableDarkTheme', value: 'dark' }),\n})\n\nconst { success } = await res.json()\nconsole.log('Accepted:', success)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsettings', {\n  method: 'PATCH',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ name: 'enableDarkTheme', value: 'dark' }),\n})\n\nconst { success } = await res.json()\nconsole.log('Accepted:', success)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | boolean | `true` — the call was accepted. It does not mean the value changed: see \"Known specifics\" |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": true\n}\n```\n\n## Error response example\n\n400 — an attempt to change the status as a plain setting:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"The status is set by PUT \u002Fv1\u002Fchats\u002Fsettings\u002Fstatus: written as a plain setting it would not change the live status.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `name` is missing |\n| 400 | `INVALID_PARAMS` | `name` does not match the setting name format: it does not start with a letter, contains characters other than letters, digits and `_`, or is longer than 64 characters |\n| 400 | `INVALID_PARAMS` | `name` equals `status` — the status is changed with [`PUT \u002Fv1\u002Fchats\u002Fsettings\u002Fstatus`](\u002Fdocs\u002Fchats\u002Fsettings\u002Fstatus) |\n| 400 | `INVALID_PARAMS` | `value` is missing |\n| 400 | `INVALID_PARAMS` | `value` is neither a string nor `true` \u002F `false` |\n| 400 | `INVALID_PARAMS` | `userId` is not a positive integer |\n| 400 | `INVALID_PARAMS` | The request body is not a JSON object |\n| 400 | `INVALID_PARAMS` | The body contains a field other than `name`, `value`, `userId` |\n| 400 | `INVALID_PARAMS` | A query parameter was passed — the method accepts none |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. `SETTINGS_ACCESS_DENIED` — a non-administrator is changing another user's setting |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | `userId` was not passed, and the key owner could not be resolved |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- A `true` response does not confirm the change: an unknown setting name is skipped without an error, and for an enumerated setting a value outside the allowed set — for example, `enableDarkTheme` accepts only `auto`, `light`, `dark` — is replaced with the default. To confirm the result, read the settings again.\n- Until the user changes any setting, they use the shared set of default settings. The first change creates a personal copy of the set for them.\n\n## See also\n\n- [Read settings](\u002Fdocs\u002Fchats\u002Fsettings\u002Flist)\n- [User status](\u002Fdocs\u002Fchats\u002Fsettings\u002Fstatus)\n- [Messenger settings](\u002Fdocs\u002Fchats\u002Fsettings)\n","2026-10-06",{},1795415442294]