> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Deduplicate Entities

> Triggers a deduplication process to merge redundant entities within the knowledge graph of the specified RAG system.



## OpenAPI

````yaml post /v4/knowledge_graph/neo4j/{rag_id}/deduplicate/
openapi: 3.0.3
info:
  title: Lyzr Knowledge Graph Deduplication API
  version: 1.0.0
  description: API endpoint to trigger entity deduplication on a Neo4j-based RAG system.
servers:
  - url: https://rag-prod.studio.lyzr.ai
security: []
paths:
  /v4/knowledge_graph/neo4j/{rag_id}/deduplicate/:
    post:
      summary: Deduplicate Entities
      description: >-
        Triggers a deduplication process to merge redundant entities within the
        knowledge graph of the specified RAG system.
      operationId: deduplicateEntities
      parameters:
        - name: rag_id
          in: path
          required: true
          description: >-
            The unique identifier (ID) of the RAG system on which to perform
            deduplication.
          schema:
            type: string
            example: 654c602a46c3b6d4e28741b0
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: Empty request body is expected for this operation.
              nullable: true
            example: {}
      responses:
        '200':
          description: Deduplication process successfully started or completed.
          content:
            application/json:
              schema:
                type: string
                example: Deduplication task successfully initiated.
        '422':
          description: Validation Error (e.g., incorrect RAG ID format).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      $ref: '#/components/schemas/ValidationError'
        '500':
          description: Deduplication Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: >-
                      Deduplication Error: '12443534' is not a valid ObjectId,
                      it must be a 12-byte input or a 24-character hex string
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
        type:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````