POST
/
v1
/
knowledge-bases
/
{knowledge_base_id}
/
sources
Add sources to a knowledge base
curl --request POST \
  --url https://api.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-Api-Key: <api-key>' \
  --form 'text_sources=<string>'
{
"message": "Sources added to knowledge base successfully",
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"organization_id": "123e4567-e89b-12d3-a456-426614174001",
"name": "Product Documentation",
"created_at": "2023-06-15T14:30:00Z",
"status": "ready",
"sources": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "file",
"created_at": "2023-06-15T14:30:00Z",
"file_name": "document.pdf",
"file_url": "https://storage.example.com/files/document.pdf"
}
]
},
"error": {
"details": [
{
"field": "email",
"message": "Invalid email format"
}
],
"message": "An error occurred while processing your request",
"status": 400,
"type": "generic_error"
},
"status": 200
}

Authorizations

X-Api-Key
string
header
required

The API Key created in Rounded Studio.

Path Parameters

knowledge_base_id
string<uuid>
required

Body

multipart/form-data
file_sources
file[] | null

List of PDF files to upload as sources. Only PDF files are supported.

text_sources
string | null

JSON string containing an array of text sources, each with 'title' and 'content' fields.

Response

Successfully added sources to knowledge base

data
object
required

The updated knowledge base data.

message
string
default:Sources added to knowledge base successfully

Response message indicating the result of the operation.

error
object | null
Example:
{
"details": [
{
"field": "email",
"message": "Invalid email format"
}
],
"message": "An error occurred while processing your request",
"status": 400,
"type": "generic_error"
}
status
integer
default:200

HTTP status code of the response.