curl --location --request DELETE 'https://api.weya.live/backend/api/knowledgeBase/687b1c2ab7c7d3f123456789/documents/FAQ.pdf' \
--header 'x-api-key: YOUR_API_KEY'
Knowledge Base
Delete Knowledge Base Document
Delete one file from a knowledge base. Currently deletes the whole knowledge base; see the warning.
DELETE
/
api
/
knowledgeBase
/
{knowledgeBaseId}
/
documents
/
{fileName}
curl --location --request DELETE 'https://api.weya.live/backend/api/knowledgeBase/687b1c2ab7c7d3f123456789/documents/FAQ.pdf' \
--header 'x-api-key: YOUR_API_KEY'
Known issue: don’t use this endpoint for now. It currently deletes the entire knowledge base, with all its files and its search index, instead of the one file named in the path. It behaves exactly like Delete Knowledge Base and returns
204 No Content. This page will be updated when it is fixed.Overview
Intended to delete one file from one of your organization’s knowledge bases, keeping the other files.Prerequisites
- An API key for your workspace
- The knowledge base ID, and the file name from List Knowledge Base Documents
Request
curl --location --request DELETE 'https://api.weya.live/backend/api/knowledgeBase/687b1c2ab7c7d3f123456789/documents/FAQ.pdf' \
--header 'x-api-key: YOUR_API_KEY'
Response
A successful request returns204 No Content with no body.
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?

