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

# Plan Document Split

> Split a document into multiple parts.
    For large documents, may return partial results with job_id for async processing.



## OpenAPI

````yaml https://document-assistant.us.aodocs.app/openapi.json post /assistant/api/v1/tenants/{tenant}/document_split:plan
openapi: 3.1.0
info:
  title: Document Assistant API
  description: |
    <p>
      The Document Assistant API enables developers to integrate document-based assistant
      functionalities into their applications using AODocs.
    </p>
    <p>
      The first step is to enable AIDA (AODocs Intelligent Document Assistant) in your tenant.
      The support team will provide you with the necessary information on how to get started.
    </p>
    <p>
      The second step is to enable AIDA on libraries. You need to be an administrator of the
      library to do this.<br />
      AIDA can answer questions only from those documents that are in an AIDA enabled
      library.<br />
      We create a vector store index for these documents. This can take some time. The get
      library API provides the status of the indexation and an estimate of the time
      remaining.<br />
      The content of the index is automatically kept up-to-date near real time with the
      content changes.
    </p>
    <p>
      The third step is to ask questions based on the AODocs documents.<br />
      AIDA automatically filters the results based on the user's permissions.
    </p>
    <p>
      <strong>Authentication:</strong> All API endpoints require a valid OAuth2 token in the
      Authorization header. Ensure the client ID of the OAuth2 token is whitelisted in AODocs.
    </p>
  version: 1.1.0
servers:
  - url: https://document-assistant.us.aodocs.app
    description: Production US
  - url: https://document-assistant.eu.aodocs.app
    description: Production EU
security: []
paths:
  /assistant/api/v1/tenants/{tenant}/document_split:plan:
    post:
      tags:
        - document_split
      summary: Plan Document Split
      description: |-
        Split a document into multiple parts.
            For large documents, may return partial results with job_id for async processing.
      operationId: >-
        plan_document_split_assistant_api_v1_tenants__tenant__document_split_plan_post
      parameters:
        - name: tenant
          in: path
          required: true
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The domain of the customer
            examples:
              - example.com
            title: Tenant
          description: The domain of the customer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SplitRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SplitPlan'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SplitRequest:
      properties:
        llm_provider:
          anyOf:
            - $ref: '#/components/schemas/LlmProvider'
            - type: 'null'
          description: >-
            The LLM provider to use. If not provided, the default provider will
            be used.
        llm_model_prefix:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Model Prefix
          description: >-
            The prefix of the LLM model name to use. If not provided, the
            default model will be used.
          examples:
            - gemini-2.5-pro
            - gemini-2.5-pro-preview-05-06
            - gpt-4.1
        document_id:
          type: string
          title: Document Id
          description: The document ID of the files
        document_classes:
          items:
            $ref: '#/components/schemas/TargetDocumentClass'
          type: array
          title: Document Classes
          description: The document classes to split the document into.
        instruction:
          anyOf:
            - type: string
            - type: 'null'
          title: Instruction
          description: Instruction to use when splitting the document.
        batch_size:
          type: integer
          exclusiveMinimum: 0
          title: Batch Size
          description: >-
            Number of pages to process per batch for large documents. Documents
            with fewer pages than this will be processed in a single batch.
          default: 50
        maximal_batch_overlap:
          type: integer
          minimum: 0
          title: Maximal Batch Overlap
          description: >-
            Number of pages to overlap between batches. This helps prevent
            splits from being cut off at batch boundaries.
          default: 10
        pubsub_topic:
          anyOf:
            - type: string
            - type: 'null'
          title: Pubsub Topic
          description: >-
            If provided, a notifications will be sent to this Pub/Sub topic upon
            completion.
      type: object
      required:
        - document_id
        - document_classes
      title: SplitRequest
    SplitPlan:
      properties:
        source_document_id:
          type: string
          title: Source Document Id
          description: The ID of the original document that was split.
        document_splits:
          items:
            $ref: '#/components/schemas/DocumentSplit'
          type: array
          title: Document Splits
          description: The list of document splits created as a result of the split.
        job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Job Id
          description: Job ID if split is in progress. Null when completed.
        status:
          $ref: '#/components/schemas/DocumentSplitStatus'
          description: 'Job status: ''in_progress'', ''completed'', or ''failed''.'
        total_pages:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Pages
          description: Total pages in the document.
        pages_processed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Pages Processed
          description: Pages processed so far.
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
          description: Error message if job failed.
      type: object
      required:
        - source_document_id
        - document_splits
        - status
      title: SplitPlan
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LlmProvider:
      type: string
      enum:
        - OpenAI
        - Google
        - Altirnao
        - MistralAI
        - Anthropic
      title: LlmProvider
    TargetDocumentClass:
      properties:
        name:
          type: string
          title: Name
          description: >-
            The name to use for this document class in the LLM prompt. Must be
            unique across all target document classes.
        library_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Library Id
          description: >-
            The ID of the library of the document class to split the document
            into. None for the implicit 'Uncategorized' document class.
        document_class_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Class Id
          description: >-
            The ID of the document class to split the document into. None for
            the implicit 'Uncategorized' document class.
        instruction:
          anyOf:
            - type: string
            - type: 'null'
          title: Instruction
          description: >-
            The instruction to use when splitting the document into this
            document class.
      type: object
      required:
        - name
        - library_id
        - document_class_id
      title: TargetDocumentClass
    DocumentSplit:
      properties:
        library_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Library Id
          description: >-
            The ID of the library the document belongs to. None for
            uncategorized documents.
        document_class_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Class Id
          description: >-
            The ID of the document class the document belongs to. None for
            uncategorized documents.
        document_class_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Class Name
          description: The name of the document class the document belongs to.
        page_ranges:
          items:
            $ref: '#/components/schemas/PageRange'
          type: array
          title: Page Ranges
          description: >-
            The list of page ranges in the original document that belong to this
            split document. Supports non-consecutive pages for future iterations
            where pages may be shuffled during scanning.
        confidence:
          anyOf:
            - $ref: '#/components/schemas/ConfidenceLevel'
            - type: 'null'
          description: The confidence level of the split.
        reasoning:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning
          description: The reasoning behind the split decision provided by the LLM.
      type: object
      required:
        - library_id
        - document_class_id
        - page_ranges
      title: DocumentSplit
      description: Represents one logical document resulting from a split operation.
    DocumentSplitStatus:
      type: string
      enum:
        - in_progress
        - completed
        - failed
      title: DocumentSplitStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PageRange:
      properties:
        start:
          type: integer
          minimum: 1
          title: Start
          description: The start page number of the range (inclusive, 1-based).
        end:
          type: integer
          minimum: 1
          title: End
          description: The end page number of the range (inclusive, 1-based).
      type: object
      required:
        - start
        - end
      title: PageRange
    ConfidenceLevel:
      type: string
      enum:
        - low
        - medium
        - high
      title: ConfidenceLevel
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````