Upload document for RAG

View as markdown
POST /z1/rag/upload

Upload a document to be indexed for RAG retrieval. Supported formats: PDF, TXT, MD, DOCX

multipart/form-data

Body Required

  • file string(binary)

    Document file to upload

  • user_id string

    User ID to associate document with

  • metadata object

    Optional metadata for the document

Responses

  • 200 application/json

    Document uploaded successfully

    Hide response attributes Show response attributes object
    • document_id string
    • chunks_indexed integer
    • status string
  • 400 application/json

    Bad request - invalid parameters

    Hide response attributes Show response attributes object
    • status string
    • message string
    • code string
    • details object | null
  • 401 application/json

    Unauthorized - invalid or missing API key

    Hide response attributes Show response attributes object
    • status string
    • message string
    • code string
    • details object | null
POST /z1/rag/upload
curl \
 --request POST 'https://zenux-api.redglacier-fb4abe56.southafricanorth.azurecontainerapps.io/z1/rag/upload' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: multipart/form-data" \
 --form "file=@file" \
 --form "user_id=string" \
 --form 'metadata={}'
Response examples (200)
{
  "document_id": "doc_abc123",
  "chunks_indexed": 45,
  "status": "indexed"
}
Response examples (400)
{
  "code": "INVALID_MODEL",
  "status": "error",
  "message": "Invalid model specified"
}
Response examples (401)
{
  "code": "UNAUTHORIZED",
  "status": "error",
  "message": "Invalid API key"
}