Skip to main content
Fields are the core configuration for defining extraction content in file categories. DocFlow supports two types of fields: regular fields (in result.fields) and table fields (in result.tables[].fields). This guide introduces how to manage these fields via API.

List Fields

Get all fields under a specified file category, including both regular fields and table fields:
Request Parameters:
  • workspace_id (required): Workspace ID
  • category_id (required): File category ID
Response Example:

Add Field

Add field(s) under a specified file category, supporting both regular fields and table fields:

Add Regular Field

Add Table Field

To add field(s) under a table, pass the table_id parameter:
Request Parameters:
  • workspace_id (required): Workspace ID
  • category_id (required): File category ID
  • table_id (optional): Table ID. Not provided or empty: create regular field; Provided: create table field
  • fields (required): Array of field objects, each containing:
    • name (required): Field name
    • description (optional): Field description
    • prompt (optional): Semantic extraction prompt
    • use_prompt (optional): Whether to use semantic prompt
    • alias (optional): Array of field aliases
    • identity (optional): Export field name
    • multi_value (optional): Whether to extract multiple values
    • duplicate_value_distinct (optional): Whether to deduplicate values (only effective when multi_value is true)
    • transform_settings (optional): Transformation configuration
Response Example:

Update Field

Update information for specified field(s), supporting both regular fields and table fields:
Request Parameters:
  • workspace_id (required): Workspace ID
  • category_id (required): File category ID
  • table_id (optional): Table ID. Can be omitted for regular fields; required for table fields to specify which table they belong to
  • fields (required): Array of field objects, each containing:
    • field_id (required): Field ID
    • Other parameters same as field creation
When updating table fields, pass the table_id parameter to specify which table the fields belong to.

Delete Field

Delete specified field(s), supporting batch deletion of both regular fields and table fields:

Delete Regular Fields

Delete Table Fields

To delete table fields, pass the table_id parameter:
Request Parameters:
  • workspace_id (required): Workspace ID
  • category_id (required): File category ID
  • field_ids (required): Array of field IDs to delete
  • table_id (optional): Table ID. Not provided: delete regular fields; Provided: delete table fields
Field deletion is irreversible. Please proceed with caution.

Field Configuration

Field Types

  • Regular Field: Key-value fields stored in result.fields
  • Table Field: Table column fields stored in result.tables[].fields

Field Properties

  • name: Field name, required
  • description: Field description, optional
  • prompt: Semantic extraction prompt to guide AI in field extraction
  • use_prompt: Whether to use semantic prompt
  • alias: Array of field aliases for field recognition
  • identity: Export field name used as field identifier during result export
  • multi_value: Whether to extract multiple values, supports extracting multiple values for a single field
  • duplicate_value_distinct: Deduplicate values, only effective when multi_value is true
  • transform_settings: Transformation configuration, supports datetime, enum, regex, and other transformations

Transform Configuration Example

Next Steps