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

# Create Document

> Create a new document for use as a knowledge source.

Documents are uploaded files that can be referenced by the LLM during conversations to provide context-aware responses.




## OpenAPI

````yaml /specs/openapi-interactive.json post /api/v1/document/
openapi: 3.0.3
info:
  title: Perso Interactive API
  version: 0.0.0
servers:
  - url: https://platform.perso.ai
security: []
tags:
  - name: Embed
paths:
  /api/v1/document/:
    post:
      tags:
        - Session Resources
      summary: Create Document
      description: >
        Create a new document for use as a knowledge source.


        Documents are uploaded files that can be referenced by the LLM during
        conversations to provide context-aware responses.
      operationId: v1_document_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DocumentRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DocumentRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
          description: ''
        '400':
          description: Bad Request - Invalid input data or parameters.
        '401':
          description: Unauthorized - Invalid or missing authentication credentials.
        '403':
          description: Forbidden - You do not have permission to perform this action.
        '500':
          description: Internal Server Error - An unexpected error occurred.
      security:
        - PersoPlatform-APIKey: []
        - {}
components:
  schemas:
    DocumentRequest:
      type: object
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 100
        file:
          type: string
          format: binary
          description: >-
            Source document file (PDF, DOCX, or TXT) to ingest as a knowledge
            base.
          pattern: (?:xls|xlsx|csv)$
        description:
          type: string
        search_count:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          description: >-
            Number of search results to return per query (default depends on
            model).
        ef_search:
          type: integer
          maximum: 500
          minimum: 1
          nullable: true
          description: >-
            HNSW `ef_search` parameter for the vector index (1-500). Higher =
            more accurate, slower.
      required:
        - file
        - title
    Document:
      type: object
      properties:
        document_id:
          type: string
          readOnly: true
        title:
          type: string
          maxLength: 100
        file:
          type: string
          format: uri
          description: >-
            Source document file (PDF, DOCX, or TXT) to ingest as a knowledge
            base.
          pattern: (?:xls|xlsx|csv)$
        description:
          type: string
        search_count:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          description: >-
            Number of search results to return per query (default depends on
            model).
        ef_search:
          type: integer
          maximum: 500
          minimum: 1
          nullable: true
          description: >-
            HNSW `ef_search` parameter for the vector index (1-500). Higher =
            more accurate, slower.
        processed:
          type: boolean
          readOnly: true
        processed_v2:
          type: boolean
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - document_id
        - file
        - processed
        - processed_v2
        - title
        - updated_at
  securitySchemes:
    PersoPlatform-APIKey:
      type: apiKey
      in: header
      name: PersoPlatform-APIKey

````