https://retellai.com/?utm_source=discord&utm_medium=seo logo
Knowledge Base through API - 500 Error
# ❓・bug-report
s
Hey. I try to create a KB through API, nothing crazy just some texts. I get this error:
Copy code
500 - "{\"status\":\"error\",\"message\":\"Internal Server Error\"}"
I tried to send sample payload:
Copy code
{
  "knowledge_base_name": "Sample KB",
  "knowledge_base_texts": [
    {
      "text": "Hello, how are you?",
      "title": "Sample Question"
    }
  ]
}
I saw that the SDK might work, but i need my backend to do processing of the data before so I prefer to use HTTP requests.
s
Hey @Sahbak A 500 Internal Server Error is typically caused by a request formatting or header issue rather than the content itself. You can verify few things like Knowledge Base via HTTP: The request includes Content-Type: application/json Authorization header is set as Bearer The request uses POST and the correct Knowledge Base creation endpoint knowledge_base_texts is a non-empty array and each item contains a valid text field string If the same payload works with the SDK but fails over HTTP, the issue is usually related to headers, authorization, or JSON encoding.
s
I checked all of that Headers are ok and used like with any other http request i used until now The content-type is also set. I used a lot of http requests until now and didn't have a problem, that is the first one i encountered a problem with.
s
Can you share Org id
s
org_daObu2ypnjTA0iVk
s
Ok I report the issue as soon get a reply I will reach out to you
c
ensure you have the right link POST https://api.retellai.com/add-knowledge-base-sources/{knowledge_base_id}
s
I have the same issue as well