Trillet AI logo

Upload File to Knowledge Base

Upload a file to an existing knowledge base. Supports PDF, TXT, DOCX, MD, CSV, and JSON files up to 50MB.

POSThttps://api.trillet.ai/v1/api/knowledgebase/{id}/files

Headers

x-api-keystringrequired

API key used for authenticating requests to the API.

x-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

idstringrequired

The unique identifier of the knowledge base to upload the file to.

Request Body

The request body should be sent as multipart/form-data.

uploadedFilefilerequired

The file to upload. Supported formats: PDF, TXT, DOCX, MD, CSV, JSON. Maximum file size: 50MB.

Response Fields

successboolean

Whether the file was uploaded successfully.

fileobject

Details of the uploaded file.

namestring

Name of the uploaded file.

sizenumber

Size of the file in bytes.

typestring

MIME type of the file.

{
  "success": true,
  "file": {
    "name": "product-guide.pdf",
    "size": 1048576,
    "type": "application/pdf"
  }
}