post https://api.voiceflow.com/v3alpha/knowledge-base/docs/upload
Uploads a document to the Knowledge Base (excluding type "url"). Limit is one file per call.
All requests made to any Knowledge Base APIs must be validated with a Dialog Manager API Key, prefaced with the word Bearer.
To obtain a Dialog Manager API key, go to the Integration tab on the project you uploaded data sources to and click the "Copy API key" button.
Request Fields
Property | Description & Example |
---|---|
Authorization (header) | Bearer Dialog Manager API Key |
Content-Type (header) | multipart/form-data |
overwrite (query parameter) | Optional - Specify whether to overwrite existing data (optional). "True" means you want to overwrite. |
maxChunkSize (query parameter) | Optional - Determine how granularly each document is broken up. Max chunk size affects the total amount of chunks parsed from a document. (i.e. larger chunks means less chunks retrieved) Smaller chunk size means: - narrower context - faster response - less tokens consumed - greater risk of less accurate answers type: integer ; default: 1000; Range available is 500-1500 tokens. Once uploaded, you can view the chunks using the GET Document Chunk Retrieval Knowledge Base API. |
file (body, form-data) | Accepted source document types for this endpoint are: pdf, txt, or docx. |
Sample Response
{
"status": {
"type": "PENDING"
},
"data": {
"type": "pdf",
"name": "Learn-to-Sail.pdf"
},
"updatedAt": "2023-08-09T21:04:04.213Z",
"documentID": "64d3fe4926dfd90007fa1668"
}