[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmanagement\u002Ffolders-delete":3,"docs-tabs-chats\u002Fmanagement\u002Ffolders-delete":6},{"content":4,"lastmod":5},"## Delete a chat folder\n\n`DELETE \u002Fv1\u002Fchats\u002Ffolders\u002F:folderId`\n\nDeletes the current user's personal chat folder together with its contents and pins. The chats themselves stay in the chat list. Deletion is irreversible: a folder cannot be restored through the API — create a new one if needed.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `folderId` (path) | number | yes | Personal folder ID — the `id` field in [`GET \u002Fv1\u002Fchats\u002Ffolders`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffolders). A positive integer |\n\nThere are no query parameters or body fields: any query parameter or body field is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"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 -X DELETE \"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  method: 'DELETE',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { success, data } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Ffolders\u002F127', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.result` | boolean | `true` — the folder is deleted |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"result\": true\n  }\n}\n```\n\n## Error response example\n\n422 — there is no folder with this `folderId`, including when the folder has already been deleted:\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, a query parameter or body field is passed, or the body is not a JSON object. 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, `FOLDER_SYSTEM_MUTATION_FORBIDDEN` — a system folder cannot be deleted |\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| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only: deleting a folder is a write, see [access rights](\u002Fdocs\u002Faccess-rights) |\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- **`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- [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",{},1795415428006]