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

# Query document extraction result

> Query document extraction status and results by the task_id returned by the task creation endpoint. After human review, extraction_result retains the original extraction and output_result contains the corrected final values. Query the collaboration task separately to confirm its review state.



## OpenAPI

````yaml en/api-reference/adp-api.yaml GET /open/agentic_doc_processor/{tenant_name}/v1/app/doc/extract/query/task/{task_id}
openapi: 3.1.0
info:
  title: ADP API
  version: 1.0.0
  description: >-
    Laiye ADP OpenAPI reference for document extraction, recognition, and
    conversion; extraction application management; webhooks; human
    collaboration; credit usage; workflow discovery, runs, exports, and file
    management.
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://adp-global.laiye.com
    description: ADP global production endpoint
security: []
tags:
  - name: Document extraction
    description: Extract structured fields from uploaded documents.
  - name: Document recognition
    description: Recognize text, layout blocks, and positions from uploaded documents.
  - name: Document conversion
    description: >-
      Convert PDFs, Office documents, OFD files, and images into page images or
      native spreadsheet structures.
  - name: Application management
    description: >-
      Create, update, delete, and query extraction applications and
      configurations.
  - name: Webhook
    description: List system events and manage event callbacks.
  - name: Account
    description: Query credit usage.
  - name: Workflow
    description: >-
      List business workflow templates, run workflow applications, and query run
      results.
  - name: Workflow files
    description: Upload and manage files used by workflow applications.
  - name: Human collaboration
    description: >-
      Configure review triggers, query collaboration tasks, and submit human
      corrections.
paths:
  /open/agentic_doc_processor/{tenant_name}/v1/app/doc/extract/query/task/{task_id}:
    get:
      tags:
        - Document extraction
      summary: Query document extraction result
      description: >-
        Query document extraction status and results by the task_id returned by
        the task creation endpoint. After human review, extraction_result
        retains the original extraction and output_result contains the corrected
        final values. Query the collaboration task separately to confirm its
        review state.
      operationId: queryDocumentExtractTask
      parameters:
        - $ref: '#/components/parameters/TenantName'
        - $ref: '#/components/parameters/TaskId'
      responses:
        '200':
          $ref: '#/components/responses/DocumentExtractResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    TenantName:
      name: tenant_name
      in: path
      required: true
      description: 'Tenant name. Default: laiye.'
      schema:
        type: string
        default: laiye
    TaskId:
      name: task_id
      in: path
      required: true
      description: Task ID.
      schema:
        type: string
  responses:
    DocumentExtractResponse:
      description: Document extraction result.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocumentExtractResponse'
          example:
            code: success
            message: ''
            data:
              task_id: 94fe9b74e0e311f091505e345594c618
              file_url: ''
              message: ''
              status: 4
              doc_recognize_result: []
              extraction_result: []
              extract_config_version: v1
              metadata: {}
              aigc: null
    ValidationError:
      description: Validation error.
      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
  schemas:
    DocumentExtractResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/DocumentExtractData'
    HTTPValidationError:
      type: object
      description: FastAPI/Pydantic request validation error.
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      required:
        - detail
    SimpleResponse:
      type: object
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
          description: Business code. A successful response is usually success or 200.
        message:
          type: string
          description: Response message.
        tips:
          type:
            - string
            - 'null'
          description: Details. Defaults to null.
    DocumentExtractData:
      type: object
      properties:
        task_id:
          type: string
        file_url:
          type: string
        message:
          type: string
          description: Task status or processing result message.
        status:
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 4
            - 5
            - 6
          description: >-
            0=unknown, 1=ready, 2=running, 4=succeeded, 5=failed, 6=canceled or
            rejected.
        doc_recognize_result:
          type: array
          items:
            $ref: '#/components/schemas/RecognizePage'
        extraction_result:
          description: Original machine extraction result, retained after human correction.
          type: array
          items:
            $ref: '#/components/schemas/ExtractionField'
        extract_config_version:
          type: string
          description: Configuration version used for this extraction.
        collaboration_result:
          description: >-
            Collaboration review details. Query the collaboration task_state to
            confirm completion of human review.
          type: array
          items:
            type: object
            additionalProperties: true
        output_result:
          description: >-
            Final result, including corrected values after human review. Confirm
            that the collaboration task has passed or completed.
          type: array
          items:
            type: object
            additionalProperties: true
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Document processing task metadata.
          properties:
            collaboration_task_id:
              type:
                - string
                - 'null'
              description: >-
                Collaboration task primary ID; present only when human
                collaboration is enabled.
        aigc:
          oneOf:
            - $ref: '#/components/schemas/AigcLabel'
            - type: 'null'
          description: AI-generated content compliance label.
        spreadsheet_manifest_file_id:
          type: string
          description: >-
            Native Excel preview manifest file ID. Usually an empty string for
            non-Excel documents.
        spreadsheet_manifest_url:
          type: string
          description: >-
            Native Excel preview manifest download URL. Usually an empty string
            for non-Excel documents.
        spreadsheet_billing:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Billing details for Excel worksheets and embedded images.
    ValidationErrorItem:
      type: object
      additionalProperties: true
      properties:
        type:
          type: string
          description: Validation error type.
        loc:
          type: array
          description: Location of the invalid field in the request.
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
          description: Human-readable validation error message.
        input:
          description: Input value that failed validation.
        ctx:
          type: object
          additionalProperties: true
          description: Additional context supplied by the validator.
        url:
          type: string
          format: uri
          description: Link to the Pydantic error documentation.
      required:
        - type
        - loc
        - msg
    RecognizePage:
      type: object
      properties:
        page_num:
          type: integer
        document_content:
          type: string
        document_details:
          type: array
          items:
            $ref: '#/components/schemas/DocumentDetail'
        stamps:
          type: array
          description: >-
            Stamp recognition results. Returned only when
            enable_stamp_recognition is enabled and at least one stamp is
            detected.
          items:
            type: object
            additionalProperties: true
    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
    AigcLabel:
      type: object
      properties:
        Label:
          type: string
          description: Content label type.
        ContentProducer:
          type: string
          description: Content generation service provider identifier.
        ProduceID:
          type: string
          description: Content production identifier.
        ReservedCode1:
          type: string
          description: Reserved validation code for content generation.
        ContentPropagator:
          type: string
          description: Content distribution service provider identifier.
        PropagateID:
          type: string
          description: Content distribution identifier.
        ReservedCode2:
          type: string
          description: Reserved validation code for content distribution.
        ProcessingTypes:
          type: array
          description: AI processing types used to produce this response.
          items:
            type: string
    DocumentDetail:
      type: object
      properties:
        type:
          type: string
        text:
          type: string
        position:
          type: array
          items:
            type: object
            properties:
              points:
                type: array
                items:
                  $ref: '#/components/schemas/Point'
        ocr_confidence:
          type: object
          properties:
            ocr_mean_confidence:
              type: number
            ocr_min_confidence:
              type: number
            is_overall_confidence:
              type: integer
    Point:
      type: object
      properties:
        x:
          type: number
        'y':
          type: number
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Production API Key. You can find it under My API in the ADP platform.
        Make sure the API Key is active and belongs to the production
        environment.

````

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