Documentation Index
Fetch the complete documentation index at: https://docs-docflow.textin.com/llms.txt
Use this file to discover all available pages before exploring further.
Core Concepts
Before using the file category APIs, understanding the following core concepts will help you better comprehend how the system works:Sample Files
Sample files are typical example documents of the file category. DocFlow uses these samples to:- Train classification models: Help the system identify and distinguish different types of documents
- Optimize extraction performance: Improve field extraction accuracy by learning format and layout patterns from samples
- Establish recognition templates: Provide reference benchmarks for automatically recognizing similar documents
Regular Fields
Regular fields refer to key information that exists in the document in non-table format. Each field contains a field name (key) and corresponding value. Fields may span across pages or rows. Extraction Result Location: Field information is located atresult.files[].data.fields[] in the extraction result, with each field containing:
key: Field name (e.g., “Invoice Code”, “Issue Date”)value: Field value (extracted text content)position[]: Position coordinate information in the document
- Invoice category: Invoice code, invoice number, issue date, buyer name, total amount
- Contract category: Contract number, party A name, party B name, signing date, contract amount
- ID card category: Name, gender, ethnicity, date of birth, ID number
- Explicitly tell the system which information to extract from documents
- Guide AI models for precise extraction through field descriptions and prompts
- Define data formats and validation rules for fields
Table Fields
Table fields refer to structured data in table format. DocFlow can recognize table structures in documents and convert table content into structured data format. Tables consist of multiple rows and columns, and each table can be configured with multiple fields (columns). Extraction Result Location: Table information is located atresult.files[].data.items[][] in the extraction result, using a two-dimensional array structure:
- Outer array: Represents table rows
- Inner array: Represents cells within a row
- Each cell contains
key(column name),value(cell value), andposition(position coordinates)
- Invoice category: Item details table (goods/services name, specification, unit, quantity, unit price, amount)
- Reimbursement form: Expense details table (expense item, date, amount, remarks)
- Order category: Order details table (product name, quantity, unit price, subtotal)
- Regular fields: Non-table key-value pairs, returned in
result.files[].data.fields[], typically single information points in the document - Table fields: Structured table data, returned in
result.files[].data.items[][], supporting extraction of multiple rows at once - Use cases: Regular fields are suitable for fixed information in document headers and footers; table fields are suitable for detail lists with repetitive structured information
Getting Started
This guide introduces how to use file category-related APIs: create, list, update, and delete.Create File Category
Create a new file category by uploading at least one sample file and configuring at least one field:workspace_id(required): Workspace IDname(required): File category name, max length 50category_prompt(optional): Prompt for classification, max length 500extract_model(required): Extraction model, options:llm,vlmsample_files(required): Sample file list, at least one sample file required; maximum 10 sample files per categoryfields(required): Field configuration list (JSON string), at least one field required, table fields can only be configured in the default table (table_id=-1)
List File Categories
Get all file categories in a workspace:workspace_id(required): Workspace IDpage(optional): Page number, default is 1page_size(optional): Items per page, default is 1000enabled(optional): Status filter, options:all(All),1(Enabled),0(Disabled),2(Draft), default is1
Update File Category
Update information for a specified file category:workspace_id(required): Workspace IDcategory_id(required): File category IDname(optional): File category name, max length 50category_prompt(optional): Prompt for classification, max length 500enabled(optional): Status, 0: Disabled, 1: Enabled, 2: Draft
Delete File Category
Delete specified file category(s) (supports batch deletion):workspace_id(required): Workspace IDcategory_ids(required): Array of file category IDs to delete
Next Steps
- Learn Fields Management - Manage fields under file categories
- Learn Tables Management - Manage tables under file categories
- Learn Samples Management - Manage sample files for file categories

