https://discord.gg/botpress logo
Knowledge base endpoint API
# 🤝help
m
can i use an API endpoint to excess a knowledge base. and upload documents and files. with a free plan. or do i need a paid plan? https://cdn.discordapp.com/attachments/1397124104175222845/1397125183411585115/image.png?ex=688095b9&is=687f4439&hm=f04fb604da85b77c9fc7101a999162ab7d11ee0773aa0b32ac9187cfda0b3e69&
c
I'm not sure if Free Plan is enough, however please check: https://botpress.com/docs/api-reference/files-api/getting-started
m
i already checked the documentation thank you, but i cant seem to find anyhthign related to free or paid plan.
m
i dont get why it doesnt work then if it should be posible
c
could you share what you already tried
m
well i vibe coded a frontend webchat and a box where i can send a file or document. i made it publicly by running it whit vercel and render as backend. i linked the knowledge base whit my front and backend and that works fine. the issue is that when i send a file or document the the api endpoint i get an 404 error message whit "page was not found".
📁 File upload received: Text Test.txt (10 bytes) 📁 File type: text/plain 🔍 DEBUG - Environment variables: BOTPRESS_BEARER_TOKEN: bp_pat_AHv8x7iVbfI1a... BOTPRESS_BOT_ID: 73dfb145-f1c3-451f-b7c8-ed463a9dd155 BOTPRESS_WORKSPACE_ID: wkspace_01JV4D1D6V3ZZFWVDZJ8PYECET Using BOT_ID: 73dfb145-f1c3-451f-b7c8-ed463a9dd155 Using WORKSPACE_ID: wkspace_01JV4D1D6V3ZZFWVDZJ8PYECET API_ID: 849275af-7f1d-4b86-92c9-c92c1b8d39fd 🔍 DEBUG - Files API call: URL: https://api.botpress.cloud/v1/files Authorization: Bearer bp_pat_AHv8x7iVbfI1a... x-bot-id: 73dfb145-f1c3-451f-b7c8-ed463a9dd155 ✅ File content uploaded to storage. 📚 Adding file to knowledge base... 🔍 Checking available knowledge bases... ❌ Failed to get/create knowledge base: 404 🔄 Falling back to hardcoded knowledge base ID: kb-bfdcb1988f 🔍 DEBUG - Knowledge Base API call: URL: https://api.botpress.cloud/v3/knowledge-bases/kb-bfdcb1988f/documents Authorization: Bearer bp_pat_AHv8x7iVbfI1a... x-bot-id: 73dfb145-f1c3-451f-b7c8-ed463a9dd155 Request body: { name: 'Text Test.txt', type: 'file', fileId: 'file_01K0RPMFP0YW0DMVNK47VERACF', workspaceId: 'wkspace_01JV4D1D6V3ZZFWVDZJ8PYECET' } ❌ API Error: 404 - Not Found ❌ Response data: 404 page not found ❌ Response headers: Object [AxiosHeaders] { date: 'Tue, 22 Jul 2025 09:15:03 GMT', 'content-type': 'text/plain; charset=utf-8', 'content-length': '19', connection: 'keep-alive', 🧹 Cleaned up temporary file after error: /opt/render/project/src/uploads/file-1753175702587-730970791.txt 'x-content-type-options': 'nosniff' } ❌ File upload error: Error: 404 - "404 page not found\n" at /opt/render/project/src/backend.js:820:15 at process.processTicksAndRejections (node:internal/process/task_queues:105:5) here is my debugging or logs in render!
if u need any spicifics just let me know
and i dont really know what to try because i cant really do anything else
c
I recommend first testing your Connection in a plain Node.js Project, to see if this problem is related to Render or not. extract the file i attached, install node.js locally on your computer. then open the "testupload" folder in an IDE such as visual studio code, within that open terminal and type: "node index.js" https://cdn.discordapp.com/attachments/1397124104175222845/1397151434302292058/testupload.zip?ex=6880ae2b&is=687f5cab&hm=8eb77929db49bfca1bb5b904659e01a503637811db3409b7f61904e0ae8eb463& https://cdn.discordapp.com/attachments/1397124104175222845/1397151435052945488/image.png?ex=6880ae2b&is=687f5cab&hm=855f16fb75a0fe3bb314b8aa9c927c64ff506f481ea0189f7c5f4061b011efbc&
c
Nice! So it's not a license issue then..
m
so what could the issue be now?
c
I don't know this looks like a Render related issue, so I don't think you will find the answer here, but rather in a Render community forum.
p
Did you create a knowledge base for the file to be added to and if so how are you indicating it in your api call?
g
Hi I am running into the same issue where I want to upload a text file to the knowledge base using API, I have BOT_ID, workspace_ID and the PAT API but when trying to access it gives me the error "404 Page Not Found" error Any help? thanks in advance
6 Views