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

# Create document extraction task

> Create a document extraction task and return task_id immediately. Use this endpoint for large documents or long-running extraction tasks.

With human collaboration enabled, data.metadata.collaboration_task_id is the collaboration task ID, while data.task_id is the asynchronous extraction task ID. They are not interchangeable. High-speed custom extraction does not support human collaboration.




## OpenAPI

````yaml en/api-reference/adp-api.yaml POST /open/agentic_doc_processor/{tenant_name}/v1/app/doc/extract/create/task
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/create/task:
    post:
      tags:
        - Document extraction
      summary: Create document extraction task
      description: >
        Create a document extraction task and return task_id immediately. Use
        this endpoint for large documents or long-running extraction tasks.


        With human collaboration enabled, data.metadata.collaboration_task_id is
        the collaboration task ID, while data.task_id is the asynchronous
        extraction task ID. They are not interchangeable. High-speed custom
        extraction does not support human collaboration.
      operationId: createDocumentExtractTask
      parameters:
        - $ref: '#/components/parameters/TenantName'
        - $ref: '#/components/parameters/AcceptLanguage'
      requestBody:
        $ref: '#/components/requestBodies/DocumentExtractRequest'
      responses:
        '200':
          $ref: '#/components/responses/TaskCreateResponse'
        '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
    AcceptLanguage:
      name: accept-language
      in: header
      required: false
      description: Field name language. Use zh for Chinese or en for English.
      schema:
        type: string
        enum:
          - zh
          - en
        default: en
  requestBodies:
    DocumentExtractRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocumentExtractRequest'
          examples:
            fileUrl:
              value:
                app_id: app_abc123
                file_url: >-
                  https://adp.laiye.com/web/agentic_doc_processor/laiye/file/2003c711818811f1a36200163e358400
                with_rec_result: false
            fileBase64:
              value:
                app_id: app_abc123
                file_base64: JVBERi0xLjQKJcfs...
                with_rec_result: true
  responses:
    TaskCreateResponse:
      description: Task creation result.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SimpleResponse'
              - type: object
                properties:
                  data:
                    type: object
                    properties:
                      task_id:
                        type: string
                      metadata:
                        type: object
                        additionalProperties: true
                        description: Document processing task metadata.
                        properties:
                          collaboration_task_id:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Collaboration task primary ID when enabled, used
                              for task queries and file_task_id. Distinct from
                              the outer task_id.
          example:
            code: success
            message: ''
            data:
              task_id: 94fe9b74e0e311f091505e345594c618
              metadata: {}
    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:
    DocumentExtractRequest:
      oneOf:
        - title: Use file URL
          type: object
          additionalProperties: false
          properties:
            app_id:
              default: app_abc123
              type: string
              description: Unique application ID.
            file_url:
              default: >-
                https://adp.laiye.com/web/agentic_doc_processor/laiye/file/2003c711818811f1a36200163e358400
              type: string
              format: uri
              description: File URL. Use either file_url or file_base64.
            file_name:
              type: string
              description: >-
                File name. Provide it when using Base64 or when the file name
                cannot be inferred from the URL.
            with_rec_result:
              type: boolean
              description: >-
                Whether to return document recognition results. High-speed
                extraction does not return recognition results.
              default: false
          required:
            - app_id
            - file_url
        - title: Use file Base64
          type: object
          additionalProperties: false
          properties:
            app_id:
              default: app_abc123
              type: string
              description: Unique application ID.
            file_base64:
              default: JVBERi0xLjQKJcfs...
              type: string
              description: Base64-encoded file. Use either file_base64 or file_url.
            file_name:
              type: string
              description: >-
                File name. Provide it when using Base64 or when the file name
                cannot be inferred from the URL.
            with_rec_result:
              type: boolean
              description: >-
                Whether to return document recognition results. High-speed
                extraction does not return recognition results.
              default: false
          required:
            - app_id
            - file_base64
    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.
    HTTPValidationError:
      type: object
      description: FastAPI/Pydantic request validation error.
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      required:
        - detail
    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
  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.