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

# 更新文件类别

> 更新指定文件类别的信息。

注意：设置 extract_model 时将级联覆盖该分类下所有字段和表格的抽取模型。




## OpenAPI

````yaml /docflow/cn/rest-api/openapi.bundle.yaml post /api/app-api/sip/platform/v2/category/update
openapi: 3.0.0
info:
  title: DocFlow API
  description: DocFlow REST API，提供文件上传和获取文件处理结果能力
  version: 2.8.4
servers:
  - url: https://docflow.textin.com
security:
  - ApiId: []
    SecretCode: []
paths:
  /api/app-api/sip/platform/v2/category/update:
    post:
      tags:
        - 文件类别
      summary: 更新文件类别
      description: |
        更新指定文件类别的信息。

        注意：设置 extract_model 时将级联覆盖该分类下所有字段和表格的抽取模型。
      operationId: updateCategory
      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'
                name:
                  type: string
                  description: 文件类别名称
                  example: 发票
                  maxLength: 50
                category_prompt:
                  type: string
                  description: 用于分类的提示词
                  example: 增值税发票，包含发票代码、发票号码等字段
                  maxLength: 150
                enabled:
                  $ref: '#/components/schemas/EnabledStatus'
                extract_model:
                  type: string
                  description: |
                    抽取模型，设置后级联覆盖所有字段和表格
                    - Auto: 智能匹配抽取模型
                    - Acgpt: 速度快，抽取结果稳定
                    - Acgpt-VL: 多模态，适用简单抽取（≤10 页）
                    - DF-M1: 适用复杂文档理解
                  example: Acgpt
                  enum:
                    - Auto
                    - Acgpt
                    - Acgpt-VL
                    - DF-M1
                with_detail:
                  type: boolean
                  description: |
                    是否返回完整详情。传 true 时响应返回分类自身信息（不含子层级字段/表格）。
                    不传或为 false 时仅返回 code/msg。
              required:
                - workspace_id
                - category_id
      responses:
        '200':
          description: 成功更新文件类别
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CodeMessage'
                  - type: object
                    properties:
                      result:
                        description: with_detail=true 时返回分类自身信息，否则为 null
                        type: object
                        properties:
                          id:
                            type: string
                            description: 分类ID
                          name:
                            type: string
                            description: 分类名称
                          description:
                            type: string
                            description: 分类描述
                          category_prompt:
                            type: string
                            description: 分类提示词
                          extract_model:
                            type: string
                            description: 抽取模型
                          enabled:
                            type: integer
                            description: 启用状态
components:
  schemas:
    EnabledStatus:
      type: integer
      description: |
        启用状态
        - 0: 禁用
        - 1: 启用
        - 2: 草稿
      enum:
        - 0
        - 1
        - 2
    CodeMessage:
      type: object
      properties:
        code:
          type: integer
          description: 状态码
          example: 200
        msg:
          type: string
          description: 状态描述
      required:
        - code
        - msg
  securitySchemes:
    ApiId:
      type: apiKey
      in: header
      name: x-ti-app-id
    SecretCode:
      type: apiKey
      in: header
      name: x-ti-secret-code

````