Skip to main content
POST
Upload a large file using multipart upload
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
This endpoint accepts an optional Idempotency-Key request header so a retry cannot apply the change twice. See Idempotent requests.

Authorizations

x-api-key
string
header
required

API key for authentication

Headers

Idempotency-Key
string

Optional opaque key (max 255 chars, UUIDv4 recommended) making this request idempotent for 24h: a retry with the same key and body replays the original response with Idempotent-Replayed: true.

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_CUS_O5.1,
Beethoven_CUS_O5.2,
Unified (google-document-ai-ocr-gemini-v10),
Aegis (google-document-ai-ocr-gemini-aegis-v1),
Beethoven_ZH_O5.9,
Beethoven_JP_O5.3,
Beethoven_JP_G5.4,
Beethoven_TH_O5.1,
Beethoven_TH_G5.1,
Beethoven_CUS_GP25.1,
Beethoven_Direct_Form_Filling (GP2.5)
Example:

"Beethoven_ENG_O5.6"

schemaLocking
boolean

Schema locking

Example:

false

directoryId
string

Directory Id

Example:

"649e2d2d2d2d2d2d2d2d2d2d"

destinationPath
string

Slash-delimited folder path for the uploaded document (e.g. "mammals/walrus"). Folders are auto-created if they do not exist. Can be used together with directoryId.

Example:

"mammals/walrus"

isEphemeral
boolean

Is ephemeral

Example:

false

pageCount
number

Page count of the PDF file. Used for early validation against page limits.

Example:

50

apiRequestId
string

Optional request ID to group files uploaded in the same API session. If not provided, one is auto-generated.

Example:

"my-batch-request-123"

retainOriginalZipFileName
boolean
default:false

Retain the original file name of a ZIP upload. Only applies to zip uploads (fileType "application/zip" or a .zip file name) and is ignored for all other files. When true, the original zip name is preserved (control characters, path separators and ".." are stripped, leading/trailing dots and whitespace trimmed, capped at 255 characters) and surfaced on the extracted files as zipArchiveName. When false (default), the name is sanitized as before.

Example:

false

Response

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