Minerva API
API referenceDocuments

Upload a document

POST/documents

Multipart (file=) or JSON ({url} | {base64,fileName}). projectId is optional: present links the document to a project (its model subtopics auto-resolve); omit for a library upload. Use dataGroupIds to target specific groups. Upload does NOT start preprocessing — the document returns status "uploaded"; call POST /documents/process to parse it. Optional reference (multipart: a JSON string field) is an opaque string→string object echoed back on the job and webhooks; limits: ≤20 keys, key ≤64, value ≤500, total ≤4 KB. Do NOT store personal data or secrets in reference — it appears in webhook payloads and server-side logs. Optional metadata (multipart: a JSON string field) sets metadata values on the new document, same shape as PATCH /documents/{id}; an unknown field id refuses the upload with 422 before anything is stored.

Requires an API key with one of these roles: admin, editor.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key created in Settings → API Keys.

In: header

Request Body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/documents" \  -H "Content-Type: application/json" \  -d '{    "url": "string"  }'
{  "data": {    "documentId": "4704590c-004e-410d-adf7-acb7ca0a7052",    "fileName": "string",    "status": "uploaded"  },  "meta": {    "requestId": "string",    "timestamp": "string"  }}