Skip to main content
POST
/
prod
/
v1
/
files
/
upload
/
multipart
Upload a large file
curl --request POST \
  --url https://api.orion.file.ai/prod/v1/files/upload/multipart \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "fileName": "large-file.pdf",
  "fileType": "application/pdf",
  "fileSize": 150.5,
  "partSizeLimit": 10,
  "isSplit": false,
  "isSplitExcel": false,
  "callbackURL": "https://example.com/callback",
  "ocrModel": "Beethoven_ENG_O5.6",
  "schemaLocking": false,
  "directoryId": "649e2d2d2d2d2d2d2d2d2d2d"
}
'
{
  "id": "upload_aws_xyz789",
  "key": "org_123/workspace_456/device/file_abc/document.pdf",
  "s3Path": "s3://bucket/org_123/workspace_456/device/file_abc/document.pdf",
  "partSize": 6291456,
  "totalParts": 2,
  "totalSize": 9123430,
  "presignedUrls": [
    {
      "partNumber": 1,
      "presignedUrl": "https://s3.amazonaws.com/...?signature=...",
      "startByte": 0,
      "endByte": 6291455,
      "size": 6291456
    },
    {
      "partNumber": 2,
      "presignedUrl": "https://s3.amazonaws.com/...?signature=...",
      "startByte": 6291456,
      "endByte": 9123429,
      "size": 2831974
    }
  ],
  "uploadId": "file_abc123xyz",
  "callbackURL": "https://example.com/callback",
  "ocrModel": "Beethoven_ENG_O5.6",
  "schemaLocking": true,
  "isSplit": false,
  "isSplitExcel": false,
  "directoryId": "649e2d2d2d2d2d2d2d2d2d2d"
}
Initiate a multipart upload for large files (typically >100MB). This endpoint returns presigned URLs for each part that you can use to upload file chunks directly to storage.
Each presigned URL is valid for 900 seconds (15 minutes) and can be used multiple times.

How It Works

1

1. Initiate Upload

Call this endpoint to get presigned URLs for each part
2

2. Upload Parts

Upload each part to its respective presigned URL using PUT requests
3

3. Complete Upload

Call the complete multipart upload endpoint with all part ETags

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json
fileName
string
required

File name

Example:

"large-file.pdf"

fileType
string
required

File type

Example:

"application/pdf"

fileSize
number
required

File size in MB

Example:

150.5

partSizeLimit
number

Part size limit in MB (optional, default will be calculated)

Example:

10

isSplit
boolean
default:false

Is split

Example:

false

isSplitExcel
boolean

Is split excel - whether to split Excel files by worksheets

Example:

false

callbackURL
string

Callback URL

Example:

"https://example.com/callback"

ocrModel
enum<string>

OCR model

Available options:
Beethoven_ENG_O5.6,
Beethoven_ENG_G5.5,
Beethoven_ENG_GP25,
Beethoven_ENG_GP25.1,
Beethoven_ENG_GP25.2,
Beethoven_ENG_GP3,
Beethoven_CUS_O5.1,
Beethoven_CUS_O5.2,
Beethoven_CUS_GP25.1,
Unified (google-document-ai-ocr-gemini-v10),
Beethoven_ZH_O5.9,
Beethoven_JP_O5.3,
Beethoven_JP_G5.4,
Beethoven_TH_O5.1
Example:

"Beethoven_ENG_O5.6"

schemaLocking
boolean

Schema locking

Example:

false

directoryId
string

Directory Id

Example:

"649e2d2d2d2d2d2d2d2d2d2d"

Response

Multipart upload initiated successfully. Use the presigned URLs to upload each part.