https://retellai.com/?utm_source=discord&utm_medium=seo logo
Hi Retell team,I’m trying to add a Knowledge Base ...
# ❓・ai-evy-support
y
@AI Evy Hi Retell team, I’m trying to add a Knowledge Base source using the endpoint shown in your API documentation: POST https://api.retellai.com/add-knowledge-base-sources/{knowledge_base_id} Body: { “knowledge_base_texts”: [ { “title”: “Sample title”, “text”: “Sample text” } ] } My Knowledge Base ID: knowledge_base_c49ba127dcafe558 The request always returns: {“status”:“error”,“message”:“Internal Server Error”} This error happens in every environment: Zapier cURL Code by Zapier Your own API Explorer in the Retell dashboard Even the API Explorer shows the same 500 when I click “Send”, so it looks like the issue is on the backend. Can you please check why this endpoint is failing and whether knowledge_base_texts is still supported? Thank you.
a
Thanks for tagging me @yaremass2. I'll look through relevant sources and get back to you shortly.
### Answer I can see you're experiencing a 500 Internal Server Error when trying to add Knowledge Base sources [(1) ]() . Based on the documentation and similar issues reported by other users, here are a few things to check: Correct Request Format The endpoint expects form-data format, not JSON . Here's the correct 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.addSources({
 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() ;
Common Issues from Community Other users have reported similar 500 errors when creating or adding to knowledge bases [(2) ]() . The issues were often resolved by: 1. Using the official Retell SDK instead of direct API calls 2. Ensuring the
knowledge_base_name
is properly formatted as a string 3. Using FormData with proper headers when making direct API calls Knowledge Base Limits Ensure you haven't exceeded the limits: at max 50 text snippets per knowledge base [(3) ]() . If the issue persists even when using the SDK as shown above, I recommend reaching out to Retell support directly, as the 500 error suggests a backend issue that may need investigation. **
​ To learn more, see the sources I considered: [[1] Add Knowledge Base Sources](https://docs.retellai.com/api-references/add-knowledge-base-sources) [[2] internal server error on create knowledge base by API](https://discord.com/channels/1186424376300679209/1391417148215136376) [[3] Knowledge Base](https://docs.retellai.com/build/knowledge-base) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.