> ## 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.

# ファイルカテゴリのテーブルを追加

> 指定したファイルカテゴリ配下に複数のテーブルを追加します（ネストされたフィールドに対応）。全件成功または全件失敗のセマンティクスを採用しています。



## OpenAPI

````yaml /docflow-global/ja/rest-api/openapi.bundle.yaml post /api/app-api/sip/platform/v2/category/tables/batch_add
openapi: 3.0.0
info:
  title: DocFlow API
  description: DocFlow REST API。ファイルアップロードとファイル処理結果の取得機能を提供します。
  version: 2.8.4
  contact:
    name: TextIn
    url: https://www.textin.ai/contact?type=27&sub_type=1
servers:
  - url: https://docflow.textin.ai
security:
  - ApiId: []
    SecretCode: []
tags:
  - name: ワークスペース管理
    description: ワークスペース関連 API
  - name: ファイルカテゴリ
    description: ファイルカテゴリ関連 API
  - name: ファイルカテゴリサンプル
    description: ファイルカテゴリサンプル関連 API
  - name: スマートレビュー
    description: スマートレビュー関連 API
  - name: 廃止済み
    description: 廃止済み API
paths:
  /api/app-api/sip/platform/v2/category/tables/batch_add:
    post:
      tags:
        - ファイルカテゴリ
      summary: ファイルカテゴリのテーブルを追加
      description: >-
        指定したファイルカテゴリ配下に複数のテーブルを追加します（ネストされたフィールドに対応）。全件成功または全件失敗のセマンティクスを採用しています。
      operationId: batchAddCategoryTables
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                  description: ワークスペース ID
                  example: '1234567890'
                category_id:
                  type: string
                  description: ファイルカテゴリ ID
                  example: '1234567890'
                tables:
                  type: array
                  description: 追加するテーブルのリスト
                  items:
                    $ref: '#/components/schemas/CategoryTableConfig'
                  minItems: 1
                with_detail:
                  type: boolean
                  description: 各テーブルの完全な詳細（フィールドリストを含む）を返すかどうか
              required:
                - workspace_id
                - category_id
                - tables
      responses:
        '200':
          description: テーブルの追加に成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CodeMessage'
                  - type: object
                    properties:
                      result:
                        type: array
                        description: 作成結果リスト。リクエストと同じ順序です
                        items:
                          type: object
                          properties:
                            table_id:
                              type: string
                              description: テーブル ID
                            name:
                              type: string
                              description: テーブル名（with_detail=true の場合に返却）
                            description:
                              type: string
                            prompt:
                              type: string
                            collect_from_multi_table:
                              type: boolean
                            extract_model:
                              type: string
                            fields:
                              type: array
                              description: テーブルフィールドリスト（with_detail=true の場合に返却）
                              items:
                                $ref: '#/components/schemas/CategoryField'
                          required:
                            - table_id
components:
  schemas:
    CategoryTableConfig:
      type: object
      description: 一括作成用のテーブル設定（ネストされたフィールドを含む）
      properties:
        name:
          type: string
          description: テーブル名
          example: 明細テーブル
          maxLength: 50
        prompt:
          type: string
          description: テーブルの意味抽出プロンプト
          maxLength: 200
        collect_from_multi_table:
          type: boolean
          description: 複数テーブルを結合
        extract_model:
          type: string
          description: テーブルレベルの抽出モデル
          enum:
            - Auto
            - Acgpt
            - Acgpt-VL
            - DF-M1
        fields:
          type: array
          description: テーブル内のネストされたフィールドリスト
          items:
            $ref: '#/components/schemas/CategoryFieldConfig'
      required:
        - name
    CodeMessage:
      type: object
      properties:
        code:
          type: integer
          description: ステータスコード
          example: 200
        msg:
          type: string
          description: ステータス説明
      required:
        - code
        - msg
    CategoryField:
      allOf:
        - $ref: '#/components/schemas/CategoryFieldConfig'
        - type: object
          properties:
            id:
              type: string
              description: フィールド ID
              example: '1234567890'
            enabled:
              $ref: '#/components/schemas/EnabledStatus'
            extract_model:
              type: string
              description: >
                フィールド抽出モデル

                - Auto: 抽出モデルを自動でマッチング

                - Acgpt: 高速で安定した抽出結果

                - Acgpt-VL: VLM。シンプルな抽出に適しています（≤10 ページ）

                - DF-M1: 複雑な文書理解に適しています

                -
                テーブルフィールドではテーブルモデルを継承し、通常フィールドではフィールド単位の設定を使用します。既存データはカテゴリ設定から推定されます
              example: Acgpt
    CategoryFieldConfig:
      type: object
      properties:
        name:
          type: string
          description: フィールド名
          example: インボイスコード
        description:
          type: string
          description: フィールドの説明
          example: インボイスコードの説明
        prompt:
          type: string
          description: 意味抽出プロンプト
        use_prompt:
          type: boolean
          description: 意味抽出プロンプトを使用するかどうか
        alias:
          type: array
          description: 'フィールド別名。更新時: 省略=変更なし、空配列 []=別名をクリア、空でない配列=上書き'
          items:
            type: string
          example:
            - インボイス No.
            - 請求書番号
        identity:
          type: string
          description: 'エクスポート時のフィールド名。更新時: 省略=変更なし、空文字列 ""=クリア、空でない値=上書き'
          example: invoice_number
        multi_value:
          type: boolean
          description: 複数値抽出を有効にするかどうか
        duplicate_value_distinct:
          type: boolean
          description: multi_value が true の場合のみ有効な重複値除去を行うかどうか
        transform_settings:
          $ref: '#/components/schemas/TransformSettings'
    EnabledStatus:
      type: integer
      description: |
        有効化ステータス
        - 0: 無効
        - 1: 有効
        - 2: 下書き
      enum:
        - 0
        - 1
        - 2
    TransformSettings:
      type: object
      description: フィールド出力変換設定。抽出結果を出力前に整形します。
      properties:
        type:
          type: string
          description: |
            変換タイプ。適用する変換ルールを決定します:
            - `datetime`: 抽出結果を指定した日付形式に正規化します
            - `enumerate`: 抽出結果を事前設定された列挙値のいずれかに制限します
            - `regex`: 正規表現で抽出結果をマッチングして置換します
          enum:
            - datetime
            - enumerate
            - regex
        datetime_settings:
          type: object
          description: 日時フォーマット設定。type=datetime の場合は必須です。
          properties:
            format:
              type: string
              description: 対象の日付形式。抽出結果はこの形式に正規化されます。
              example: yyyy-MM-dd
        enumerate_settings:
          type: object
          description: 列挙制約設定。type=enumerate の場合は必須です。
          properties:
            items:
              type: array
              description: 許可される列挙値。抽出結果がこのリストに含まれない場合は mismatch_action が適用されます。
              items:
                type: string
              example:
                - VAT 専用インボイス
                - VAT 一般インボイス
                - 電子インボイス
        regex_settings:
          type: object
          description: 正規表現変換設定。type=regex の場合は必須です。
          properties:
            match:
              type: string
              description: 抽出結果をマッチングまたはキャプチャする正規表現パターン
              example: ^(\d{4})-(\d{2})-(\d{2})$
            replace:
              type: string
              description: 置換式。$1、$2 などのキャプチャグループ参照をサポートします
              example: $1/$2/$3
        mismatch_action:
          type: object
          description: 変換ルールに一致しない抽出結果の処理方法（すべてのタイプに適用、任意）。
          properties:
            mode:
              type: string
              description: |
                処理モード:
                - `default`: 指定したデフォルト値を出力します（default_value が必要）
                - `warning`: 元の抽出結果を保持し、手動レビュー用の警告を付けます
              enum:
                - default
                - warning
            default_value:
              type: string
              description: 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

````