Logo ExelensiaExelensia/Docs
Getting Started
  • Introduction
API Reference
  • Schemas
  • Templates
  • Upload
  • Process
  • Files
  • Results
  • Exports

Upload

The Upload API handles document ingestion. Submit your file details to initiate an upload session — the platform returns an upload URL and manages the transfer. Once confirmed, your file is available for processing.

Supported File Types

TypeMIME Type
PDFapplication/pdf
JPEGimage/jpeg
PNGimage/png
WebPimage/webp
DOCXapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
PPTXapplication/vnd.openxmlformats-officedocument.presentationml.presentation
XLSXapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
EPUBapplication/epub+zip
RTFapplication/rtf
ODTapplication/vnd.oasis.opendocument.text
CSVtext/csv
TXTtext/plain

Maximum file size: 50 MB (52,428,800 bytes)

Upload Flow

  1. Call POST /v1/upload/initiate to start a session — you'll receive an upload_url and a file_id
  2. Upload your file to the returned upload_url via a PUT request
  3. The platform automatically confirms the upload and marks the file as ready
  4. Your file is now ready to use — proceed to the Process API

Endpoints

POST /v1/upload/initiate

Initiates an upload session and returns a URL to upload your file directly.

Request Body

FieldTypeRequiredDescription
filenamestringYesOriginal filename including extension (e.g. invoice.pdf)
mimetypestringYesMIME type of the file (must be a supported type)
bytesnumberYesFile size in bytes (must be ≤ 52,428,800)
schema_idstringNoOptional schema UUID to associate with this file at upload time
Bash
curl -X POST \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "invoice_2024_01.pdf",
    "mimetype": "application/pdf",
    "bytes": 245760
  }' \
  "https://api.exelensia.com/v1/upload/initiate"

Response

JSON
{
  "file_id": "019760a0-0020-7000-8000-000000000020",
  "upload_url": "https://uploads.exelensia.com/teams/019760a0-0000-7000-8000-000000000000/019760a0-0020-7000-8000-000000000020.pdf?token=...&expires=1706961600",
  "expires_in": 900
}
FieldDescription
file_idUUID of the created file record — use this when calling the Process API
upload_urlUpload URL — valid for expires_in seconds (15 minutes)
expires_inSeconds until the upload URL expires

Uploading Your File

After receiving the upload_url, upload the file using a PUT request with the exact Content-Type you specified:

Bash
curl -X PUT \
  -H "Content-Type: application/pdf" \
  --data-binary @invoice_2024_01.pdf \
  "https://uploads.exelensia.com/..."

Important: Use PUT, not POST. The Content-Type header must match the mimetype you specified in the initiate request.

Status Codes

StatusDescription
201Upload session created, upload URL returned
400Invalid request body, unsupported mimetype, or file too large
401Missing or invalid authentication

On this page

  • Supported File Types
  • Upload Flow
  • Endpoints
  • POST /v1/upload/initiate