curl -X POST "https://api.sayvy.ai/api/v1/knowledge-base/upload" \
-H "Authorization: Bearer <token>" \
-F "file=@/path/to/product_manual.pdf"
import requests
url = "https://api.sayvy.ai/api/v1/knowledge-base/upload"
headers = {
"Authorization": "Bearer <token>"
}
with open("product_manual.pdf", "rb") as f:
files = {"file": ("product_manual.pdf", f, "application/pdf")}
response = requests.post(url, headers=headers, files=files)
print(response.status_code)
print(response.json())
const formData = new FormData();
formData.append("file", fileInputElement.files[0]);
const response = await fetch("https://api.sayvy.ai/api/v1/knowledge-base/upload", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
body: formData
});
const data = await response.json();
console.log(data);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sayvy.ai/api/v1/knowledge-base/upload"))
.header("Authorization", "Bearer <token>")
.POST(ofMimeMultipartData(Map.of("file", Paths.get("product_manual.pdf")), boundary))
.build();
HttpResponse<String> response =
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
{
"id": "c5d1e2f3-4a5b-6c7d-8e9f-0123456789ab",
"organization_id": "93f35dc2-5d46-4e58-a9ee-038c35d9bcf1",
"document_type": "pdf",
"file_name": "product_manual.pdf",
"uploaded_at": "2026-09-07T12:00:00Z",
"updated_at": "2026-09-07T12:00:00Z"
}
{
"detail": "Unsupported file format. Please upload a PDF, DOCX, or TXT file."
}
{
"detail": "Unauthorized"
}
{
"error": "rate_limit_exceeded",
"message": "Rate limit exceeded for endpoint. Please retry after backoff.",
"retry_after": 60
}
Knowledge Base
Upload document
Upload a document to object storage and trigger automated vector chunking and indexing
POST
/
api
/
v1
/
knowledge-base
/
upload
curl -X POST "https://api.sayvy.ai/api/v1/knowledge-base/upload" \
-H "Authorization: Bearer <token>" \
-F "file=@/path/to/product_manual.pdf"
import requests
url = "https://api.sayvy.ai/api/v1/knowledge-base/upload"
headers = {
"Authorization": "Bearer <token>"
}
with open("product_manual.pdf", "rb") as f:
files = {"file": ("product_manual.pdf", f, "application/pdf")}
response = requests.post(url, headers=headers, files=files)
print(response.status_code)
print(response.json())
const formData = new FormData();
formData.append("file", fileInputElement.files[0]);
const response = await fetch("https://api.sayvy.ai/api/v1/knowledge-base/upload", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
body: formData
});
const data = await response.json();
console.log(data);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sayvy.ai/api/v1/knowledge-base/upload"))
.header("Authorization", "Bearer <token>")
.POST(ofMimeMultipartData(Map.of("file", Paths.get("product_manual.pdf")), boundary))
.build();
HttpResponse<String> response =
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
{
"id": "c5d1e2f3-4a5b-6c7d-8e9f-0123456789ab",
"organization_id": "93f35dc2-5d46-4e58-a9ee-038c35d9bcf1",
"document_type": "pdf",
"file_name": "product_manual.pdf",
"uploaded_at": "2026-09-07T12:00:00Z",
"updated_at": "2026-09-07T12:00:00Z"
}
{
"detail": "Unsupported file format. Please upload a PDF, DOCX, or TXT file."
}
{
"detail": "Unauthorized"
}
{
"error": "rate_limit_exceeded",
"message": "Rate limit exceeded for endpoint. Please retry after backoff.",
"retry_after": 60
}
Upload a
.pdf, .docx, or .txt document to your organization’s knowledge base. The document is securely stored in object storage and parsed into text chunks. Embeddings are generated and indexed into the vector database for real-time Retrieval-Augmented Generation (RAG).
Authentication
This endpoint requires Bearer token authentication.Authorization: Bearer <token>
| Header | Type | Required | Description | Format |
|---|---|---|---|---|
Authorization | string | Yes | Scoped organization API key or Bearer JWT token | Bearer <token> |
Input parameters
string
required
Bearer token for authentication. Format:
Bearer <token>.file
required
The multipart form file upload. Supported formats:
.pdf, .docx, .txt.Response Fields
string
Unique UUID identifier of the knowledge document.
string
UUID of the organization owning the document.
string
Detected document format type (
pdf, docx, txt).string
Original filename of the uploaded document.
string
ISO 8601 timestamp of upload completion.
string
ISO 8601 timestamp of last metadata update.
curl -X POST "https://api.sayvy.ai/api/v1/knowledge-base/upload" \
-H "Authorization: Bearer <token>" \
-F "file=@/path/to/product_manual.pdf"
import requests
url = "https://api.sayvy.ai/api/v1/knowledge-base/upload"
headers = {
"Authorization": "Bearer <token>"
}
with open("product_manual.pdf", "rb") as f:
files = {"file": ("product_manual.pdf", f, "application/pdf")}
response = requests.post(url, headers=headers, files=files)
print(response.status_code)
print(response.json())
const formData = new FormData();
formData.append("file", fileInputElement.files[0]);
const response = await fetch("https://api.sayvy.ai/api/v1/knowledge-base/upload", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
body: formData
});
const data = await response.json();
console.log(data);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sayvy.ai/api/v1/knowledge-base/upload"))
.header("Authorization", "Bearer <token>")
.POST(ofMimeMultipartData(Map.of("file", Paths.get("product_manual.pdf")), boundary))
.build();
HttpResponse<String> response =
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
{
"id": "c5d1e2f3-4a5b-6c7d-8e9f-0123456789ab",
"organization_id": "93f35dc2-5d46-4e58-a9ee-038c35d9bcf1",
"document_type": "pdf",
"file_name": "product_manual.pdf",
"uploaded_at": "2026-09-07T12:00:00Z",
"updated_at": "2026-09-07T12:00:00Z"
}
{
"detail": "Unsupported file format. Please upload a PDF, DOCX, or TXT file."
}
{
"detail": "Unauthorized"
}
{
"error": "rate_limit_exceeded",
"message": "Rate limit exceeded for endpoint. Please retry after backoff.",
"retry_after": 60
}
‹ PreviousNext ›
List documents
GET /api/v1/knowledge-base
Was this page helpful?