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

# 単一ファイルカテゴリフィールドを追加

> 指定したファイルカテゴリ配下に新しいフィールドを追加します。通常フィールドとテーブルフィールドの両方に対応しています

> ⚠️ このエンドポイントは現在も利用できますが、今後メンテナンスされません。代わりに [ファイルカテゴリのフィールドを追加](/api-reference/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA%E3%81%AE%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%83%89%E3%82%92%E8%BF%BD%E5%8A%A0) を使用してください。




## OpenAPI

````yaml /docflow-global/ja/rest-api/openapi.bundle.yaml post /api/app-api/sip/platform/v2/category/fields/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/fields/add:
    post:
      tags:
        - 廃止済み
      summary: 単一ファイルカテゴリフィールドを追加
      description: >
        指定したファイルカテゴリ配下に新しいフィールドを追加します。通常フィールドとテーブルフィールドの両方に対応しています


        > ⚠️ このエンドポイントは現在も利用できますが、今後メンテナンスされません。代わりに
        [ファイルカテゴリのフィールドを追加](/api-reference/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA%E3%81%AE%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%83%89%E3%82%92%E8%BF%BD%E5%8A%A0)
        を使用してください。
      operationId: addCategoryField
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CategoryFieldConfig'
              type: object
              properties:
                workspace_id:
                  type: string
                  description: ワークスペース ID
                  example: '1234567890'
                category_id:
                  type: string
                  description: ファイルカテゴリ ID
                  example: '1234567890'
                table_id:
                  type: string
                  description: >
                    テーブル ID

                    - 未指定または空の場合: 通常フィールドを作成し、結果は result.fields に表示されます

                    - テーブル ID を指定した場合: 指定したテーブル配下にテーブルフィールドを作成し、結果は
                    result.tables[].fields に表示されます
                  example: '1234567890'
                extract_model:
                  type: string
                  description: >
                    任意。フィールドレベルの抽出モデル。通常フィールド（テーブルフィールド以外）のみ対応し、未指定の場合は分類レベルの設定に従います（分類レベルが
                    mixed または null の場合は Auto がデフォルト）

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

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

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

                    - DF-M1: 複雑な文書理解に適しています
                  example: Acgpt
                  enum:
                    - Auto
                    - Acgpt
                    - Acgpt-VL
                    - DF-M1
                with_detail:
                  type: boolean
                  description: |
                    完全な詳細を返すかどうか。true の場合、レスポンスにフィールドの完全な情報が含まれます。
                    未設定または false の場合、field_id のみを返します。
              required:
                - workspace_id
                - category_id
                - name
      responses:
        '200':
          description: ファイルカテゴリフィールドの追加に成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CodeMessage'
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          field_id:
                            type: string
                            description: 新規作成されたフィールド ID
                            example: '1234567890'
                          name:
                            type: string
                            description: フィールド名（with_detail=true の場合に返却）
                          description:
                            type: string
                            description: フィールドの説明（with_detail=true の場合に返却）
                          prompt:
                            type: string
                            description: 意味抽出プロンプト（with_detail=true の場合に返却）
                          use_prompt:
                            type: boolean
                            description: 意味抽出プロンプトを使用するかどうか（with_detail=true の場合に返却）
                          alias:
                            type: array
                            items:
                              type: string
                            description: フィールド別名（with_detail=true の場合に返却）
                          identity:
                            type: string
                            description: エクスポート時のフィールド名（with_detail=true の場合に返却）
                          multi_value:
                            type: boolean
                            description: 複数値抽出を有効にするかどうか（with_detail=true の場合に返却）
                          duplicate_value_distinct:
                            type: boolean
                            description: 重複値除去を有効にするかどうか（with_detail=true の場合に返却）
                          transform_settings:
                            $ref: '#/components/schemas/TransformSettings'
                          extract_model:
                            type: string
                            description: フィールド抽出モデル（with_detail=true の場合に返却）
                          enabled:
                            type: integer
                            description: 有効化ステータス（with_detail=true の場合に返却）
                        required:
                          - field_id
components:
  schemas:
    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'
    CodeMessage:
      type: object
      properties:
        code:
          type: integer
          description: ステータスコード
          example: 200
        msg:
          type: string
          description: ステータス説明
      required:
        - code
        - msg
    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

````