[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fservice\u002Fdesktop-logout":3,"docs-tabs-chats\u002Fservice\u002Fdesktop-logout":6},{"content":4,"lastmod":5},"## Desktop app logout\n\n`POST \u002Fv1\u002Fchats\u002Fdesktop\u002Flogout`\n\nMarks the caller's desktop app and the caller themselves \"offline\" in the messenger — as the Bitrix24 desktop app does when it logs out.\n\n## Parameters\n\nThere are no parameters. Any body field or query parameter is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fdesktop\u002Flogout\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fdesktop\u002Flogout\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fdesktop\u002Flogout', {\n  method: 'POST',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { success } = await res.json()\nconsole.log('Marked:', success)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fdesktop\u002Flogout', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success } = await res.json()\nconsole.log('Marked:', success)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | array | Always an empty array |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": []\n}\n```\n\n## Error response example\n\n400 — a body field was passed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Body field `dialogId` is not accepted by POST \u002Fv1\u002Fchats\u002Fdesktop\u002Flogout. It takes no body fields.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | A body field or query parameter was passed — the operation 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 Bitrix24 code is in `error.b24Code` |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |\n\nFor the full list of common API errors, see [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- The call does not sign out of Bitrix24 and does not revoke keys — only the presence status changes.\n- Any subsequent messenger call from the same user, such as a request for the [update state](\u002Fdocs\u002Fchats\u002Fservice\u002Fstate), marks them \"online\" again.\n\n## See also\n\n- [Update state](\u002Fdocs\u002Fchats\u002Fservice\u002Fstate)\n- [User status](\u002Fdocs\u002Fchats\u002Fsettings\u002Fstatus)\n- [Service methods](\u002Fdocs\u002Fchats\u002Fservice)\n","2026-10-07",{},1794739551683]