POST
/
api
/
v1
/
rag
/
document
curl -X POST https://api.ravan.ai/api/v1/rag/document \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "org_id": "1268c1f0-19f3-47db-aefb-c16a7c3ace6e",
    "kb_id": "product_docs",
    "doc_id": "pricing_page",
    "text": "Contact our sales team for usage-based pricing details.",
    "metadata": {"category": "pricing"}
  }'
{
  "success": true,
  "message": "Document upserted successfully",
  "data": {
    "org_id": "1268c1f0-19f3-47db-aefb-c16a7c3ace6e",
    "kb_id": "product_docs",
    "doc_id": "pricing_page",
    "status": "indexed"
  }
}

Authorizations

X-Api-Key
string
required
Your Agni API key. Find it in your support@ravan.ai under Settings → API Keys.

Body

org_id
string
required
UUID of your organization.
kb_id
string
required
Knowledge base identifier (e.g. "product_docs", "help_center").
doc_id
string
required
Unique document identifier. If a document with this ID exists, it will be updated.
text
string
Raw text content to ingest. Omit if using url or urls.
url
string
Single URL to crawl and ingest.
urls
string[]
Array of URLs for batch crawling.
max_pages
integer
Maximum pages to crawl. Default: 500.
max_depth
integer
Maximum link depth to follow. Default: 5.
metadata
object
Optional key-value metadata (e.g. {"category": "pricing"}).

Response

success
boolean
Whether the request succeeded.
message
string
Human-readable status message.
data
object
The upserted document record.
curl -X POST https://api.ravan.ai/api/v1/rag/document \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "org_id": "1268c1f0-19f3-47db-aefb-c16a7c3ace6e",
    "kb_id": "product_docs",
    "doc_id": "pricing_page",
    "text": "Contact our sales team for usage-based pricing details.",
    "metadata": {"category": "pricing"}
  }'
{
  "success": true,
  "message": "Document upserted successfully",
  "data": {
    "org_id": "1268c1f0-19f3-47db-aefb-c16a7c3ace6e",
    "kb_id": "product_docs",
    "doc_id": "pricing_page",
    "status": "indexed"
  }
}

Authorizations

X-Api-Key
string
header
required

Body

application/json
org_id
string
required
kb_id
string
required
doc_id
string
required
text
string
url
string
urls
string[]
max_pages
integer
default:500
max_depth
integer
default:5
metadata
object

Response

Successful response