For AI agents: markdown of this page — /docs-content-en/entities/folders/delete.md documentation index — /llms.txt

Delete folder

DELETE /v1/folders/:id

Moves the object to Bitrix24 trash. Use restore to recover it or purge to delete it permanently.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionFolder ID. List: GET /v1/folders

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/folders/9301" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/folders/9301" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/folders/9301', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

if (res.status === 204) {
  console.log('Folder deleted')
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/folders/9301', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

if (res.status === 204) {
  console.log('Folder deleted')
}

Response

On successful deletion, HTTP status 204 No Content is returned with an empty body. Success is signaled by the response code, not the content.

Response example

HTTP/1.1 204 No Content

Error response example

404 — folder not found:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Could not find entity with id '999999'."
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo folder with the specified id
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the disk scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured portal tokens

For the full list of common API errors, see Errors.

Known specifics

Deletion marks the folder as deleted and moves it to the trash without physically erasing it. Immediately after deletion, the record is still accessible via GET /v1/folders/:id with the deletedType field equal to 3 — in the trash. The deleted folder remains in Bitrix24 until it is permanently purged.

See also