Documents
Documents are files uploaded to a project. Once processed, the AI can search through them to answer questions and verify compliance. See Document Processing for a detailed explanation of the upload flow.
POST /api/v2/documents
Reserve a document upload slot. Step 1 of the upload flow. Returns a presigned URL for direct file upload to storage.
Authentication: Bearer token required
Request body:
Example request:
Example response 201 Created:
After receiving the response, upload your file directly to upload.url:
The upload URL expires after approximately 2 hours. If it expires before you upload, call this endpoint again to get a fresh URL.
POST /api/v2/documents/process
Trigger processing for uploaded documents. Step 2 of the upload flow. After uploading file bytes to the presigned URL, call this to start text extraction, chunking, and indexing.
Authentication: Bearer token required
Request body:
Example request:
Example response 200 OK:
Skipped reasons:
GET /api/v2/documents
List documents with optional filters. Supports pagination.
Authentication: Bearer token required
Query parameters:
Example request:
Example response 200 OK:
GET /api/v2/documents/{id}/download
Get a presigned download URL for a document. Returns a short-lived URL (10-minute expiry) for downloading the original source file. Use this to trace AI-generated citations back to the source document — critical for compliance audit trails.
Authentication: Bearer token required
Path parameters:
Example request:
Example response 200 OK:
Response fields:
The download URL expires after approximately 10 minutes. If it expires, call this endpoint again to get a fresh URL.
Error responses:
GET /api/v2/documents/{id}
Get details for a single document, including its processing status.
Authentication: Bearer token required
Path parameters:
Example request:
Example response 200 OK:
DELETE /api/v2/documents
Delete one or more documents by ID. The AI will no longer reference these documents.
Authentication: Bearer token required
Request body:
Example request:
Example response 200 OK:
Error responses:
Document fields (all endpoints):