Documents
Text and file ingestion, listing, removal and full base export.
Updated on Aug 10, 2026
Two input paths: plain text in JSON, or file in multipart/form-data. In both cases indexing is synchronous — extraction, chunking (512 tokens with 50 overlap, adjustable) and embedding happen on the call, and the response already confirms chunks and embed_tokens. The document appears in searches immediately.
https://api.hinow.ai/v1/rag/documentsBearerIndexes text into the base.
Parâmetros
rag_idstring· bodyobrigatórioThe target base.
textstring· bodyobrigatórioThe content.
filenamestring· bodyName/origin displayed in searches. Default `document.txt`.
document_idstring· bodyResending with the same id replaces the document (idempotent).
metadataobject· bodyFree-form pairs, returned in searches.
chunk_sizeinteger· bodyTokens per chunk. Default 512.
chunk_overlapinteger· bodyOverlap between chunks. Default 50.
Respostas
{
"document_id": "7bfee913effd4d40bac1c80a3daff25f",
"chunks": 1,
"embed_tokens": 21
}https://api.hinow.ai/v1/rag/documents/uploadBearerSends a file (multipart/form-data). PDF, DOCX, PPTX, XLSX, HTML, Markdown and any text — see the formats table on the RAG page.
Parâmetros
filefile· bodyobrigatórioUp to 25 MB.
rag_idstring· bodyobrigatóriodocument_idstring· bodyIdempotent replacement, like text.
Respostas
{
"document_id": "ef01480c509642298911297df854885f",
"chunks": 1,
"embed_tokens": 18
}Chunk size is the decision that weighs most
Short chunks hit the paragraph but lose surrounding context; long chunks bring context and dilute similarity. The default 512 tokens works well for documentation and policies; for pure FAQ, prefer question and answer pairs.
https://api.hinow.ai/v1/rag/documentsBearerLists the base's documents.
Parâmetros
rag_idstring· queryobrigatório
Respostas
{
"documents": [
{
"document_id": "ef01480c...",
"source": "garantia.pdf",
"chunk_count": 1,
"metadata": { "filename": "garantia.pdf", ... }
}
]
}https://api.hinow.ai/v1/rag/documents/{document_id}BearerRemoves a document. It goes to trash and can be restored for 15 days.
Parâmetros
document_idstring· pathobrigatóriorag_idstring· queryobrigatório
Respostas
{
"document_id": "56ef03f5...",
"deleted": true,
"trashed": true
}https://api.hinow.ai/v1/rag/documents/exportBearerExports the entire base with the full text of each document — backup and migration.
Parâmetros
rag_idstring· queryobrigatório
Respostas
{
"rag_id": "1d9cf4ae...",
"count": 7,
"documents": [
{ "document_id": "...", "source": "trocas.docx", "text": "...", "metadata": {...} }
]
}# texto puro
curl -s https://api.hinow.ai/v1/rag/documents \
-H "Authorization: Bearer hi_SUA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"rag_id": "1d9cf4ae05f64a9faf987981b22cdeae",
"text": "O cancelamento pode ser feito a qualquer momento no painel, sem multa.",
"filename": "cancelamento.txt"
}'
# arquivo
curl -s https://api.hinow.ai/v1/rag/documents/upload \
-H "Authorization: Bearer hi_SUA_API_KEY" \
-F "file=@precos.xlsx" \
-F "rag_id=1d9cf4ae05f64a9faf987981b22cdeae"import requests
BASE = "https://api.hinow.ai/v1/rag"
HEADERS = {"Authorization": "Bearer hi_SUA_API_KEY"}
RAG_ID = "1d9cf4ae05f64a9faf987981b22cdeae"
# texto puro
requests.post(f"{BASE}/documents", headers=HEADERS, json={
"rag_id": RAG_ID,
"text": "O cancelamento pode ser feito a qualquer momento no painel, sem multa.",
"filename": "cancelamento.txt",
})
# arquivo
with open("precos.xlsx", "rb") as f:
requests.post(
f"{BASE}/documents/upload", headers=HEADERS,
files={"file": f}, data={"rag_id": RAG_ID},
)
