Overview
For completed multi-image crop tasks, if the category of cropped child files is incorrect, you can use the amend category API to modify the category of cropped files.Use Cases
- Crop Category Correction: After automatic cropping, some child files have incorrect category recognition and need manual correction
- Category Adjustment: Business requirements change and cropped files need to be reclassified
API Endpoint
Endpoint:POST /api/app-api/sip/platform/v2/file/amend_category
Request Parameters
crop_tasks Parameter Description
Parameter Description
task_id: Parent task ID (task_type = 2), can be obtained through thefile/fetchAPIcrop_child_task_id: Child task ID (task_type = 3), can be obtained fromchild_filescategory: New file category name, must be a file category already configured in the DocFlow workspace
Example Code
Get Parent Task ID and Child File Information
Before modifying the file category, you need to obtain the parent task’stask_id and child file’s crop_child_task_id. You can query it through the file/fetch API:
Response
After successfully modifying the file category, the API returns a success response:Complete Example
The following is a complete example showing how to query multi-image crop task information and then modify child file categories:Python
Child Task ID Notes
crop_child_task_idis the child task’stask_id, which can be obtained from thechild_filesreturned by thefile/fetchAPI- Each child file generated by multi-image crop has a unique
task_id - Child files have
task_typeof3, indicating they are generated by multi-image crop
Notes
- Task Type Restriction: Only multi-image crop parent tasks (
task_type = 2) support using thecrop_tasksparameter - Category Must Exist: The specified
categorymust already be configured in the DocFlow workspace, otherwise an error will be returned - Category Name Matching: Category names must exactly match the configuration (case-sensitive)
- Child Task ID Must Be Valid: Ensure
crop_child_task_idis a valid child task ID - Reprocessing After Modification: After modifying the file category, the system will reprocess data according to the new category

