For completed file split tasks, if the category of split child files is incorrect or you need to adjust the page range of child files, you can use the amend category API to modify the category and page numbers of split files.
This API is used to modify the category and page numbers of child files generated by file split tasks (task_type = 2, parent task). You need to first obtain the parent task’s task_id.
task_id: Parent task ID (task_type = 2), can be obtained through the file/fetch API
category: New file category name, must be a file category already configured in the DocFlow workspace. If a child file doesn’t need category modification, you can keep the original category unchanged
pages: Page number array indicating the original file pages contained in this child file. For example, [0, 1] means pages 1 and 2 (starting from 0). If a child file doesn’t need page number modification, you can keep the original page numbers unchanged
Important: The split_tasks array must contain all split child file information, even if some child files don’t need category or page number modifications. If only partial child file information is submitted, the unlisted child files will be deleted or cause processing exceptions.
# Important: Must include all split child file information# Assuming the original file is split into 3 child files, even if you only need to modify the first child file's category,# you must include information for all 3 child filescurl -X POST \ -H "x-ti-app-id: <your-app-id>" \ -H "x-ti-secret-code: <your-secret-code>" \ -H "Content-Type: application/json" \ -d '{ "workspace_id": "1234567890", "task_id": "1234567890", "split_tasks": [ { "category": "Electronic Invoice (Regular)", "pages": [0, 1] }, { "category": "Contract", "pages": [2, 3, 4] }, { "category": "Receipt", "pages": [5, 6] } ] }' \ "https://docflow.textin.com/api/app-api/sip/platform/v2/file/amend_category"
Before modifying the file category, you need to obtain the parent task’s task_id and child file information. You can query it through the file/fetch API:
Must Include All Child Files: The split_tasks array must contain all split child file information, even if some child files don’t need category or page number modifications. If only partial child file information is submitted, the unlisted child files will be deleted or cause processing exceptions
Task Type Restriction: Only file split parent tasks (task_type = 2) support using the split_tasks parameter
Category Must Exist: The specified category must 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)
Page Range: Ensure page numbers in the pages array are within valid range (0 to total pages - 1), and page numbers cannot be duplicated
No Duplicate Pages: Each page number can only appear in one child file, no overlapping allowed
Reprocessing After Modification: After modifying file categories and page numbers, the system will reprocess data according to the new categories and page ranges