Skip to main content
POST
Upsert Document

Authorizations

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.

Body

string
required
The organization ID that owns the resource. Use the organization ID from your Agni account.
string
required
The unique knowledge base ID. Use the ID returned by the knowledge base create or list endpoint.
string
required
The unique document ID in the knowledge base. Use a stable ID so later upserts update the same document.
string
The text content to ingest, search, or store, depending on the endpoint.
string
A publicly reachable URL. Include the full protocol, for example https://example.com/docs.
string[]
A list of publicly reachable URLs. Include the full protocol for each URL.
integer
The maximum number of pages to crawl or ingest from the provided URL sources.
integer
The maximum crawl depth when discovering or ingesting URLs. Higher values can include more nested pages.
object
Custom key-value data to attach to the resource. Use this for IDs or attributes from your own systems.

Response

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

Authorizations

X-Api-Key
string
header
required

Body

application/json
org_id
string
required

Organization ID

kb_id
string
required

Knowledge Base ID

doc_id
string
required

Document ID

text
string

Document text content

url
string

URL to crawl

urls
string[]

Multiple URLs to crawl

max_pages
integer

Max pages to crawl

max_depth
integer

Max crawl depth

metadata
object

Document metadata

Response

200 - application/json

Successful response

success
boolean
message
string
data
object