API Reference

Upload Document

POST/api/v1/upload

Upload documents for processing and embedding.

Form Data

ParameterTypeRequiredDefaultDescription
filefileYes-PDF, DOCX, or TXT file
projectIdstringYes-Target project UUID

Example Request

bash
curl -X POST https://awrag.io/api/v1/upload \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "file=@document.pdf" \
  -F "projectId=your-project-uuid"

Processing Pipeline:

  1. File upload validation
  2. PDF/DOCX text extraction
  3. Text chunking (200 tokens per chunk, 20-token overlap)
  4. Batch embedding generation using advanced AI technology
  5. Vector storage with pgvector
  6. Status update to 'completed'

Supported File Types:

  • PDF (text extraction via multiple parsers)
  • DOCX (Word documents)
  • TXT (plain text)

File Size Limits:

  • Maximum file size: 10 MB
  • Maximum document length: ~50,000 words