> ## Documentation Index
> Fetch the complete documentation index at: https://adp-doc.laiye.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 修改抽取应用

> 更新抽取应用的名称、标签、字段配置和抽取配置，并创建新的配置版本。修改高速版自定义抽取应用时，复用该接口并传入高速版应用的 app_id；请求体不需要传 ai_function。高速版自定义抽取应用不支持设置 parse_mode、enable_highlight、enable_pdf_parse、pdf_pic_second_parsing、enable_stamp_recognition 和 enable_long_doc。



## OpenAPI

````yaml /api-reference/adp-api.yaml post /open/agentic_doc_processor/{tenant_name}/v1/app-manage/update
openapi: 3.1.0
info:
  title: ADP API
  version: 1.0.0
  description: Laiye ADP 官方 OpenAPI 接口规范，覆盖文档抽取、文档解析、抽取应用管理、积分查询、工作流运行和工作流文件管理。
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://adp.laiye.com
    description: ADP 生产环境
security: []
tags:
  - name: 文档抽取
    description: 从上传的文档中抽取结构化字段。
  - name: 文档解析
    description: 识别上传文档中的文字、版面块和位置信息。
  - name: 应用管理
    description: 创建、修改、删除和查询抽取应用及配置。
  - name: 账户
    description: 查询账户积分和使用情况。
  - name: 工作流
    description: 运行工作流应用并查询执行结果。
  - name: 工作流文件
    description: 上传和管理工作流应用使用的文件。
paths:
  /open/agentic_doc_processor/{tenant_name}/v1/app-manage/update:
    post:
      tags:
        - 应用管理
      summary: 修改抽取应用
      description: >-
        更新抽取应用的名称、标签、字段配置和抽取配置，并创建新的配置版本。修改高速版自定义抽取应用时，复用该接口并传入高速版应用的
        app_id；请求体不需要传 ai_function。高速版自定义抽取应用不支持设置
        parse_mode、enable_highlight、enable_pdf_parse、pdf_pic_second_parsing、enable_stamp_recognition
        和 enable_long_doc。
      operationId: updateExtractionApp
      parameters:
        - $ref: '#/components/parameters/TenantName'
      requestBody:
        $ref: '#/components/requestBodies/ExtractionAppUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/ExtractionAppUpdateResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    TenantName:
      name: tenant_name
      in: path
      required: true
      description: 租户名称，默认 laiye。
      schema:
        type: string
        default: laiye
  requestBodies:
    ExtractionAppUpdateRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExtractionAppUpdateRequest'
          examples:
            standardCustomExtractionApp:
              summary: 修改标准版自定义抽取应用
              value:
                app_id: app_1406
                app_name: 采购单抽取应用（新版）
                config_version: v1
                app_label:
                  - purchase-order
                extract_fields:
                  - field_name: 订单号
                    field_type: string
                    field_prompt: 抽取采购订单编号。
                  - field_name: 供应商名称
                    field_type: string
                    field_prompt: 抽取供应商名称。
                parse_mode: fast_vlm
                enable_highlight: 1
                enable_pdf_parse: true
                pdf_pic_second_parsing: false
                enable_stamp_recognition: true
                enable_long_doc: false
            highSpeedCustomExtractionApp:
              summary: 修改高速版自定义抽取应用
              value:
                app_id: app_1425
                app_name: 高速版发票抽取应用（新版）
                config_version: v1
                app_label:
                  - invoice
                  - high-speed
                extract_fields:
                  - field_key: invoice_no
                    field_name: 发票号码
                    field_type: string
                    field_prompt: 抽取发票上的唯一发票号码。
                  - field_key: invoice_date
                    field_name: 开票日期
                    field_type: date
                    field_prompt: 抽取发票开具日期。
                  - field_key: total_amount
                    field_name: 价税合计
                    field_type: string
                    field_prompt: 抽取发票价税合计金额。
                  - field_key: line_items
                    field_name: 明细
                    field_type: table
                    sub_fields:
                      - field_key: item_name
                        field_name: 商品名称
                        field_type: string
                      - field_key: item_amount
                        field_name: 金额
                        field_type: string
                enable_field_value_translation: false
  responses:
    ExtractionAppUpdateResponse:
      description: 抽取应用修改结果。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExtractionAppUpdateResponse'
          example:
            code: success
            message: ''
            tips: null
            data:
              app_id: app_1425
              config_version: v2
    ValidationError:
      description: 参数校验错误。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleResponse'
  schemas:
    ExtractionAppUpdateRequest:
      oneOf:
        - $ref: '#/components/schemas/StandardExtractionAppUpdateRequest'
        - $ref: '#/components/schemas/HighSpeedExtractionAppUpdateRequest'
    ExtractionAppUpdateResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                app_id:
                  type: string
                  description: 应用 ID。
                config_version:
                  type: string
                  description: 新配置版本号。
    SimpleResponse:
      type: object
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
          description: 业务码。成功通常为 success 或 200。
        message:
          type: string
          description: 返回信息。
        tips:
          type:
            - string
            - 'null'
          description: 详细信息，默认为空。
    StandardExtractionAppUpdateRequest:
      type: object
      additionalProperties: false
      title: 修改标准版自定义抽取应用
      properties:
        app_id:
          type: string
          description: 应用 ID。
        app_name:
          type: string
          description: 应用名称。不传或传空字符串时不更新应用名称。
        config_version:
          type: string
          description: 当前配置版本。修改后会另存为新版本。
        app_label:
          type: array
          maxItems: 5
          description: 应用标签列表，最多 5 个。
          items:
            type: string
        extract_fields:
          type: array
          maxItems: 20
          description: 抽取字段配置列表，最多 20 个字段。
          items:
            $ref: '#/components/schemas/ExtractionFieldConfig'
        parse_mode:
          type: string
          enum:
            - standard
            - advance
            - fast_vlm
            - agentic
          description: |
            解析模式。标准版自定义抽取应用必填；高速版自定义抽取应用不支持设置该参数。模式能力与 Web 端解析配置一致：

            - standard：标准解析，适用于清晰的电子版文档，支持显示来源位置、PDF 文本优先和印章识别。
            - advance：增强解析 1.0，适用于印章、签名、多表格等格式较复杂的文档；不支持显示来源位置。
            - fast_vlm：增强解析 2.0，适用于复杂版式、扫描件、多表格等文档，支持显示来源位置、PDF 文本优先和印章识别。
            - agentic：智能解析，自动组合多种模型处理复杂文档，支持显示来源位置、PDF 文本优先和印章识别。
        enable_highlight:
          type: integer
          enum:
            - 0
            - 1
          default: 1
          description: 是否显示来源位置。传 1 开启，传 0 关闭；standard、fast_vlm、agentic 支持，advance 不支持。
        enable_pdf_parse:
          type: boolean
          default: false
          description: 是否开启 PDF 文本优先。适合可复制文字的电子 PDF，可提升处理速度和文字稳定性。
        pdf_pic_second_parsing:
          type: boolean
          default: false
          description: 开启 PDF 文本优先时，是否对 PDF 中的图片进行二次解析。
        enable_stamp_recognition:
          type: boolean
          default: false
          description: 是否开启印章识别。开启后会尝试识别文档中的印章信息，需要印章识别能力授权。
        enable_field_value_translation:
          type: boolean
          default: false
          description: 是否开启抽取结果翻译，默认关闭。
        enable_long_doc:
          type: boolean
          default: false
          description: 是否开启长文档支持。标准版自定义抽取应用支持该参数；高速版自定义抽取应用不支持该参数的设置。
        long_doc_config:
          type: array
          maxItems: 5
          description: 长文档配置，仅 enable_long_doc 为 true 时使用。
          items:
            $ref: '#/components/schemas/LongDocConfig'
      required:
        - app_id
        - config_version
        - extract_fields
        - parse_mode
    HighSpeedExtractionAppUpdateRequest:
      type: object
      additionalProperties: false
      title: 修改高速版抽取应用
      properties:
        app_id:
          type: string
          description: 高速版自定义抽取应用 ID。
        app_name:
          type: string
          description: 应用名称。不传或传空字符串时不更新应用名称。
        config_version:
          type: string
          description: 当前配置版本。修改后会另存为新版本。
        app_label:
          type: array
          maxItems: 5
          description: 应用标签列表，最多 5 个。
          items:
            type: string
        extract_fields:
          type: array
          minItems: 1
          maxItems: 20
          description: 高速版抽取字段配置列表，最多 20 个字段。每个字段都需要提供 field_key。
          items:
            $ref: '#/components/schemas/HighSpeedExtractionFieldConfig'
        enable_field_value_translation:
          type: boolean
          default: false
          description: 是否开启抽取结果翻译，默认关闭。
      required:
        - app_id
        - config_version
        - extract_fields
    ExtractionFieldConfig:
      type: object
      additionalProperties: false
      properties:
        field_key:
          type: string
          pattern: ^[A-Za-z][A-Za-z0-9_]{0,63}$
          description: 字段唯一标识。创建高速版自定义抽取应用时必填；标准版不要求传入。
        field_name:
          type: string
          minLength: 1
          maxLength: 50
          description: 字段名称。
        field_type:
          type: string
          enum:
            - string
            - date
            - table
          description: 字段类型。表格字段使用 table。
        field_prompt:
          type: string
          description: 字段抽取提示词。
        sub_fields:
          type: array
          description: 表格子字段。field_type 为 table 时必须至少提供 1 个有效子字段。
          items:
            $ref: '#/components/schemas/ExtractionSubFieldConfig'
      required:
        - field_name
        - field_type
    LongDocConfig:
      type: object
      additionalProperties: false
      properties:
        doc_type:
          type: string
          description: 文档类型。
        doc_desc:
          type: string
          description: 文档类型描述。
      required:
        - doc_type
    HighSpeedExtractionFieldConfig:
      type: object
      additionalProperties: false
      title: 高速版字段
      description: >-
        高速版字段配置。普通字段的 field_type 为 string 或 date，不要传 sub_fields；表格字段的 field_type
        为 table，必须传 sub_fields。
      properties:
        field_key:
          type: string
          pattern: ^[A-Za-z][A-Za-z0-9_]{0,63}$
          description: 字段唯一标识。必须以英文字母开头，只能包含英文字母、数字和下划线，最多 64 个字符。
        field_name:
          type: string
          minLength: 1
          maxLength: 50
          description: 字段名称。
        field_type:
          type: string
          enum:
            - string
            - date
            - table
          description: 字段类型。普通字段使用 string 或 date；表格字段使用 table。
        field_prompt:
          type: string
          maxLength: 200
          description: 字段抽取提示词。
        sub_fields:
          type: array
          maxItems: 50
          description: 表格子字段。仅 field_type 为 table 时填写，且必须至少提供 1 个有效子字段；普通字段不要传该参数。
          items:
            $ref: '#/components/schemas/HighSpeedExtractionSubFieldConfig'
          examples:
            - - field_key: item_name
                field_name: 商品名称
                field_type: string
      required:
        - field_key
        - field_name
        - field_type
      allOf:
        - if:
            properties:
              field_type:
                const: table
            required:
              - field_type
          then:
            required:
              - sub_fields
            properties:
              sub_fields:
                minItems: 1
    ExtractionSubFieldConfig:
      type: object
      additionalProperties: false
      properties:
        field_key:
          type: string
          pattern: ^[A-Za-z][A-Za-z0-9_]{0,63}$
          description: 子字段唯一标识。创建高速版自定义抽取应用时必填；标准版不要求传入。
        field_name:
          type: string
          minLength: 1
          maxLength: 50
          description: 子字段名称。
        field_type:
          type: string
          enum:
            - string
            - date
          description: 子字段类型。表格内不允许再嵌套表格。
        field_prompt:
          type: string
          description: 子字段抽取提示词。
      required:
        - field_name
        - field_type
    HighSpeedExtractionSubFieldConfig:
      type: object
      additionalProperties: false
      properties:
        field_key:
          type: string
          pattern: ^[A-Za-z][A-Za-z0-9_]{0,63}$
          description: 子字段唯一标识。必须以英文字母开头，只能包含英文字母、数字和下划线，最多 64 个字符。
        field_name:
          type: string
          minLength: 1
          maxLength: 50
          description: 子字段名称。
        field_type:
          type: string
          enum:
            - string
            - date
          description: 子字段类型。表格内不允许再嵌套表格。
        field_prompt:
          type: string
          maxLength: 200
          description: 子字段抽取提示词。
      required:
        - field_key
        - field_name
        - field_type
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        生产环境的用户 OpenAPI Accessor access_key，在 ADP 平台的「我的 API」中查看。key
        被禁用、过期或不属于生产环境时会返回 Accessor not found。

````