Skip to main content
POST
https://api.trillet.ai
/
v1
/
api
/
knowledgebase
/
{id}
/
files
Upload File to Knowledge Base
curl --request POST \
  --url https://api.trillet.ai/v1/api/knowledgebase/{id}/files \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-workspace-id: <x-workspace-id>' \
  --data '{}'
{
  "success": true,
  "file": {
    "name": "product-guide.pdf",
    "size": 1048576,
    "type": "application/pdf"
  }
}

Headers

x-api-key
string
required
API key used for authenticating requests to the API.
x-workspace-id
string
required
Workspace identifier for the API.

Path Parameters

id
string
required
The unique identifier of the knowledge base to upload the file to.

Request Body

The request body should be sent as multipart/form-data.
uploadedFile
file
required
The file to upload. Supported formats: PDF, TXT, DOCX, MD, CSV, JSON. Maximum file size: 50MB.

Response Fields

success
boolean
Whether the file was uploaded successfully.
file
object
Details of the uploaded file.
name
string
Name of the uploaded file.
size
number
Size of the file in bytes.
type
string
MIME type of the file.
{
  "success": true,
  "file": {
    "name": "product-guide.pdf",
    "size": 1048576,
    "type": "application/pdf"
  }
}