wise-white
wise-white4mo ago

Upload files to a vapi manages knowledge base via api

Hi there is there currently any way to upload a file and give an existing assistant access to it in the same manner as you can via the vapi dashboard but via api? Thanks
4 Replies
Vapi Support Bot
Yes, you can upload a file to Vapi via the API using the following cURL command:
curl -X POST https://api.vapi.ai/file \
-H "Authorization: Bearer <token>" \
-H "Content-Type: multipart/form-data" \
-F file=@<file1>
curl -X POST https://api.vapi.ai/file \
-H "Authorization: Bearer <token>" \
-H "Content-Type: multipart/form-data" \
-F file=@<file1>
This will upload your file and return a file ID. However, the documentation does not specify how to directly associate this file with a knowledge base or update an assistant's access via API, so further steps may require dashboard actions or additional API endpoints not covered here. Sources: - Vapi API Reference: Upload File - Vapi API Reference: List Knowledge Bases - Vapi API Reference: Get Knowledge Base - Vapi API Reference: Create Assistant
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
deep-jade
deep-jade4mo ago
Yes, via the Vapi API you can upload files using the /file endpoint, create a KB with those files, and then attach that KB to an existing assistant for access..
wise-white
wise-whiteOP4mo ago
Would you mind pointing me to where thats explained in the api docs? I can only see on the knowledge base create endpoint that theres config for trieve or for a custom knowledge based using my server https://docs.vapi.ai/api-reference/knowledge-bases/create
Sahil
Sahil4mo ago
Hey jack, you can follow this documentation on how to create a knowledge base using API: https://docs.vapi.ai/knowledge-base/using-query-tool

Did you find this page helpful?