API Reference
Documents

Documents API

Upload, process, and AI-analyze documents.

Endpoints

MethodPathDescription
POST/documents/uploadUpload a document
GET/documentsList documents
GET/documents/:idGet document details
POST/documents/:id/analyzeAI analysis
DELETE/documents/:idDelete document

Upload Document

POST /api/v1/documents/upload
Content-Type: multipart/form-data
FieldTypeDescription
fileFilePDF, DOCX, or TXT (max 50MB)
categorystringcontract, policy, template, other

Response:

{
  "id": "doc-uuid",
  "filename": "agreement.pdf",
  "size_bytes": 245000,
  "mime_type": "application/pdf",
  "category": "contract",
  "status": "processing",
  "created_at": "2026-03-08T12:00:00Z"
}

Documents are automatically chunked and indexed into the RAG vector store for AI search.


AI Analysis

POST /api/v1/documents/:id/analyze
{
  "summary": "This is a Master Services Agreement between...",
  "key_terms": ["Payment: Net 30", "Term: 24 months", "Governing Law: New York"],
  "risks": ["No limitation of liability clause", "Broad indemnification"],
  "document_type": "services_agreement",
  "page_count": 12
}