Upload
The Upload API ingests a document in a single request. Send the file as multipart/form-data and the platform stores it and returns a file record you can process. If auto-processing is enabled for your account (the default), the file is also queued for extraction immediately.
Supported File Types
| Type | MIME Type |
|---|---|
application/pdf | |
| JPEG | image/jpeg |
| PNG | image/png |
| WebP | image/webp |
| DOCX | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| PPTX | application/vnd.openxmlformats-officedocument.presentationml.presentation |
| XLSX | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| EPUB | application/epub+zip |
| RTF | application/rtf |
| ODT | application/vnd.oasis.opendocument.text |
| CSV | text/csv |
| TXT | text/plain |
Maximum file size: 50 MB (52,428,800 bytes)
Endpoints
POST /v1/upload
Uploads a document. The request must be multipart/form-data containing the file itself.
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | The document to upload. Must be a supported type and at most 50 MB. |
schema_id | string | No | Schema UUID to associate with this file. When auto-processing runs, this schema is applied. |
curl -X POST \
-H "x-api-key: wk_xxxxxxxx.your_secret_here" \
-F "file=@invoice_2024_01.pdf;type=application/pdf" \
-F "schema_id=019760a0-0001-7000-8000-000000000001" \
"https://api.exelensia.com/v1/upload"The
filepart is required. Theschema_idpart is optional — omit it to upload without associating a schema.
Response
{
"file_id": "019760a0-0020-7000-8000-000000000020",
"filename": "invoice_2024_01.pdf",
"bytes": 245760,
"mimetype": "application/pdf",
"process": {
"id": "019760a0-0030-7000-8000-000000000030",
"status": "queued"
}
}| Field | Description |
|---|---|
file_id | UUID of the created file record — use it with the Process and Files APIs |
filename | Stored filename (sanitized) |
bytes | File size in bytes |
mimetype | Detected MIME type of the uploaded file |
process | The extraction job that was queued automatically, as { id, status }, or null if auto-processing is disabled |
Auto-Processing
When your account has auto-processing enabled (the default), the upload response includes a process object with status queued and the file begins extraction right away — you can skip the Process API and poll the Results API directly.
When auto-processing is disabled, process is null. Submit the file for extraction yourself via POST /v1/process.
Status Codes
| Status | Description |
|---|---|
201 | File uploaded (and queued for processing if auto-processing is enabled) |
400 | No file provided, unsupported MIME type, empty file, or invalid schema_id |
401 | Missing or invalid authentication |
413 | File exceeds the 50 MB limit |
503 | The service is temporarily busy handling uploads — retry shortly |