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

# 更新协同结果

> 提交待处理协同任务的人工修正并完成审核。

只在 `task_state=2` 时提交，`file_task_id` 使用协同任务的 `id`。普通字段、表格结构和提交后的核对步骤见[人机协同](/api-reference/collaboration)。


## OpenAPI

````yaml api-reference/adp-api.yaml POST /open/agentic_doc_processor/{tenant_name}/v1/collaboration/result/update
openapi: 3.1.0
info:
  title: ADP API
  version: 1.0.0
  description: >-
    Laiye ADP 官方 OpenAPI
    接口规范，覆盖文档抽取、解析与转换，抽取应用管理、Webhook、人机协同、积分查询，以及工作流发现、运行、导出和文件管理。
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://adp.laiye.com
    description: ADP 生产环境
security: []
tags:
  - name: 文档抽取
    description: 从上传的文档中抽取结构化字段。
  - name: 文档解析
    description: 识别上传文档中的文字、版面块和位置信息。
  - name: 文档转换
    description: 将 PDF、Office、OFD 和图片转换为页面图片或电子表格结构。
  - name: 应用管理
    description: 创建、修改、删除和查询抽取应用及配置。
  - name: Webhook
    description: 查询事件目录并管理事件回调。
  - name: 账户
    description: 查询账户积分和使用情况。
  - name: 工作流
    description: 查询业务工作流模板、运行工作流应用并查询执行结果。
  - name: 工作流文件
    description: 上传和管理工作流应用使用的文件。
  - name: 人机协同
    description: 配置审核触发规则，查询协同任务并提交人工修正。
paths:
  /open/agentic_doc_processor/{tenant_name}/v1/collaboration/result/update:
    post:
      tags:
        - 人机协同
      summary: 修改人机协同结果
      description: >-
        仅为 task_state=2 的协同任务提交已有字段的确认或修正。成功实际返回
        file_status=4；请再查询任务确认状态和值，并在异步抽取查询结果的 output_result 中读取最终修正值。


        提交前校验字段名、类型和值；未知字段可能被忽略却完成任务，遗漏值可能清空原值，缩短多值列表可能残留旧值。普通字段只传
        field_values，表格只传 table_values。表格会整块替换，请复制要保留的 field_key/references
        等信息。失败响应也可能已保存数据，请先回查，勿盲目重试。


        HTTP 200 不保证业务成功，请检查 code。


        接入步骤与当前限制见[人机协同](/api-reference/collaboration)。
      operationId: updateCollaborationResult
      parameters:
        - $ref: '#/components/parameters/TenantName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CollaborationResultRequest'
            example:
              file_task_id: collaboration_task_id
              collaboration_result:
                - field_name: 发票号码
                  field_type: string
                  field_values:
                    - CORRECTED-002
                - field_name: 明细
                  field_type: table
                  table_values:
                    - - field_name: 名称
                        field_values:
                          - field_value: Corrected item
                            references: []
                        field_key: 名称
                      - field_name: 数量
                        field_values:
                          - field_value: '3'
                            references: []
                        field_key: 数量
      responses:
        '200':
          description: 业务响应。请检查 code，并在写入后回查业务结果。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollaborationResultResponse'
              example:
                code: success
                message: ''
                tips: null
                data:
                  file_status: 4
        '401':
          description: 缺少 API Key。
        '404':
          description: API Key 无效或请求不可访问。
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    TenantName:
      name: tenant_name
      in: path
      required: true
      description: 租户名称，默认 laiye。
      schema:
        type: string
        default: laiye
  schemas:
    CollaborationResultRequest:
      type: object
      properties:
        file_task_id:
          type: string
          description: >-
            协同任务主键 ID，即异步抽取响应 data.metadata.collaboration_task_id 或任务详情
            data.id；不是展示编号 task_number、异步抽取 task_id 或 data_id。
        collaboration_result:
          type: array
          items:
            $ref: '#/components/schemas/CollaborationResultField'
          description: 本次确认或修正的已有字段。仅对 task_state=2 的任务提交有效字段和明确的值；提交后任务会完成。
      required:
        - file_task_id
        - collaboration_result
    CollaborationResultResponse:
      type: object
      properties:
        code:
          type: string
          description: >-
            业务结果码。成功为 success；失败可能为 server_error、http_server_error
            等字符串，必须检查，不能只看 HTTP 200。
        message:
          type: string
        tips:
          type:
            - string
            - 'null'
        data:
          anyOf:
            - $ref: '#/components/schemas/CollaborationResultData'
            - type: 'null'
    CollaborationResultField:
      type: object
      properties:
        field_name:
          type: string
          description: 已有抽取字段的准确名称。未知名称可能被忽略但仍完成任务，请在提交前校验。
        field_type:
          type: string
          description: 字段类型：string=文本，date=日期，table=表格。必须与原字段类型一致。
        field_values:
          type: array
          items:
            type: string
          default: []
          description: 普通字段的完整值列表。请显式提供，不要遗漏；当前缩短列表可能保留旧尾值，应回查完整结果。表格字段不要同时传此参数。
        table_values:
          anyOf:
            - type: array
              items:
                type: array
                items:
                  $ref: '#/components/schemas/CollaborationTableCell'
            - type: 'null'
          description: >-
            表格整块替换：外层是行，行内是单元格对象。提交完整目标表格，并复制需要保留的 field_key/references
            等信息。不要同时传 field_values。
      required:
        - field_name
        - field_type
    CollaborationResultData:
      type: object
      properties:
        file_status:
          type: integer
          description: 提交成功实际返回 4=已完成。完整协同状态字典见任务详情的 task_state。
          example: 4
      required:
        - file_status
    HTTPValidationError:
      type: object
      description: FastAPI/Pydantic 请求参数校验错误。
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      required:
        - detail
    CollaborationTableCell:
      type: object
      properties:
        field_name:
          type: string
          description: 已发布的表格列名称。
        field_key:
          type: string
          description: 原单元格的字段 key。需要保留时，从任务详情完整复制。
        field_values:
          type: array
          items:
            type: object
            properties:
              field_value:
                type: string
                description: 修正后的单元格文本。
              references:
                type: array
                items:
                  type: object
                  additionalProperties: true
                description: 原字段值的文档定位信息，需要保留时从查询结果完整复制。
            required:
              - field_value
            additionalProperties: true
          description: 注意：单元格值是对象数组，与普通字段的字符串数组不同。
        references:
          type: array
          items:
            type: object
            additionalProperties: true
          description: 原单元格来源位置。需要保留回标时，从任务详情完整复制。
      required:
        - field_name
        - field_values
      additionalProperties: true
    ValidationErrorItem:
      type: object
      additionalProperties: true
      properties:
        type:
          type: string
          description: 校验错误类型。
        loc:
          type: array
          description: 错误字段在请求中的位置。
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
          description: 可读的错误说明。
        input:
          description: 导致校验失败的输入值。
        ctx:
          type: object
          additionalProperties: true
          description: 校验器提供的补充上下文。
        url:
          type: string
          format: uri
          description: Pydantic 错误说明链接。
      required:
        - type
        - loc
        - msg
  responses:
    ValidationError:
      description: 参数校验错误。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HTTPValidationError'
          example:
            detail:
              - type: greater_than
                loc:
                  - query
                  - limit
                msg: Input should be greater than 0
                input: 0
                ctx:
                  gt: 0
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: 生产环境 API Key，可在 ADP 平台的「我的 API」中查看。请确保 API Key 有效且属于生产环境。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.