> ## Documentation Index
> Fetch the complete documentation index at: https://docs-docflow.textin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Single File Category Table

> Add a new table under the specified file category

> ⚠️ This endpoint is still available but will no longer be maintained. Please use [Add File Category Tables](/api-reference/file-category/add-file-category-tables) instead.




## OpenAPI

````yaml /docflow-global/en/rest-api/openapi.bundle.yaml post /api/app-api/sip/platform/v2/category/tables/add
openapi: 3.0.0
info:
  title: DocFlow API
  description: >-
    DocFlow REST API, providing file upload and file processing result retrieval
    capabilities
  version: 2.8.4
servers:
  - url: https://docflow.textin.ai
security:
  - ApiId: []
    SecretCode: []
paths:
  /api/app-api/sip/platform/v2/category/tables/add:
    post:
      tags:
        - Deprecated
      summary: Add Single File Category Table
      description: >
        Add a new table under the specified file category


        > ⚠️ This endpoint is still available but will no longer be maintained.
        Please use [Add File Category
        Tables](/api-reference/file-category/add-file-category-tables) instead.
      operationId: addCategoryTable
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                  description: Workspace ID
                  example: '1234567890'
                category_id:
                  type: string
                  description: File category ID
                  example: '1234567890'
                name:
                  type: string
                  description: Table name
                  example: Table 1
                  maxLength: 50
                prompt:
                  type: string
                  description: Table semantic extraction prompt
                  example: Extract item name, quantity and amount from each row
                  maxLength: 200
                collect_from_multi_table:
                  type: boolean
                  description: Merge multiple tables
                  example: true
                extract_model:
                  type: string
                  description: |
                    Table-level extraction model
                    - Auto: Automatically matches the extraction model
                    - Acgpt: Fast speed with stable extraction results
                    - Acgpt-VL: VLM, suitable for simple extraction (≤10 pages)
                    - DF-M1: Suitable for complex document understanding
                  example: Acgpt
                  enum:
                    - Auto
                    - Acgpt
                    - Acgpt-VL
                    - DF-M1
                with_detail:
                  type: boolean
                  description: >
                    Whether to return full details. When true, the response
                    includes complete table info (with field list).

                    When not set or false, only table_id is returned.
              required:
                - workspace_id
                - category_id
                - name
      responses:
        '200':
          description: Successfully added file category table
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CodeMessage'
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          table_id:
                            type: string
                            description: New table ID
                            example: '1234567890'
                          name:
                            type: string
                            description: Table name (returned when with_detail=true)
                          description:
                            type: string
                            description: Table description (returned when with_detail=true)
                          prompt:
                            type: string
                            description: >-
                              Table semantic extraction prompt (returned when
                              with_detail=true)
                          collect_from_multi_table:
                            type: boolean
                            description: >-
                              Merge multiple tables (returned when
                              with_detail=true)
                          extract_model:
                            type: string
                            description: >-
                              Table-level extraction model (returned when
                              with_detail=true)
                          fields:
                            type: array
                            description: Table field list (returned when with_detail=true)
                            items:
                              $ref: '#/components/schemas/CategoryField'
                        required:
                          - table_id
components:
  schemas:
    CodeMessage:
      type: object
      properties:
        code:
          type: integer
          description: Status code
          example: 200
        msg:
          type: string
          description: Status description
      required:
        - code
        - msg
    CategoryField:
      allOf:
        - $ref: '#/components/schemas/CategoryFieldConfig'
        - type: object
          properties:
            id:
              type: string
              description: Field ID
              example: '1234567890'
            enabled:
              $ref: '#/components/schemas/EnabledStatus'
            extract_model:
              type: string
              description: >
                Field extraction model

                - Auto: Automatically matches the extraction model

                - Acgpt: Fast speed with stable extraction results

                - Acgpt-VL: VLM, suitable for simple extraction (≤10 pages)

                - DF-M1: Suitable for complex document understanding

                - For table fields, inherits from the table model; for regular
                fields, uses field-level config; legacy data inferred from
                category config
              example: Acgpt
    CategoryFieldConfig:
      type: object
      properties:
        name:
          type: string
          description: Field name
          example: Invoice Code
        description:
          type: string
          description: Field description
          example: Invoice code description
        prompt:
          type: string
          description: Semantic extraction prompt
        use_prompt:
          type: boolean
          description: Whether to use semantic prompt
        alias:
          type: array
          description: >-
            Field aliases. On update: omit=no change, empty array []=clear
            aliases, non-empty array=override
          items:
            type: string
          example:
            - Invoice No.
            - Bill Number
        identity:
          type: string
          description: >-
            Export field name. On update: omit=no change, empty string ""=clear,
            non-empty=override
          example: invoice_number
        multi_value:
          type: boolean
          description: Whether to enable multi-value extraction
        duplicate_value_distinct:
          type: boolean
          description: >-
            Whether to deduplicate values, only effective when multi_value is
            true
        transform_settings:
          $ref: '#/components/schemas/TransformSettings'
    EnabledStatus:
      type: integer
      description: |
        Enabled status
        - 0: Disabled
        - 1: Enabled
        - 2: Draft
      enum:
        - 0
        - 1
        - 2
    TransformSettings:
      type: object
      description: >-
        Field output transform configuration. Formats the extraction result
        before output.
      properties:
        type:
          type: string
          description: >
            Transform type, determines which transform rule to apply:

            - `datetime`: Normalize the extraction result to a specified date
            format

            - `enumerate`: Restrict the extraction result to one of the preset
            enumeration values

            - `regex`: Match and replace the extraction result using regular
            expressions
          enum:
            - datetime
            - enumerate
            - regex
        datetime_settings:
          type: object
          description: Datetime formatting configuration. Required when type=datetime.
          properties:
            format:
              type: string
              description: >-
                Target date format. The extraction result will be normalized to
                this format.
              example: yyyy-MM-dd
        enumerate_settings:
          type: object
          description: Enumeration constraint configuration. Required when type=enumerate.
          properties:
            items:
              type: array
              description: >-
                Allowed enumeration values. If the extraction result is not in
                this list, mismatch_action applies.
              items:
                type: string
              example:
                - VAT Special Invoice
                - VAT General Invoice
                - Electronic Invoice
        regex_settings:
          type: object
          description: Regex transform configuration. Required when type=regex.
          properties:
            match:
              type: string
              description: Regex pattern for matching or capturing the extraction result
              example: ^(\d{4})-(\d{2})-(\d{2})$
            replace:
              type: string
              description: Replacement expression, supports $1, $2 capture group references
              example: $1/$2/$3
        mismatch_action:
          type: object
          description: >-
            How to handle extraction results that don't match the transform rule
            (applies to all types, optional).
          properties:
            mode:
              type: string
              description: >
                Handling mode:

                - `default`: Output the specified default value (requires
                default_value)

                - `warning`: Keep the original extraction result, flag a warning
                for manual review
              enum:
                - default
                - warning
            default_value:
              type: string
              description: Output value when mode=default
              example: N/A
  securitySchemes:
    ApiId:
      type: apiKey
      in: header
      name: x-ti-app-id
    SecretCode:
      type: apiKey
      in: header
      name: x-ti-secret-code

````