Skip to main content

deleteDocument

client.knowledge.deleteDocument(documentId: string): Promise<unknown>

Deletes a document and all its associated chunks.

Permanently removes the document from its collection. The collection itself is not affected.

Parameters

ParameterTypeRequiredDescription
documentIdstringYesThe unique identifier of the document to delete

Returns

Promise<unknown> — A promise that resolves when deletion is complete

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.knowledge.deleteDocument('documentId');
console.log(result);