When you already know the document category, you can specify the file category through the category parameter during file upload, so DocFlow will skip the automatic classification process and go directly to the extraction stage.
The specified category must be a file category that has been configured in the DocFlow workspace, otherwise processing will fail.
Manual classification can save processing time and is particularly suitable for batch processing scenarios with the same type of documents.

Use Cases

  1. Batch processing of same type documents: Such as batch processing invoices, contracts, etc.
  2. Known document types: Document category is determined before uploading files
  3. Improve processing efficiency: Skip classification step and go directly to extraction stage

Specify Category During Upload

Add the category parameter to the file upload interface to achieve manual classification:
curl -X POST \
  -H "x-ti-app-id: <your-app-id>" \
  -H "x-ti-secret-code: <your-secret-code>" \
  -F "file=@/path/to/invoice.pdf" \
  "https://docflow.textin.com/api/app-api/sip/platform/v2/file/upload?workspace_id=<your-workspace-id>&category=invoice"

Specify Category for Batch Upload

For batch upload, you can specify the same category for all files:
curl -X POST \
  -H "x-ti-app-id: <your-app-id>" \
  -H "x-ti-secret-code: <your-secret-code>" \
  -F "file=@/path/to/invoice1.pdf" \
  -F "file=@/path/to/invoice2.pdf" \
  -F "file=@/path/to/invoice3.pdf" \
  "https://docflow.textin.com/api/app-api/sip/platform/v2/file/upload?workspace_id=<your-workspace-id>&category=invoice&batch_number=INV-2024-001"

Processing Workflow Comparison

Automatic Classification Workflow

Upload → Parse → Automatic Classification → Extract → Complete

Manual Classification Workflow

Upload (specify category) → Parse → Extract → Complete

Notes

  1. Category must be configured: The specified category must have been configured in the DocFlow workspace, otherwise an error will be returned
  2. Category name matching: Category name must exactly match what was configured (case-sensitive)
  3. Processing status: Files with manual classification will skip classification status directly in query results
  4. Error handling: If the specified category does not exist, file processing will fail. It is recommended to first ensure the category is correctly configured through Configure File Categories

Query Processing Results

After files with manual classification are processed, you can query results through the file/fetch interface:
curl \
  -H "x-ti-app-id: <your-app-id>" \
  -H "x-ti-secret-code: <your-secret-code>" \
  "https://docflow.textin.com/api/app-api/sip/platform/v2/file/fetch?workspace_id=<your-workspace-id>&file_id=<your-file-id>"

Return Result Example

{
  "code": 200,
  "result": {
    "files": [
      {
        "id": "202412190001",
        "name": "invoice_sample.pdf",
        "category": "invoice",
        "recognition_status": 1,
        "extract_result": {
          // Extraction result fields
        }
      }
    ]
  }
}

Chinese File Category Parameter Passing

When you need to specify Chinese or other non-English file categories, you need to perform UTF-8 URL encoding on the category parameter.

Encoding Example

Use the urllib.parse.quote() function to URL encode Chinese category names.
# Using encoded Chinese category
curl -X POST \
  -H "x-ti-app-id: <your-app-id>" \
  -H "x-ti-secret-code: <your-secret-code>" \
  -F "file=@/path/to/invoice.pdf" \
  "https://docflow.textin.com/api/app-api/sip/platform/v2/file/upload?workspace_id=<your-workspace-id>&category=%E5%8F%91%E7%A5%A8"