Skip to main content
{
  "files": [
    {}
  ],
  "key": "<string>",
  "name": "<string>",
  "size": 123,
  "lastModified": "<string>",
  "contentType": "<string>"
}
Retrieve a list of all files stored in a specific knowledge base.

Examples

import requests

kb_slug = "product-documentation"
url = f"https://labs.chonkie.ai/api/v1/knowledge/{kb_slug}"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
data = response.json()
files = data["files"]

print(f"Files in '{kb_slug}':")
for file in files:
    size_kb = file["size"] / 1024
    print(f"- {file['name']} ({size_kb:.2f} KB)")

Request

Path Parameters

knowledge_base_slug
string
required
The slug of the knowledge base to query.

Response

Returns

files
array
Array of file objects in the knowledge base.
Each file object contains:
key
string
Unique file identifier (format: timestamp-filename).
name
string
Original filename.
size
integer
File size in bytes.
lastModified
string
ISO 8601 timestamp of last modification.
contentType
string
MIME type of the file.
I