Skip to main content
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 'file_sources=<string>' \
  --form 'text_sources=<string>' \
  --form file_sources.0.items='@example-file'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "status": "ingesting",
    "organization_id": "123e4567-e89b-12d3-a456-426614174001",
    "sources": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "created_at": "2023-11-07T05:31:56Z",
        "file_name": "<string>",
        "file_url": "<string>",
        "type": "file"
      }
    ]
  },
  "message": "Sources added to knowledge base successfully",
  "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
KnowledgeBaseGetApiResponseData · 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
ApiResponseError · object
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.