curl --location 'https://api.weya.live/backend/api/knowledgeBase/687b1c2ab7c7d3f123456789/documents' \
--header 'x-api-key: YOUR_API_KEY'
{
"status": true,
"code": 200,
"message": "Documents listed successfully",
"errorMessage": null,
"data": [
{
"fileName": "FAQ.pdf",
"size": 245760,
"lastModified": "2026-07-20T10:30:00.000Z"
},
{
"fileName": "Pricing.docx",
"size": 185430,
"lastModified": "2026-07-20T10:35:00.000Z"
}
]
}
Knowledge Base
List Knowledge Base Documents
List the files stored in a knowledge base.
GET
/
api
/
knowledgeBase
/
{knowledgeBaseId}
/
documents
curl --location 'https://api.weya.live/backend/api/knowledgeBase/687b1c2ab7c7d3f123456789/documents' \
--header 'x-api-key: YOUR_API_KEY'
{
"status": true,
"code": 200,
"message": "Documents listed successfully",
"errorMessage": null,
"data": [
{
"fileName": "FAQ.pdf",
"size": 245760,
"lastModified": "2026-07-20T10:30:00.000Z"
},
{
"fileName": "Pricing.docx",
"size": 185430,
"lastModified": "2026-07-20T10:35:00.000Z"
}
]
}
Overview
List the files stored in one of your organization’s knowledge bases, with their size and last-modified time.Prerequisites
- An API key for your workspace
- The knowledge base ID, from Get Knowledge Bases
Request
curl --location 'https://api.weya.live/backend/api/knowledgeBase/687b1c2ab7c7d3f123456789/documents' \
--header 'x-api-key: YOUR_API_KEY'
Response
{
"status": true,
"code": 200,
"message": "Documents listed successfully",
"errorMessage": null,
"data": [
{
"fileName": "FAQ.pdf",
"size": 245760,
"lastModified": "2026-07-20T10:30:00.000Z"
},
{
"fileName": "Pricing.docx",
"size": 185430,
"lastModified": "2026-07-20T10:35:00.000Z"
}
]
}
Error Handling
Errors returnstatus: false, with the reason in errorMessage.
- 400 Bad Request –
knowledgeBaseIdisn’t a valid ID. - 401 Unauthorized – Missing or invalid API key.
- 404 Not Found –
KnowledgeBase not found: it doesn’t exist in your organization. - 429 Too Many Requests – More than 1,000 Knowledge Base requests in 15 minutes from your IP address.
- 500 Internal Server Error – Unexpected server error.
Was this page helpful?

