> ## 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_id` 使用异步抽取创建响应中的 `data.metadata.collaboration_task_id`。状态和结果字段说明见[人机协同](/api-reference/collaboration)。


## OpenAPI

````yaml api-reference/adp-api.yaml GET /open/agentic_doc_processor/{tenant_name}/v1/collaboration/task/{task_id}
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/task/{task_id}:
    get:
      tags:
        - 人机协同
      summary: 查询人机协同任务
      description: >-
        task_id 是协同任务主键 ID，来自异步抽取创建响应
        data.metadata.collaboration_task_id。它不是原异步抽取 task_id、展示编号 task_number
        或数据 ID。只读取本页列出的业务字段，避免记录或转发完整响应。


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


        接入步骤与当前限制见[人机协同](/api-reference/collaboration)。
      operationId: getCollaborationTask
      parameters:
        - $ref: '#/components/parameters/TenantName'
        - name: task_id
          in: path
          required: true
          description: 协同任务主键 ID。
          schema:
            type: string
      responses:
        '200':
          description: 业务响应。请检查 code，并在写入后回查业务结果。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollaborationTaskResponse'
              example:
                code: success
                message: ''
                tips: null
                data:
                  id: collaboration_task_id
                  task_number: COLLAB-001
                  app_id: app_abc123
                  task_state: 2
                  created_at: '2026-10-15T10:00:00Z'
                  updated_at: '2026-10-15T10:00:00Z'
                  extraction_result: []
                  collaboration_result: []
                  output_result: []
        '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:
    CollaborationTaskResponse:
      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/CollaborationTaskData'
            - type: 'null'
    CollaborationTaskData:
      type: object
      properties:
        id:
          type: string
          description: 协同任务主键 ID，用于查询和 file_task_id。
        task_number:
          type: string
          description: 任务展示编号，不能用于查询或修正。
        app_id:
          type: string
        app_name:
          type:
            - string
            - 'null'
        rule_id:
          type:
            - string
            - 'null'
        rule_name:
          type:
            - string
            - 'null'
        rule_logic_operator:
          type:
            - string
            - 'null'
        file_id:
          type:
            - string
            - 'null'
        file_name:
          type:
            - string
            - 'null'
        data_id:
          type:
            - string
            - 'null'
          description: 抽取数据 ID，与协同任务 ID 不同。
        data_name:
          type:
            - string
            - 'null'
        message:
          type:
            - string
            - 'null'
        task_state:
          type: integer
          description: 1=等待中，2=待处理，3=已通过（自动通过），4=已完成（人工处理完成），5=已失败，6=已取消。只在 2 时提交修正。
        task_state_name:
          type:
            - string
            - 'null'
        completed_time:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        thumbnail_file_url:
          type:
            - string
            - 'null'
        converted_file_url_result:
          type:
            - array
            - 'null'
          items:
            type: string
        extraction_result:
          description: 原始机器抽取结果，人工修正后仍保留。
          type: array
          items:
            $ref: '#/components/schemas/ExtractionField'
        collaboration_result:
          type: array
          items:
            $ref: '#/components/schemas/CollaborationReviewField'
          description: 协同审核详情，包含字段审核状态和值；不要将原机器校验结论当作人工完成状态。
        output_result:
          type: array
          items:
            $ref: '#/components/schemas/CollaborationOutputField'
          description: 合并后的最终结果。先确认 task_state=3 或 4，再消费；人工完成后应以此字段读取修正值。
      required:
        - id
        - task_number
        - app_id
        - task_state
        - created_at
        - updated_at
      description: 仅列出集成所需的业务字段。响应可能还含未列字段，请按白名单读取，不要直接记录或转发完整响应。
    HTTPValidationError:
      type: object
      description: FastAPI/Pydantic 请求参数校验错误。
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      required:
        - detail
    ExtractionField:
      type: object
      additionalProperties: true
      properties:
        field_key:
          type: string
        field_name:
          type: string
        field_values:
          type: array
          items:
            type: object
            additionalProperties: true
        references:
          type: array
          items:
            type: object
            additionalProperties: true
        table_values:
          type: array
          items:
            type: array
            items:
              type: object
              additionalProperties: true
    CollaborationReviewField:
      type: object
      additionalProperties: true
      properties:
        field_key:
          type: string
        field_name:
          type: string
        field_values:
          type: array
          items:
            anyOf:
              - type: object
                additionalProperties: true
              - type: array
                items:
                  type: object
                  additionalProperties: true
          description: 审核中的当前字段值；表格可能为二维数组。
        references:
          type: array
          items:
            type: object
            additionalProperties: true
        table_values:
          type: array
          items:
            type: array
            items:
              type: object
              additionalProperties: true
        field_verify_values:
          type: array
          items:
            anyOf:
              - type: object
                additionalProperties: true
              - type: array
                items:
                  type: object
                  additionalProperties: true
          description: 确认或修正后的字段值。
        table_verify_values:
          type: array
          items:
            type: array
            items:
              type: object
              additionalProperties: true
          description: 确认或修正后的完整表格。
        field_verify_state:
          type: integer
          description: 字段人工确认状态，1 表示已确认。任务是否完成以 task_state 为准。
        field_verify_detail:
          type: object
          additionalProperties: true
          properties:
            verification_passed:
              type: boolean
              description: 可能保留原机器判断，不代表人工审核是否完成。
            rule_matched:
              type: boolean
            matched_reason:
              type: string
      description: 字段审核详情。原始抽取结果请读取 extraction_result。
    CollaborationOutputField:
      type: object
      additionalProperties: true
      properties:
        field_key:
          type: string
        field_name:
          type: string
        field_values:
          type: array
          items:
            anyOf:
              - type: object
                additionalProperties: true
              - type: array
                items:
                  type: object
                  additionalProperties: true
          description: 表格字段可能在此同时返回二维单元格数组，表格行列请优先读取 table_values。
        references:
          type: array
          items:
            type: object
            additionalProperties: true
        table_values:
          type: array
          items:
            type: array
            items:
              type: object
              additionalProperties: true
      description: 最终输出字段。普通字段值为对象数组；表格以二维 table_values 读取。
    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.