This document demonstrates how to upload files to DocFlow through REST API. For more supported file formats, see File Format Support.
batch_number
) and several file identifiers (file_id
) for subsequent business workflow queries and result retrieval.
Docflow supports common image formats, PDF, and Office file formats, with multi-page documents supporting up to 1000 pages. You can refer to the more detailed File Format Support and Limitations page.
01 Upload Single File
Parameter Description
Required Parameters
workspace_id
: Workspace ID. Refer to the Get Workspace ID document.
Optional Parameters
Can be added to URL query parameters as needed:category
: File category (e.g., invoice)batch_number
: Batch number, automatically generated by the system when not provided (recommended: use the same batch number for multiple files in the same batch for easier querying)auto_verify_vat
: Whether to enable invoice verification, default falsesplit_flag
: Whether to perform file splitting, default false (see File Splitting section)crop_flag
: Whether to perform multi-image cropping, default false (see Multi-Image Cropping section)target_process
: Target processing type, options areclassify
orextract
.
Docflow will perform the complete workflow of parsing -> classification -> extraction by default. Whentarget_process
isclassify
, the workflow ends at classification to achieve classification-only requirements.
curl
02 Batch Upload
When you want to associate multiple files to one batch, you can use batch upload. There are two ways for batch upload:- Upload multiple files in one request. This approach is relatively simple, and you can implement batch upload by repeatedly including multiple
file
fields in the same request:
result.batch_number
and a list of successfully uploaded files
.
- Upload through multiple requests, associating these files through
batch_number
.
When the total size of multiple files is too large, you can associate multiple files this way. The first request will return abatch_number
, and subsequent requests reuse thisbatch_number
to associate remaining files.
03 Query Processing Results by Batch Number
After upload is complete, you can usebatch_number
to query processing results for that batch: