https://retellai.com/?utm_source=discord&utm_medium=seo logo
when I'm trying to create a knowledgebase via API ...
# ❓・ai-evy-support
a
@AI Evy when I'm trying to create a knowledgebase via API it keeps giving a 500 error is there a certain account level I need to have to access the API knowledge base creation, it does work manually through retellai.com ui
a
Thanks for tagging me @apsquire. I'll look through relevant sources and get back to you shortly.
### Answer The 500 error you're experiencing with the knowledge base creation API is a known issue that other users have encountered [(1) ]() [(2) ]() . There's no specific account level requirement mentioned in the documentation for accessing the knowledge base API [(3) ]() . Other users have reported similar 500 Internal Server Error issues when creating knowledge bases via API, even when the UI works fine [(1) ]() [(2) ]() . One workaround that helped some users was using the Retell SDK with proper FormData formatting instead of direct API calls [(1) ]() . Here's a working approach using the Retell SDK:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
async function main() {
 const knowledgeBaseResponse = await client.knowledgeBase.create({
 knowledge_base_name: "Sample KB",
 knowledge_base_texts: [
 {
 text: "Hello, how are you?",
 title: "Sample Question",
 },
 ],
 knowledge_base_urls: [
 "<https://www.retellai.com%22,>
 "<https://docs.retellai.com%22,>
 ],
 knowledge_base_files: [
 fs.createReadStream("../sample.txt") ,
 ],
 }) ;
 console.log(knowledgeBaseResponse.knowledge_base_id) ;
}
main() ;
[(3) ]() If you continue experiencing 500 errors, I recommend visiting [Contact Sales]() or [) for additional support, as this appears to be an ongoing issue that may require backend investigation [(1) ]() [(2) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] internal server error on create knowledge base by API](https://discord.com/channels/1186424376300679209/1391417148215136376) [[2] Create Knowledge Base Endpoints Not Working](https://discord.com/channels/1186424376300679209/1358877563161809067) [[3] Create Knowledge Base](https://docs.retellai.com/api-references/create-knowledge-base) ​