[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmanagement\u002Ffolders-get":3,"docs-tabs-chats\u002Fmanagement\u002Ffolders-get":6},{"content":4,"lastmod":5},"## Get a chat folder\n\n`GET \u002Fv1\u002Fchats\u002Ffolders\u002F:folderId`\n\nReturns one of the current user's folders. For a personal folder, it also returns the folder's chats and the users of the direct dialogs it contains.\n\nThe chats of a system folder are returned by [`GET \u002Fv1\u002Fchats\u002Ffolders\u002F:folderId\u002Frecent`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffolder-recent).\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `folderId` (path) | number | yes | Folder ID — the `id` field in [`GET \u002Fv1\u002Fchats\u002Ffolders`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffolders). A positive integer |\n\nThe endpoint takes no query 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\u002F127\" \\\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\u002F127\" \\\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\u002F127', {\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { success, data } = await res.json()\nconsole.log(data.folder.title, data.chats.length)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Ffolders\u002F127', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log(data.folder.title, data.chats.length)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.folder` | object | The folder |\n| `data.folder.id` | number | Folder ID |\n| `data.folder.type` | string | `personal` — a personal folder, `system` — a messenger section |\n| `data.folder.code` | string | Messenger section code, for example `default` or `tasksTask`. Returned only for a system folder |\n| `data.folder.title` | string | Name |\n| `data.folder.sort` | number | Folder position in the interface |\n| `data.folder.visible` | boolean | The folder is shown in the interface |\n| `data.folder.description` | string \\| null | Section description for a system folder, `null` for a personal one |\n| `data.folder.displaysNestedInRoot` | boolean | Nested chats are also shown in the root list |\n| `data.folder.definition` | object | For a personal folder — its contents `{ chats: [{ chatId, dialogId }] }`. For a system one — the list section: `recentSection` and `parentChatId` |\n| `data.chats` | array | Chats of the personal folder in the v2 messenger format: `id`, `dialogId`, `name`, `type`, `role`, `owner`, `permissions` and other fields. An empty list for a system folder |\n| `data.users` | array | Users of the direct dialogs in the folder. An empty list if the folder contains only group chats or is a system folder |\n\n## Response example\n\nA personal folder with one group chat:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"chats\": [\n      {\n        \"avatar\": \"\",\n        \"color\": \"#4ba984\",\n        \"description\": \"\",\n        \"dialogId\": \"chat5287\",\n        \"diskFolderId\": 0,\n        \"entityData1\": \"\",\n        \"entityData2\": \"\",\n        \"entityData3\": \"\",\n        \"entityId\": \"\",\n        \"entityType\": \"\",\n        \"extranet\": false,\n        \"containsCollaber\": false,\n        \"id\": 5287,\n        \"parentChatId\": 0,\n        \"parentMessageId\": 0,\n        \"name\": \"Docs check\",\n        \"owner\": 1,\n        \"messageType\": \"C\",\n        \"role\": \"owner\",\n        \"muteList\": [],\n        \"type\": \"chat\",\n        \"entityLink\": { \"type\": \"\", \"url\": \"\", \"id\": \"\" },\n        \"permissions\": {\n          \"manageUsersAdd\": \"member\",\n          \"manageUsersDelete\": \"manager\",\n          \"manageUi\": \"member\",\n          \"manageSettings\": \"owner\",\n          \"manageMessages\": \"member\",\n          \"manageMessagesAutoDelete\": \"manager\",\n          \"manageGuestInvites\": \"manager\",\n          \"manageDelete\": \"member\",\n          \"canPost\": \"member\"\n        },\n        \"hasManageCapability\": false,\n        \"isNew\": false,\n        \"textFieldEnabled\": true,\n        \"backgroundId\": null,\n        \"canHaveThreads\": true\n      }\n    ],\n    \"users\": [],\n    \"folder\": {\n      \"id\": 127,\n      \"type\": \"personal\",\n      \"title\": \"Key clients\",\n      \"sort\": 12,\n      \"visible\": true,\n      \"description\": null,\n      \"displaysNestedInRoot\": false,\n      \"definition\": {\n        \"chats\": [{ \"chatId\": 5287, \"dialogId\": \"chat5287\" }]\n      }\n    }\n  }\n}\n```\n\nA system folder — the lists are empty:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"chats\": [],\n    \"users\": [],\n    \"folder\": {\n      \"id\": 27,\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}\n```\n\n## Error response example\n\n422 — no folder with this `folderId`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"FOLDER_NOT_FOUND\",\n    \"b24Code\": \"FOLDER_NOT_FOUND\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `folderId` is not a positive integer, or a query parameter was passed. Checked before any call to Bitrix24 |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`: `FOLDER_NOT_FOUND` — no such folder, `FOLDER_ACCESS_DENIED` — another user's folder |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered \"not found\"; the portal code is in `error.b24Code` |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\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- **A read-only key can make the call.** The call's argument is a folder, not a chat, so reading a folder does not make the user a member of its chats and does not count as a write. The folder list [`GET \u002Fv1\u002Fchats\u002Ffolders`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffolders) returns `403 WRITE_BLOCKED_READONLY_KEY` to such a key, so get the `folderId` with a key that has write access.\n- **`FOLDER_NOT_FOUND` arrives in `error.b24Code` of a `422 BITRIX_ERROR` response.** Do not confuse it with the `404 FOLDER_NOT_FOUND` on [Upload a file to a chat](\u002Fdocs\u002Fchats\u002Ffiles\u002Fupload).\n\n## See also\n\n- [Chat folders](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffolders)\n- [Folder chats](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffolder-recent)\n- [Create a chat folder](\u002Fdocs\u002Fchats\u002Fmanagement\u002Ffolders-create)\n- [Update a chat folder](\u002Fdocs\u002Fchats\u002Fmanagement\u002Ffolders-update)\n- [Add chats to a folder](\u002Fdocs\u002Fchats\u002Fmanagement\u002Ffolder-chats)\n- [Remove chats from a folder](\u002Fdocs\u002Fchats\u002Fmanagement\u002Ffolder-chats-delete)\n","2026-10-06",{},1795415428140]