Entity update request
Request to update/rename an entity
Current entity name
New entity name (must be different from oldName)
Optionalsources?: string[]Optional: Filter by specific sources
OptionalfileHashes?: string[]Optional: Filter by specific file hashes
OptionalchunkIds?: string[]Optional: Filter by specific chunk IDs
Promise resolving to EntityOperationResponse:
success - Whether the operation succeededaffectedChunks - Number of chunks updatedmessage - Success or error messageimport { updateEntity } from "@cpod/sdk";
// Rename entity globally
const result = await updateEntity({
oldName: "Acme",
newName: "Acme Corporation",
});
console.log(`Updated ${result.affectedChunks} chunks`);
// Rename only in specific source
const scopedResult = await updateEntity({
oldName: "J. Smith",
newName: "John Smith",
sources: ["contracts", "hr_documents"],
});
Update/rename an entity across document chunks
Renames an entity in the document index. The operation can be scoped to specific sources, files, or chunks.