Update Custom knowledge base
# support
u
Hello, impossible to update the database may you help me please ? 2 days I'm struggling on this node in n8n. The code And the body : on images I tried to stringify the object but doesn’t work too. Error code 400 Full message 400 - "{\"message\":\"We couldn't find a validator for your input. Contact support@vapi.ai for help.\",\"error\":\"Bad Request\",\"statusCode\":400}" Request { "body": { "provider": "custom-knowledge-base", "server": { "url": "https://api.vapi.ai/knowledge-base/0e16b8c3-7dc4-44cb-afa6-63d18a4129a4" }, "documents": [ { "fileId": "88432ee0-e53b-4a2f-84ac-f3942d760a3e", "similarity": 1 } ] }, "headers": { "authorization": "**hidden**", "content-type": "application/json", "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7" }, "method": "PATCH", "uri": "https://api.vapi.ai/knowledge-base/0e16b8c3-7dc4-44cb-afa6-63d18a4129a4", "gzip": true, "rejectUnauthorized": true, "followRedirect": true, "resolveWithFullResponse": true, "followAllRedirects": true, "timeout": 300000, "encoding": null, "json": false, "useStream": true } Other info Item Index 0 Node type n8n-nodes-base.httpRequest Node version 4.2 (Latest) n8n version 1.77.3 (Self Hosted) Time 15/02/2025 23:25:25 Stack trace NodeApiError: Bad request - please check your parameters at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:525:33) at processTicksAndRejections (node:internal/process/task_queues:95:5) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:633:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:882:51 at 4 / 4 /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1216:20 https://cdn.discordapp.com/attachments/1340615317772308520/1340615317939945513/Screenshot_20250216-102412_Outlook_1.jpg?ex=67b300cf&is=67b1af4f&hm=91cc7b00c073596faf1dd2e8a59a03d889856abc4867c1c58cd79d09eb30becc& https://cdn.discordapp.com/attachments/1340615317772308520/1340615318187540522/Screenshot_20250216-102440_Outlook_1.jpg?ex=67b300cf&is=67b1af4f&hm=0fd6ed330cf04a532e5d0d57b37a8a30eb6497379f074383d1db3c1791f37b8e& https://cdn.discordapp.com/attachments/1340615317772308520/1340615318439202836/Screenshot_20250216-102452_Outlook_1.jpg?ex=67b300cf&is=67b1af4f&hm=ad5459c81d41548adb26c4e60452a37229364ec9090481223646674d5217593e&
Sorry for the bad quality of the images. I don't know why it's blur. But I tried many time with many body request, I always get this error. i'd like to add to the ephemere database some variables ID database just created file ID to add so the agent know some details i dont really understand the API doc at this point.
b
dont put your api key in the header. that's dangerous. It should be stored in N8N in their api keys
a
Hey, You're getting a 400 error with the message "We couldn't find a validator for your input" when trying to update a knowledge base via PATCH request. The Problem Looking at the validation pipe and knowledge base types, there are two main issues: 1\. The request body structure is incorrect 2\. The
provider
field is required but missing in your request The Solution Here's the correct request body structure you should use: \`\`\`json { "provider": "custom-knowledge-base", "server": { "url": "your-server-url" } } \`\`\` Key points: 1\. The
provider
field is mandatory and must be "custom-knowledge-base" 2\. The
documents
array should not be included in the PATCH request 3\. The
server
object is required and must contain a valid URL
v
✅ Ticket status updated to solved by Vapi Ticket Bot#0124
u
thank you, but finnay i used trieve for more easy stuff.
i have self hosted version. how do you store anywhere else from headers?
b
N8N built in authentication. “Custom header auth”
I would def educate yourself on security. Your current setup, you’re hard coding an api key which is a big no no. N8N makes it super easy.
u
I'll take a look tomorrow, I just shut down the comp, it's 03:25 here. Thank you bro