Skip to main content
POST
/
api
/
v1
/
rag
/
knowledge-base
/
{kb_id}
/
add-sources
Add Sources
curl --request POST \
  --url https://api.ravan.ai/api/v1/rag/knowledge-base/{kb_id}/add-sources \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "knowledge_base_texts": [
    {
      "title": "<string>",
      "text": "<string>"
    }
  ],
  "knowledge_base_urls": [
    "<string>"
  ]
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "knowledge_base": {
      "knowledge_base_id": "<string>",
      "knowledge_base_name": "<string>",
      "status": "<string>",
      "enable_auto_refresh": true,
      "knowledge_base_sources": [
        {
          "source_id": "<string>",
          "source_type": "<string>",
          "source_name": "<string>",
          "source_url": "<string>",
          "source_status": "<string>",
          "created_timestamp": 123
        }
      ],
      "created_timestamp": 123,
      "last_updated_timestamp": 123
    },
    "url_sources": [
      {
        "source_id": "<string>",
        "url": "<string>",
        "pages_found": 123,
        "status": "<string>"
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.ravan.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-Api-Key
string
required
Your Agni API key. Find it in your RavanAi.

Path Parameters

kb_id
string
required
Knowledge Base ID

Body (JSON)

For adding text and URL sources, use Content-Type: application/json:
knowledge_base_texts
array
Array of text source objects
knowledge_base_urls
string[]
Array of URLs to crawl and index

Body (File Upload)

For uploading files, use Content-Type: multipart/form-data:
file
file
File to upload (PDF, TXT, DOCX, MD)

Response

success
boolean
Whether the request succeeded.
message
string
Human-readable status message.
data
object
Returned data.

Authorizations

X-Api-Key
string
header
required

Path Parameters

kb_id
string
required

Knowledge Base ID

Body

knowledge_base_texts
object[]

Array of text sources

knowledge_base_urls
string[]

Array of URLs to crawl

Response

200 - application/json

Successful response

success
boolean
message
string
data
object