https://retellai.com/?utm_source=discord&utm_medium=seo logo
Unable to create knowledge base through post API b...
# ❓・ai-evy-support
s
@AI Evy Unable to create knowledge base through post API by providing knowledge_base_urls.
a
Thanks for tagging me @sherlocked221_b. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, when creating a knowledge base with URLs, you need to ensure your request follows the correct format [(1) ]() . The
knowledge_base_urls
parameter should be an array of valid URL strings . Here's the correct format for creating a knowledge base with URLs :
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() ;
The URLs must be valid URLs . Each knowledge base can have a maximum of 500 URLs [(2) ]() . There's a known issue where creating a knowledge base with texts or URLs via API returns a 500 error, but it works correctly when sending a request with files [(3) ]() . If you're experiencing a 500 error specifically when including URLs or texts, this may be related to that reported issue . **
s
Returns 500 internal server Error even though the url's are valid and the payload is as per the documentation. https://docs.retellai.com/api-references/create-knowledge-base
j
@Omar Ashraf | Community Lead If we could escalate this to high priority that would be incredible.
a
​ To learn more, see the sources I considered: [[1] Create Knowledge Base](https://docs.retellai.com/api-references/create-knowledge-base) [[2] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[3] Can not create Knowledge base with texts or urls using api](https://discord.com/channels/1186424376300679209/1433448045646975017) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
o
Hello @janeybeer_62318_30176 , @sherlocked221_b , i'v reported that to the team