Ingest Document
Ingest a document into a given Datastore
.
Ingestion is an asynchronous task. Returns a document id
which can be used to track the status of the ingestion job through calls to the GET /datastores/{datastore_id}/documents/{document_id}/metadata
API.
This id
can also be used to delete the document through the DELETE /datastores/{datastore_id}/documents/{document_id}
API.
file
must be a PDF, HTML, DOC(X) or PPT(X) file. The filename must end with one of the following extensions: .pdf
, .html
, .htm
, .mhtml
, .doc
, .docx
, .ppt
, .pptx
.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Datastore ID of the datastore in which to ingest the document
Body
File to ingest.
Metadata in JSON
format. Metadata should be passed as a nested dictionary structure where:
- The metadata type
custom_metadata
is mapped to a dictionary. - The dictionary keys represent metadata attributes. - The values can be of typestr
,bool
,float
, orint
.
Example Metadata JSON:
{
"metadata": {
"custom_metadata": {
"customKey1": "value3",
"_filterKey": "filterValue3"
}
}
}
Response
Response body from POST /data/documents
ID of the document being ingested
Was this page helpful?