Upload a large file using multipart upload
Initiate a multipart upload for large files (typically >100MB). This will return presigned URLs for each part.
More details
More details
- Call this endpoint to get presigned URLs for each part
- Upload each part to its respective presigned URL using PUT requests
- Call the complete multipart upload endpoint with all part ETags
fileName: the name of the file to be uploadedfileType: the MIME type of the filefileSize: the size of the file in MBpartSizeLimit: (optional) the size limit for each part in MBisSplit: whether the file should be split after upload (optional, default: false)isSplitExcel: whether to split Excel files by worksheets (optional, default: false)callbackURL: the url that will be called after processing (optional)ocrModel: the OCR model to use (optional)schemaLocking: whether the schema should be locked (optional)directoryId: the directory id where the file should be uploaded (optional)destinationPath: slash-delimited folder path where the file should be placed (e.g. “mammals/walrus”). Folders are auto-created if they do not exist. Can be used together with directoryId (optional)blueprintId: the file type id (fromGET /file-type) to use for every document in the file, skipping auto-classification. Must be an approved file type in your organization or a built-in one (optional)isEphemeral: whether the file and all related data should be deleted after the file is processed, must be one of true or false (optional, default: false)pageCount: page count of the file, used for early validation against page limits (optional)
Authorizations
API key for authentication
Headers
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
File name, including extension.
"large-file.pdf"
The file's MIME type, such as application/pdf. This is not the fileAI file type. Accepted values: Supported file types.
"application/pdf"
File size in MB
150.5
Part size limit in MB (optional, default will be calculated)
10
Split a file that holds several documents into separate documents, each with its own fileId. Default false.
false
Is split excel - whether to split Excel files by worksheets
false
URL fileAI calls once (no retries) with processing updates. Requests are not signed: confirm state with the API before acting. See Processing callbacks.
"https://example.com/callback"
OCR model for this file. Omit it to use your project default; set it when a file needs a different model, for example Japanese, Chinese or Thai documents. See Read and parse.
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), Capybara (Experimental) "Beethoven_ENG_O5.6"
Only classify into your saved schemas. See Schema locking.
false
Folder to place the file in. See Files and folders.
"649e2d2d2d2d2d2d2d2d2d2d"
File type id (the blueprintId from GET /file-type). Pre-selects that file type and its schema for every document in the file, skipping auto-classification. Must be an approved file type in your organization or a built-in one.
"649e2d2d2d2d2d2d2d2d2d2d"
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.
"mammals/walrus"
Delete the file and all related data after it is processed. Default false.
false
Page count of the PDF file. Used for early validation against page limits.
50
Optional request ID to group files uploaded in the same API session. If not provided, one is auto-generated.
"my-batch-request-123"
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.
false
Response
Multipart upload initiated successfully. Use the presigned URLs to upload each part. Each part's endByte is exclusive: PUT the bytes from startByte up to but not including endByte (size bytes).