cute_courgette_01177
11/28/2025, 6:36 PMAI Evy
11/28/2025, 6:36 PMAI Evy
11/28/2025, 6:36 PM/create-knowledge-base endpoint requires multipart/form-data format [(1) ]() . The documentation explicitly states the body type as multipart/form-data , not JSON.
When you send JSON directly (like {"knowledge_base_name": "debug-link-test"}) , the server likely cannot parse it correctly as form-data, resulting in the 500 error you're seeing.
For the correct syntax with URL sources using multipart/form-data, the JavaScript SDK example shows :
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() ;
If you're making raw HTTP requests instead of using the SDK, you'll need to format your request as multipart/form-data with the knowledge_base_name as a form field and knowledge_base_urls as an array field .AI Evy
11/28/2025, 6:42 PMAI Evy
11/28/2025, 6:42 PMAI Evy
11/28/2025, 6:48 PMcute_courgette_01177
11/28/2025, 6:48 PMAI Evy
11/28/2025, 6:48 PMjavascript
import Retell from 'retell-sdk';
import fs from 'fs';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
async function main() {
try {
const formData = new FormData() ;
formData.append('knowledge_base_name', 'KB_Name') ;
formData.append('knowledge_base_urls', '<https://www.arthur.ai')> ;
const response = await fetch('<https://api.retellai.com/create-knowledge-base',> {
method: 'POST',
headers: {
'Authorization': `Bearer ${client.apiKey}`,
},
body: formData,
}) ;
if (!response.ok) {
const errorText = await response.text() ;
console.error('Error creating knowledge base:', errorText) ;
return;
}
const result = await response.json() ;
console.log('Knowledge base created successfully:', result) ;
} catch (error) {
console.error('Error:', error) ;
}
}
main() ;
## Requirements
According to the documentation, you don't need all three source types (texts, files, URLs) simultaneously [(1) ]() . You can create a knowledge base with just URLs, just files, or just text snippets [(1) ]() [(3) ]() .
If the corrected cURL syntax doesn't resolve the 500 error, I recommend reaching out to Retell AI support directly:
- Visit [Contact Sales]()
- Visit [)AI Evy
11/28/2025, 6:48 PM/create-knowledge-base endpoint. Based on the available sources, there are a few issues with your cURL command that might be causing this problem.
## Issue with URL Array Syntax
Your cURL command uses `knowledge_base_urls[0]= but the documentation shows that knowledge_base_urls should be a string array [(1) ]() . The proper way to send arrays in multipart/form-data with cURL is to repeat the field name, not use bracket notation.
Try this corrected cURL command:
bash
curl -X POST "<https://api.retellai.com/create-knowledge-base%22> \
-H "Authorization: Bearer YOUR_RETELL_API_KEY" \
-F "knowledge_base_name=debug-link-test" \
-F "enable_auto_refresh=true" \
-F "knowledge_base_urls=<https://www.arthur.ai%22>
## Community-Reported Similar Issues
Other users have reported similar 500 errors when creating knowledge bases via API [(2) ]() . One solution that worked involved using the Retell SDK with proper FormData construction:AI Evy
11/28/2025, 6:49 PMAI Evy
11/28/2025, 6:49 PMAI Evy
11/28/2025, 6:53 PM/create-knowledge-base endpoint. You've correctly identified that:
1. The endpoint is reachable and authentication works (confirmed by the validation error when no body is sent) [(1) ]()
2. You're using the correct multipart/form-data format as specified in the documentation
3. The 500 error occurs consistently whenever knowledge_base_name is included with valid values
## What the Documentation Shows
The official API reference shows the endpoint expects multipart/form-data with these fields :
- knowledge_base_name (string, required)
- knowledge_base_texts (object[], optional)
- knowledge_base_files (file[], optional)
- knowledge_base_urls (string[], optional)
- enable_auto_refresh (boolean, optional)
## Community Reports Confirm This Issue
Other users have reported identical 500 errors when creating knowledge bases via API [(2) ]() . One user specifically noted getting {"status":"error","message":"Internal Server Error"} even with minimal valid payloads .
## Recommended Next Steps
Since you've exhausted the documented approaches and this appears to be a server-side issue, you should contact Retell AI support directly:
- Visit [Contact Sales]()
- Visit [)
When contacting support, share:
- Your exact cURL command (with redacted API key)
- The timestamp of your requests
- The consistent 500 response pattern
This will help them check server logs and identify the root cause of the internal server error.
**AI Evy
11/28/2025, 6:53 PMcute_courgette_01177
11/28/2025, 6:53 PMAI Evy
11/28/2025, 6:54 PMAI Evy
11/28/2025, 6:54 PMAI Evy
12/19/2025, 9:01 AM