designthely
10/23/2025, 3:14 PMAI Evy
10/23/2025, 3:14 PMAI Evy
10/23/2025, 3:14 PMAI Evy
10/23/2025, 3:14 PMPOST /add-knowledge-base-sources/{knowledge_base_id} where the knowledge base ID is in the URL path [(1) ]() .
2. Knowledge base ID placement:
The knowledge_base_id should be in the URL path as a path parameter . According to the documentation, it's a required path parameter with the format "kb_1234567890" .
3. Correct request body structure:
The request should use multipart/form-data format, not JSON . The body parameters are:
- knowledge_base_texts (object[]) : Texts to add to the knowledge base
- knowledge_base_files (file[]) : Files to add (limit 25 files, 50MB each)
- knowledge_base_urls (string[]) : URLs to be scraped and added
For URLs specifically, the format should be:
json
[
"<https://www.example.com%22,>
"<https://www.retellai.com%22>
]
Your issue:
Your 500 error is likely caused by using JSON format instead of multipart/form-data . This matches a similar issue reported by another user who was getting 500 errors when using the wrong request format [(2) ]() .
The correct approach would be to send the request as multipart/form-data with the knowledge base ID in the URL path, not in the request body.AI Evy
10/23/2025, 3:14 PMdesignthely
10/23/2025, 3:25 PMAI Evy
10/23/2025, 3:25 PMAI Evy
10/23/2025, 3:25 PMPOST <https://api.retellai.com/add-knowledge-base-sources/%7Bknowledge_base_id%7D>
[(1) ]()
Where {knowledge_base_id} should be replaced with your actual knowledge base ID (e.g., "kb_1234567890") .
Content-Type:
The request must use multipart/form-data format, not JSON .
Request Body Structure:
For adding URLs specifically, use the knowledge_base_urls parameter as a string array :
json
[
"<https://www.example.com%22,>
"<https://www.retellai.com%22>
]
Complete Example:
- URL: `
- Method: POST
- Content-Type: multipart/form-data
- Authorization: Bearer YOUR_API_KEY
- Body: Include knowledge_base_urls as a form field with your URL array
The 500 error you're experiencing is likely because you're sending JSON instead of multipart/form-data. Switch to multipart/form-data format and ensure the knowledge base ID is in the URL path, not the request body .AI Evy
10/23/2025, 3:25 PMAI Evy
10/23/2025, 3:25 PMdesignthely
10/23/2025, 5:45 PMAI Evy
10/23/2025, 5:45 PMAI Evy
10/23/2025, 5:46 PMAI Evy
10/23/2025, 5:46 PMAI Evy
10/23/2025, 5:46 PM