Skip to main content

listDocuments

client.knowledge.listDocuments(id: string, params?: Record<string, unknown>): Promise<KnowledgeDocument[]>

Lists all documents in a knowledge collection.

Returns the documents belonging to the specified collection with their metadata. Does not include chunk-level content.

Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the collection
paramsRecord<string, unknown>NoOptional query parameters for filtering or pagination

Returns

Promise<KnowledgeDocument[]> — A promise that resolves to an array of objects

Example

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

const client = new CodeBoltClient();

const result = await client.knowledge.listDocuments('id');
console.log(result);