Skip to main content
Version: 0.21.x

Load Documents

POST 

/api/v1/documents

Imports file into the system for reading, chunking, embedding and storing.

The preferred way to submit documents is with the file bytes and in such case you do not need to specify path so can be empty string.

This endpoint will return a 202 status code if the documents are accepted for processing, and a 207 status code if some documents are duplicates or invalid. A background thread is started to process the documents, their processing state can be found by using the GET /api/v1/document/{doc_id} endpoint.

  • files: List of files to import
    • name : Name of the file.
    • doc_id: uuid to be used for the document in the database, can be null and set server side.
    • bytes: The files content in bytes, either specify this or the path.
    • category: Document type/category that you want this to be stored under.
    • path: The location of a local file you want to import, either specify this or the bytes.
    • owners: List /string denoting the owner of this document.

Request​

Body

required

    reader

    object

    anyOf

    string

    chunker

    object

    anyOf

    string

    embedder

    object

    anyOf

    string

    files

    object[]

    required

  • Array [

  • doc_id

    object

    anyOf

    string

    name Name (string)required
    bytes Bytes (string)required
    category Category (string)required
    path Path (string)required

    owners

    object

    anyOf

    string

  • ]

  • chunk_units

    object

    anyOf

    integer

    chunk_overlap

    object

    anyOf

    integer

Responses​

Successful Response

Schema

    accepted

    object[]

    required

  • Array [

  • doc_id

    object

    anyOf

    string

    name Name (string)required
    bytes Bytes (string)required
    category Category (string)required
    path Path (string)required

    owners

    object

    anyOf

    string

  • ]

  • duplicate

    object[]

    required

  • Array [

  • doc_id

    object

    anyOf

    string

    name Name (string)required
    bytes Bytes (string)required
    category Category (string)required
    path Path (string)required

    owners

    object

    anyOf

    string

  • ]

  • invalid

    object[]

    required

  • Array [

  • doc_id

    object

    anyOf

    string

    name Name (string)required
    bytes Bytes (string)required
    category Category (string)required
    path Path (string)required

    owners

    object

    anyOf

    string

  • ]

Loading...