Documents API
Upload, process, and AI-analyze documents.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /documents/upload | Upload a document |
GET | /documents | List documents |
GET | /documents/:id | Get document details |
POST | /documents/:id/analyze | AI analysis |
DELETE | /documents/:id | Delete document |
Upload Document
POST /api/v1/documents/upload
Content-Type: multipart/form-data| Field | Type | Description |
|---|---|---|
file | File | PDF, DOCX, or TXT (max 50MB) |
category | string | contract, 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
}