sherlocked221_b
11/06/2025, 5:05 PMAI Evy
11/06/2025, 5:05 PMAI Evy
11/06/2025, 5:05 PMknowledge_base_urls parameter should be an array of valid URL strings .
Here's the correct format for creating a knowledge base with URLs :
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 .
**sherlocked221_b
11/06/2025, 5:06 PMjaneybeer_62318_30176
11/06/2025, 5:07 PMAI Evy
11/06/2025, 5:10 PMAI Evy
11/06/2025, 5:10 PMOmar Ashraf | Community Lead
11/06/2025, 7:28 PM