curl -X POST "http://localhost:8080/namespaces/my-documents/documents" \
-H "Content-Type: application/json" \
-d '{
"documents": [
{
"id": "doc-1",
"text": "Moorcheh on-prem retrieval test",
"team": "ai"
}
]
}'
{
"status": "success",
"message": "Documents upload started. Poll job status for progress.",
"job_id": "job-a0e3d54b9d0d4616949474697308a39c",
"namespace_name": "my-documents",
"total": 1
}
{
"status": "failure",
"message": "Bad Request: documents must be a non-empty array."
}
{
"status": "failure",
"message": "Bad Request: each document must include non-empty 'id' and 'text'."
}
{
"status": "failure",
"message": "Namespace 'my-embeddings' is not a text namespace."
}
{
"status": "failure",
"message": "Namespace 'my-documents' not found."
}
{
"status": "failure",
"message": "Item limit exceeded: max 100000, current 99999, requested 2 new items.",
"items": 99999,
"max_items": 100000,
"requested_new": 2
}
Data Operations
Upload Documents
Upload text documents to a text namespace. Embeddings are computed via Ollama. Returns an async job id.
POST
/
namespaces
/
{namespace_name}
/
documents
curl -X POST "http://localhost:8080/namespaces/my-documents/documents" \
-H "Content-Type: application/json" \
-d '{
"documents": [
{
"id": "doc-1",
"text": "Moorcheh on-prem retrieval test",
"team": "ai"
}
]
}'
{
"status": "success",
"message": "Documents upload started. Poll job status for progress.",
"job_id": "job-a0e3d54b9d0d4616949474697308a39c",
"namespace_name": "my-documents",
"total": 1
}
{
"status": "failure",
"message": "Bad Request: documents must be a non-empty array."
}
{
"status": "failure",
"message": "Bad Request: each document must include non-empty 'id' and 'text'."
}
{
"status": "failure",
"message": "Namespace 'my-embeddings' is not a text namespace."
}
{
"status": "failure",
"message": "Namespace 'my-documents' not found."
}
{
"status": "failure",
"message": "Item limit exceeded: max 100000, current 99999, requested 2 new items.",
"items": 99999,
"max_items": 100000,
"requested_new": 2
}
Overview
Upload one or more documents to a text namespace. Each document is embedded with the configured Ollama model and stored for semantic search. The upload runs asynchronously. Poll Upload job status with the returnedjob_id.
Any extra fields on each document object (for example
team, source) are stored as metadata and can be used in search filters.Path parameters
Headers
Body
curl -X POST "http://localhost:8080/namespaces/my-documents/documents" \
-H "Content-Type: application/json" \
-d '{
"documents": [
{
"id": "doc-1",
"text": "Moorcheh on-prem retrieval test",
"team": "ai"
}
]
}'
Response fields
Id of the async upload job. Poll Upload job status with this value. Present when the upload job was started.
Number of new item ids in the request that would exceed the cap. Present on 409 item limit errors.
{
"status": "success",
"message": "Documents upload started. Poll job status for progress.",
"job_id": "job-a0e3d54b9d0d4616949474697308a39c",
"namespace_name": "my-documents",
"total": 1
}
{
"status": "failure",
"message": "Bad Request: documents must be a non-empty array."
}
{
"status": "failure",
"message": "Bad Request: each document must include non-empty 'id' and 'text'."
}
{
"status": "failure",
"message": "Namespace 'my-embeddings' is not a text namespace."
}
{
"status": "failure",
"message": "Namespace 'my-documents' not found."
}
{
"status": "failure",
"message": "Item limit exceeded: max 100000, current 99999, requested 2 new items.",
"items": 99999,
"max_items": 100000,
"requested_new": 2
}
Important Notes
- At most 100,000 items total across all namespaces
- 409 is returned before the job starts if new ids would exceed the cap
- Re-uploading an existing id in the same namespace updates the item and does not consume extra quota
Next Steps
Related
Was this page helpful?