[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fdiscovery\u002Ffolders":3,"docs-tabs-chats\u002Fdiscovery\u002Ffolders":6},{"content":4,"lastmod":5},"## Chat folders\n\n`GET \u002Fv1\u002Fchats\u002Ffolders`\n\nReturns the current user's chat folders. System folders are the messenger's sections: chats, tasks, collabs, Open Channels, the public channel showcase and others; the set depends on the Bitrix24 account. Users create personal folders themselves from chats they select. To get a folder's chat list, call [`GET \u002Fv1\u002Fchats\u002Ffolders\u002F:folderId\u002Frecent`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffolder-recent).\n\n## Parameters\n\nThere are no parameters. Any query parameter is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Ffolders\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Ffolders\" \\\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\u002Ffolders', {\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconst personal = data.folders.filter((f) => f.type === 'personal')\nconsole.log('Personal folders:', personal.length)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Ffolders', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.folders` | array | The user's folders |\n| `data.folders[].id` | number | Folder ID — the `folderId` for the folder's chat list |\n| `data.folders[].type` | string | `system` — a messenger section, `personal` — a personal folder |\n| `data.folders[].code` | string | System folder code, for example `default`, `tasksTask`, `collab`, `lines`, `openChannel`. A personal folder has no such field |\n| `data.folders[].title` | string | Folder name |\n| `data.folders[].sort` | number | Folder order in the interface |\n| `data.folders[].visible` | boolean | The folder is shown in the interface |\n| `data.folders[].description` | string \\| null | Description. `null` for a personal folder |\n| `data.folders[].displaysNestedInRoot` | boolean | Nested chats are also shown in the root list |\n| `data.folders[].definition` | object | What the folder holds. For a system folder, `recentSection` (the list section) and `parentChatId`. For a personal folder, `chats`, a list of `{ chatId, dialogId }` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"folders\": [\n      {\n        \"id\": 1,\n        \"type\": \"system\",\n        \"code\": \"default\",\n        \"title\": \"Chats\",\n        \"sort\": 2,\n        \"visible\": true,\n        \"description\": \"All chats, channels and projects\",\n        \"displaysNestedInRoot\": false,\n        \"definition\": { \"recentSection\": \"default\", \"parentChatId\": 0 }\n      },\n      {\n        \"id\": 15,\n        \"type\": \"personal\",\n        \"title\": \"Clients\",\n        \"sort\": 12,\n        \"visible\": true,\n        \"description\": null,\n        \"displaysNestedInRoot\": false,\n        \"definition\": { \"chats\": [{ \"chatId\": 42, \"dialogId\": \"chat42\" }] }\n      }\n    ]\n  }\n}\n```\n\n## Error response example\n\n400 — a query parameter was sent:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Query parameter `type` is not accepted by GET \u002Fv1\u002Fchats\u002Ffolders. It takes no query parameters.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | A query parameter was sent — the endpoint takes none |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | Read-only key: listing folders can change portal state |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error. The portal code is in `error.b24Code` |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- On the first call or after a cache reset, the call may create system folders, migrate legacy pins and populate folder sources. A read-only key therefore gets `403 WRITE_BLOCKED_READONLY_KEY` before the call reaches Bitrix24. [Listing chats in a folder](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffolder-recent) remains a read-only operation.\n- Not every system folder has a chat list: the public channel showcase responds to a list request with the code `FOLDER_OPERATION_NOT_SUPPORTED`.\n\n## See also\n\n- [Folder chats](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffolder-recent)\n- [Recent dialogs](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent)\n- [Unread counters](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Fcounters)\n- [Chat discovery](\u002Fdocs\u002Fchats\u002Fdiscovery)\n","2026-10-07",{},1794739534772]