API reference
POSTRequires Bearer token
Upload a document for AI
/api/ai/documents
Ingest a PDF.
- Multipart:
fileplus optionalexternal_id. - JSON:
filenameand eithercontent_base64orstorage_path.
Response 201: document_id, status (often pending / indexing), and optional job_id. Poll GET /api/ai/documents/{document_id}/status until ready or failed. Cross-tenant ids return 404 (never 403).
Path parameters
This endpoint has no path parameters.
Query parameters
This endpoint has no query parameters.
Request body
Send as multipart/form-data.
| Field | Type | Description |
|---|---|---|
file | string | PDF file (multipart). |
external_id | string | Optional external reference (for example a signing document id). e.g. "sig-123" |
filename | string | File name when sending JSON. e.g. "contract.pdf" |
content_base64 | string | PDF content, base64-encoded (JSON). |
storage_path | string | Existing object path under the tenant prefix (JSON). |
Responses
| Status | Meaning |
|---|---|
| 201 | See the example response. |
| 401 | Missing or invalid Bearer token. |