Skip to main content
This document demonstrates how to delete file tasks in DocFlow through REST API. The deletion operation supports multiple condition combinations, and files matching any condition will be deleted.
DocFlow provides a flexible deletion interface that supports deleting files by batch number, task ID, file ID, or time range. The deletion operation is irreversible, please proceed with caution.

Delete by Batch Number

Delete all files under specified batches:
curl -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": "<your-workspace-id>",
    "batch_number": ["202412190001", "202412190002"]
  }' \
  "https://docflow.textin.com/api/app-api/sip/platform/v2/file/delete"

Delete by Task ID

Delete files corresponding to specified task IDs:
curl -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": "<your-workspace-id>",
    "task_id": ["1978297791713619968", "1978297791713619969"]
  }' \
  "https://docflow.textin.com/api/app-api/sip/platform/v2/file/delete"

Delete by File ID

Delete files corresponding to specified file IDs:
curl -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": "<your-workspace-id>",
    "file_id": ["1978297792124661760", "1978297792124661761"]
  }' \
  "https://docflow.textin.com/api/app-api/sip/platform/v2/file/delete"

Delete by Time Range

Delete files created within specified time range:
curl -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": "<your-workspace-id>",
    "start_time": 1760523600,
    "end_time": 1760527200
  }' \
  "https://docflow.textin.com/api/app-api/sip/platform/v2/file/delete"

Combined Condition Deletion

Multiple conditions can be used simultaneously for deletion. Files matching any condition will be deleted:
curl -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": "<your-workspace-id>",
    "batch_number": ["202412190001"],
    "file_id": ["1978297792124661760"],
    "start_time": 1760523600,
    "end_time": 1760527200
  }' \
  "https://docflow.textin.com/api/app-api/sip/platform/v2/file/delete"

Parameter Description

Required Parameters

  • workspace_id: Workspace ID. Please refer to the Get Workspace ID documentation.

Optional Parameters

Deletion conditions support the following parameters. Files matching any condition will be deleted:
  • batch_number: Batch number list, delete all files under specified batches
  • task_id: Task ID list, delete files corresponding to specified tasks
  • file_id: File ID list, delete specified files
  • start_time: Start time (epoch timestamp, unit: seconds)
  • end_time: End time (epoch timestamp, unit: seconds)

Response Description

After successful deletion, the interface returns the number of deleted files:
{
  "code": 200,
  "msg": "success",
  "result": {
    "deleted_count": 5
  }
}
  • deleted_count: Actual number of deleted files

Important Notes

The deletion operation is irreversible. Once deleted, files cannot be recovered. Please ensure important data is backed up before deletion.
  1. Deletion Conditions: The deletion interface supports multiple condition combinations. Files matching any condition will be deleted
  2. Permission Control: Only files belonging to the specified workspace can be deleted
  3. Batch Operations: Supports batch deletion, allowing multiple files to be deleted at once
  4. Time Format: Time parameters use epoch timestamp (in seconds)
  5. Deletion Scope: The deletion operation will simultaneously delete files and their related processing results, review records, and other data
I