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>"
      }
    ]
  }
}

Authorizations

X-Api-Key
string
required
Your Agni API key used to authenticate the request. Pass it in the X-Api-Key header. Find or rotate it from your Ravan AI account settings.

Path Parameters

kb_id
string
required
The unique knowledge base ID. Use the ID returned by the knowledge base create or list endpoint.

Body (JSON)

For adding text and URL sources, use Content-Type: application/json:
knowledge_base_texts
array
Inline text sources to add to the knowledge base. Each item should include a title and the text content.
knowledge_base_urls
string[]
A list of URLs to crawl and add as knowledge base sources. Each URL must be publicly reachable.

Body (File Upload)

For uploading files, use Content-Type: multipart/form-data:
file
file
The file to upload as a knowledge base source. Use multipart form data for file uploads.

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