Files API (Knowledge Base)
The Files API allows you to manage documents for the Retrieval-Augmented Generation (RAG) pipeline. You can view uploaded documents, check their vector-indexing status, and delete them from your workspace.
(Note: File uploading via API currently requires pre-signed S3 URLs. Uploading is managed via the UI, but status checking can be done here).
List Files
GET /v1/files
Returns a paginated list of documents in your workspace.
Query Parameters
status(string, optional): Filter by indexing status (e.g.,PENDING,PROCESSING,COMPLETED,FAILED).limit(number, optional): Max records to return. Default is 50.
Example Response
{
"data": [
{
"id": "file_xyz123",
"originalFilename": "annual-report-2023.pdf",
"fileSize": 4502120,
"mimeType": "application/pdf",
"indexingStatus": "COMPLETED",
"createdAt": "2024-03-01T10:00:00Z"
}
],
"meta": {
"returned": 1,
"limit": 50
}
}Get File Details
GET /v1/files/:id
Retrieves detailed status information about a specific file, including potential AI indexing errors.
Delete a File
DELETE /v1/files/:id
Soft-deletes a document. Once deleted, the file is immediately removed from the active RAG vector index and will no longer be used as context in AI queries.