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

Archive a knowledge base

POST /v1/note/collections/:id/archive

Archives a knowledge base. The archive cascades to all of its documents, which become read-only.

Parameters

Parameter Type Required Description
Parameterid (path) Typeinteger Requiredyes DescriptionKnowledge base identifier. List: GET /v1/note/collections

The request body is empty.

Examples

curl — personal key

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

curl — OAuth application

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

JavaScript — OAuth application

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

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionArchiving result
Fielddata.archived Typeboolean Descriptiontrue on successful archival

Response example

JSON
{
  "success": true,
  "data": {
    "archived": 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 archived
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

  • Documents of an archived knowledge base are not returned in the document tree.

See also