[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fsettings\u002Fstatus":3,"docs-tabs-chats\u002Fsettings\u002Fstatus":6},{"content":4,"lastmod":5},"# User status\n\nSets the user's messenger status — \"online\", \"do not disturb\" or \"away\".\n\n## Set the status\n\n`PUT \u002Fv1\u002Fchats\u002Fsettings\u002Fstatus`\n\nUpdates both the `status` setting and the current status other users see.\n\n## Request fields (body)\n\nThe request body is a JSON object:\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `status` | string | yes | `online` — online, `dnd` — do not disturb, `away` — away |\n| `userId` | number | no | ID of the user whose status to set, a positive integer. Defaults to the key owner. Only a Bitrix24 administrator can change another user's status. 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 PUT \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsettings\u002Fstatus\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"status\": \"dnd\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PUT \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsettings\u002Fstatus\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"status\": \"dnd\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsettings\u002Fstatus', {\n  method: 'PUT',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application\u002Fjson' },\n  body: JSON.stringify({ status: 'dnd' }),\n})\n\nconst { data } = await res.json()\nconsole.log('Status set:', data)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsettings\u002Fstatus', {\n  method: 'PUT',\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({ status: 'dnd' }),\n})\n\nconst { data } = await res.json()\nconsole.log('Status set:', data)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | boolean | `true` — the status is set |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": true\n}\n```\n\n## Error response example\n\n400 — the status is outside the allowed set:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"`status` must be `online`, `dnd` or `away`.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `status` is missing |\n| 400 | `INVALID_PARAMS` | `status` is not `online`, `dnd` or `away` |\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 `status` and `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 status |\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- The platform rejects `status` values other than `online`, `dnd` and `away` before calling Bitrix24: otherwise the `status` setting and the current status would diverge.\n- The status cannot be changed through [`PATCH \u002Fv1\u002Fchats\u002Fsettings`](\u002Fdocs\u002Fchats\u002Fsettings\u002Fupdate): that would change only the setting, while the status other users see would stay the same.\n- The current status is returned in the `status` field when you [read the settings](\u002Fdocs\u002Fchats\u002Fsettings\u002Flist).\n\n## See also\n\n- [Read settings](\u002Fdocs\u002Fchats\u002Fsettings\u002Flist)\n- [Change a setting](\u002Fdocs\u002Fchats\u002Fsettings\u002Fupdate)\n- [Messenger settings](\u002Fdocs\u002Fchats\u002Fsettings)\n","2026-10-06",{},1794739553019]