@cpod/sdk - v0.2.7
    Preparing search index...

    Function deleteEntity

    • Delete an entity from document chunks

      Removes an entity from the document index. Can be scoped to specific sources, files, or chunks. Respects user permissions.

      Parameters

      • request: DeleteEntityRequest

        Entity deletion request

        Request to delete an entity

        • name: string

          Entity name to delete

          1

          255

        • Optionalsources?: string[]

          Optional: Filter by specific sources

        • OptionalfileHashes?: string[]

          Optional: Filter by specific file hashes

        • OptionalchunkIds?: string[]

          Optional: Filter by specific chunk IDs

      Returns Promise<EntityOperationResponse>

      Promise resolving to EntityOperationResponse:

      • success - Whether the operation succeeded
      • affectedChunks - Number of chunks where entity was removed
      • message - Success or error message

      401 - Not authenticated

      404 - Entity not found

      422 - Validation error

      import { deleteEntity } from "@cpod/sdk";

      // Delete entity globally
      const result = await deleteEntity({ name: "Acme Corporation" });
      console.log(`Deleted from ${result.affectedChunks} chunks`);

      // Delete only from specific sources
      const scopedResult = await deleteEntity({
      name: "Outdated Term",
      sources: ["legacy_docs"],
      });

      // Delete from specific file
      const fileResult = await deleteEntity({
      name: "Typo Entity",
      fileHashes: ["95d47a820fcc0a667004a6da403b3d29"],
      });