> ## 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.

# Train Neo4J Task

> Start a training task for Neo4j file processing.



## OpenAPI

````yaml post /v4/knowledge_graph/neo4j/task/
openapi: 3.0.3
info:
  title: Lyzr Knowledge Graph API
  version: 1.0.0
  description: >-
    API endpoint to start a training task for Neo4j knowledge graph file
    processing.
servers:
  - url: https://rag-prod.studio.lyzr.ai
security: []
paths:
  /v4/knowledge_graph/neo4j/task/:
    post:
      summary: Train Neo4J Task
      description: Start a training task for Neo4j file processing.
      operationId: trainNeo4jTask
      parameters:
        - name: rag_id
          in: query
          required: true
          description: >-
            The unique identifier (ID) of the RAG system to train (e.g., a
            24-character hex string).
          schema:
            type: string
            example: 654c602a46c3b6d4e28741b0
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to process for Neo4j knowledge graph training.
                schema_prompt:
                  type: string
                  description: Allowed nodes and relationships for the knowledge graph.
                  nullable: true
                extra_info:
                  type: string
                  description: Additional information (e.g., as a JSON string).
                  nullable: true
      responses:
        '200':
          description: Successful Response (Training task started).
          content:
            application/json:
              schema:
                type: string
                example: Task successfully started.
        '422':
          description: Validation Error (e.g., incorrect RAG ID format or missing file).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      $ref: '#/components/schemas/ValidationError'
        '500':
          description: Processing Error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: >-
                      Processing Error: '123433' 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

````