IndexService

POST /v1/upload

The File Upload API can be used to index binary files like PDFs, Word Documents, and similar. Vectara will attempt to automatically extract the text and any metadata from the document like author or title, though you can provide additional metadata as well.

Some tips for this API:

  • This operation authenticates with either the Personal API Key, Index API Key, or OAuth 2.0 (in a JWT "Bearer Token"). You can find details of how to set up an API key or use OAuth 2.0 here.
  • You can find a full list of supported file formats here.
  • To provide additional metadata, set the doc_metadata field. You can find some additional details here
  • PDFs must contain text: Vectara does not currently support indexing scanned images via OCR.
  • There is a known issue with the OpenAPI plugin where the generated Python script for file uploads incorrectly uses placeholder values for the file path and filename. Manually replace '/path/to/file' and 'file' in the files array with the actual file path and filename.

Request

Query parameters

cinteger required

Customer ID

ointeger required

Corpus ID

dboolean

If true, the server returns the extracted document that was indexed

Request body multipart/form-data

doc_metadatastring

A JSON string of any additional metadata you want attached to the file.

filestring binary required

The file to be indexed into Vectara.

Response

A successful response

Changes

No recorded changes to this operation across all 3 revisions of this API.