> ## 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 asynchronous document conversion task

> Query a conversion result by `task_id`. The current response has no separate task-status field. While processing is still in progress, the service may return `code=success` with an empty `img_detail_list` and zero `total_num`. Poll with backoff and stop only after page results or a spreadsheet structure is available.

An empty result cannot reliably distinguish "still processing" from "no visual pages." Set a total client timeout and a maximum poll count.




## OpenAPI

````yaml en/api-reference/adp-api.yaml GET /open/agentic_doc_processor/{tenant_name}/v1/doc/convert/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/doc/convert/query/task/{task_id}:
    get:
      tags:
        - Document conversion
      summary: Query asynchronous document conversion task
      description: >
        Query a conversion result by `task_id`. The current response has no
        separate task-status field. While processing is still in progress, the
        service may return `code=success` with an empty `img_detail_list` and
        zero `total_num`. Poll with backoff and stop only after page results or
        a spreadsheet structure is available.


        An empty result cannot reliably distinguish "still processing" from "no
        visual pages." Set a total client timeout and a maximum poll count.
      operationId: queryDocumentConvertTask
      parameters:
        - $ref: '#/components/parameters/TenantName'
        - name: task_id
          in: path
          required: true
          description: Task ID returned after an asynchronous conversion task is created.
          schema:
            type: string
            minLength: 1
      responses:
        '200':
          $ref: '#/components/responses/DocumentConvertResponse'
        '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
  responses:
    DocumentConvertResponse:
      description: >-
        Document conversion result. While processing is in progress or after a
        failure, the service may return an empty result or `data=null`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocumentConvertResponse'
          example:
            code: success
            message: ''
            tips: null
            data:
              task_id: task_abc123
              img_detail_list:
                - page_num: 1
                  img_base64: ''
                  img_url: https://example.com/temp/task_abc123/page-1.png
                  width: 1240
                  height: 1754
                  preprocess: {}
              total_num: 1
              metadata: {}
              file_type: pdf
              source_file_type: pdf
              spreadsheet_manifest_file_id: ''
              spreadsheet_manifest_url: ''
              view_type: ''
              page_count: 1
              sheet_count: 0
              logical_unit_count: 0
              document_contents: []
              document_details: []
              warnings: []
              billing: {}
    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:
    DocumentConvertResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleResponse'
        - type: object
          properties:
            data:
              oneOf:
                - $ref: '#/components/schemas/DocumentConvertData'
                - type: 'null'
    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.
    DocumentConvertData:
      type: object
      properties:
        task_id:
          type: string
        img_detail_list:
          type: array
          items:
            $ref: '#/components/schemas/DocumentConvertImage'
        total_num:
          type: integer
          minimum: 0
        metadata:
          type: object
          additionalProperties: true
        file_type:
          type: string
          description: Conversion result type, such as `pdf`, `image`, or `spreadsheet`.
        source_file_type:
          type: string
          description: Detected source-file extension type.
        spreadsheet_manifest_file_id:
          type: string
        spreadsheet_manifest_url:
          type: string
          description: Temporary download URL for the native Excel preview manifest.
        view_type:
          type: string
          description: Set to `spreadsheet` for native Excel parsing.
        page_count:
          type: integer
          minimum: 0
        sheet_count:
          type: integer
          minimum: 0
        logical_unit_count:
          type: integer
          minimum: 0
        document_contents:
          type: array
          items:
            type: string
        document_details:
          type: array
          items: {}
        warnings:
          type: array
          items:
            type: object
            additionalProperties: true
        billing:
          type: object
          additionalProperties: true
      required:
        - task_id
        - img_detail_list
        - total_num
        - metadata
        - file_type
        - source_file_type
        - spreadsheet_manifest_file_id
        - spreadsheet_manifest_url
        - view_type
        - page_count
        - sheet_count
        - logical_unit_count
        - document_contents
        - document_details
        - warnings
        - billing
    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
    DocumentConvertImage:
      type: object
      properties:
        page_num:
          type: integer
          minimum: 0
        img_base64:
          type: string
          description: >-
            Page-image content when `result_mode=base64`; otherwise it is
            generally an empty string.
        img_url:
          type: string
          description: >-
            Temporary page URL when `result_mode=url`; otherwise it is generally
            an empty string.
        width:
          type: integer
          minimum: 0
        height:
          type: integer
          minimum: 0
        preprocess:
          type: object
          additionalProperties: true
      required:
        - page_num
        - img_base64
        - img_url
        - width
        - height
        - preprocess
  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.