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​
- application/json
Body
required
- MOD1
- MOD1
- MOD1
Array [
- MOD1
- MOD1
- MOD2
Array [
]
]
- MOD1
- MOD1
reader
object
anyOf
string
chunker
object
anyOf
string
embedder
object
anyOf
string
files
object[]
required
doc_id
object
anyOf
string
owners
object
anyOf
string
string
chunk_units
object
anyOf
integer
chunk_overlap
object
anyOf
integer
Responses​
- 202
- 207
- 400
- 401
- 422
Successful Response
- application/json
- Schema
- Example (from schema)
Schema
Array [
- MOD1
- MOD1
- MOD2
Array [
]
]
Array [
- MOD1
- MOD1
- MOD2
Array [
]
]
Array [
- MOD1
- MOD1
- MOD2
Array [
]
]
accepted
object[]
required
doc_id
object
anyOf
string
owners
object
anyOf
string
string
duplicate
object[]
required
doc_id
object
anyOf
string
owners
object
anyOf
string
string
invalid
object[]
required
doc_id
object
anyOf
string
owners
object
anyOf
string
string
{
"accepted": [
{
"doc_id": "string",
"name": "string",
"bytes": "string",
"category": "string",
"path": "string",
"owners": "string"
}
],
"duplicate": [
{
"doc_id": "string",
"name": "string",
"bytes": "string",
"category": "string",
"path": "string",
"owners": "string"
}
],
"invalid": [
{
"doc_id": "string",
"name": "string",
"bytes": "string",
"category": "string",
"path": "string",
"owners": "string"
}
]
}
Multi-Status
Bad Request
Unauthorized
Validation Error
- application/json
- Schema
- Example (from schema)
Schema
Array [
Array [
- MOD1
- MOD2
]
]
detail
object[]
loc
object[]
required
anyOf
string
integer
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}