Skip to main content
POST
/
knowledgebase
cURL
curl --request POST \
  --url https://api.bolna.ai/knowledgebase \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form url=https://example.com/docs \
  --form chunk_size=512 \
  --form similarity_top_k=15 \
  --form overlapping=128
{
  "rag_id": "3c90c3xs0d444b5088228dd25736052a",
  "file_name": "sample-rag.pdf",
  "status": "processing",
  "source_type": "pdf"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
file
file

PDF file to upload (max 20 MB). Required if url is not provided.

url
string<uri>

URL to scrape and ingest as knowledgebase. Required if file is not provided.

Example:

"https://example.com/docs"

chunk_size
integer
default:512

Chunk size for embedding model

Example:

512

similarity_top_k
integer
default:15

Number of top similar nodes to return.

Example:

15

overlapping
integer
default:128

Number of characters which overlap in between neighboring nodes.

Example:

128

Response

knowledgebase create status response

rag_id
string<^[0-9a-fA-F]{32}$>
required

The ID of the knowledgebase

Example:

"3c90c3xs0d444b5088228dd25736052a"

file_name
string
required

File name of the PDF uploaded or URL ingested

Example:

"sample-rag.pdf"

status
enum<string>
required

Status of the knowledgebase. Initially the status would be processing.

Available options:
processing,
processed,
error
Example:

"processing"

source_type
enum<string>

Type of source ingested

Available options:
pdf,
url
Example:

"pdf"