For AI agents: markdown of this page — /docs-content-en/chats/management/folders-delete.md documentation index — /llms.txt
Delete a chat folder
DELETE /v1/chats/folders/:folderId
Deletes 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.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ParameterfolderId (path) |
Typenumber | Requiredyes | DescriptionPersonal folder ID — the id field in GET /v1/chats/folders. A positive integer |
There are no query parameters or body fields: any query parameter or body field is rejected with 400 INVALID_PARAMS.
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/chats/folders/127" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/chats/folders/127" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/folders/127', {
method: 'DELETE',
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { success, data } = await res.json()
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/folders/127', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.result |
Typeboolean | Descriptiontrue — the folder is deleted |
Response example
{
"success": true,
"data": {
"result": true
}
}
Error response example
422 — there is no folder with this folderId, including when the folder has already been deleted:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "FOLDER_NOT_FOUND",
"b24Code": "FOLDER_NOT_FOUND"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptionfolderId 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 |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 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 |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionBitrix24 answered "not found"; the portal code is in error.b24Code |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the im scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is read-only: deleting a folder is a write, see access rights |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no Bitrix24 tokens configured |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 is unavailable or returned a server error |
Full list of common API errors — Errors.
Known specifics
FOLDER_NOT_FOUNDarrives inerror.b24Codeof a422 BITRIX_ERRORresponse. Do not confuse it with the404 FOLDER_NOT_FOUNDon Upload a file to a chat.