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

Delete a knowledge base

DELETE /v1/note/collections/:id

Moves a knowledge base and its documents to the trash. An already archived knowledge base can also be deleted.

Parameters

Parameter Type Required Description
Parameterid Typeinteger Requiredyes DescriptionKnowledge base identifier (path parameter)

Examples

curl — personal key

Terminal
curl -X DELETE https://vibecode.bitrix24.com/v1/note/collections/42 \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE https://vibecode.bitrix24.com/v1/note/collections/42 \
  -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/note/collections/42', {
  method: 'DELETE',
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data } = await res.json()
console.log(data.deleted) // true

JavaScript — OAuth application

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

Response

On successful deletion, { deleted: true } is returned with HTTP status 200.

Response example

JSON
{
  "success": true,
  "data": {
    "deleted": true
  }
}

Error response example

404 — knowledge base not found:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Record with ID = `999999` not found"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS Descriptionid is not a positive integer
HTTP404 CodeENTITY_NOT_FOUND DescriptionThe knowledge base does not exist or is already deleted
HTTP422 CodeBITRIX_ERROR DescriptionA background document import is running for the knowledge base — deletion is possible after it completes. The text is in error.message
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionNo permission to manage the knowledge base
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is in read-only mode
HTTP403 CodeSCOPE_DENIED DescriptionThe key is missing the note scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens

Full list of common API errors — Errors.

Known specifics

  • A knowledge base cannot be restored through the API. Restoration is available from the trash in the Bitrix24 interface.

See also