Update a document content in KB
const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://blackbox.dasha.ai/api/v1/rag/document/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://blackbox.dasha.ai/api/v1/rag/document/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'import requests
url = "https://blackbox.dasha.ai/api/v1/rag/document/{id}"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"documentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"knowledgeBaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sizeBytes": 123,
"contentHash": "<string>",
"status": "Uploaded",
"uploadedAt": "2023-11-07T05:31:56Z",
"wasDuplicate": true,
"existingDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Update a document content in KB
POST
/
api
/
v1
/
rag
/
document
/
{id}
Update a document content in KB
const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://blackbox.dasha.ai/api/v1/rag/document/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://blackbox.dasha.ai/api/v1/rag/document/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'import requests
url = "https://blackbox.dasha.ai/api/v1/rag/document/{id}"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"documentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"knowledgeBaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sizeBytes": 123,
"contentHash": "<string>",
"status": "Uploaded",
"uploadedAt": "2023-11-07T05:31:56Z",
"wasDuplicate": true,
"existingDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Path Parameters
Knowledge base ID
Body
multipart/form-data
Response
Created
Available options:
Uploaded, Queued, Processing, Indexed, Failed, Cancelled, PendingDelete, Deleting Was this page helpful?