> ## Documentation Index
> Fetch the complete documentation index at: https://docs.textin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Parse Async

> 创建异步文档解析任务，立即返回job_id，通过job_id查询处理状态和结果。

适用于处理大文件或批量文件，避免HTTP超时限制。




## OpenAPI

````yaml api-reference/parse-async-1.0.0.openapi.yaml POST /api/xparse/parse/async
openapi: 3.0.3
info:
  title: XParse Parse Async API
  description: |
    独立的文档解析异步API接口，支持异步处理文档解析任务。

    该API适用于处理大文件或批量文件，通过job_id查询处理状态和结果，避免长时间等待。
  version: 1.0.0
  contact:
    name: TextIn API Team
servers:
  - url: https://api.textin.com
    description: 生产环境
security:
  - AppIdAuth: []
    SecretCodeAuth: []
tags:
  - name: XParse Parse
    description: |
      独立的文档解析异步API接口

      ## 功能特性
      - 📄 异步处理：支持大文件和批量文件处理
      - 🔔 Webhook支持：支持任务完成回调通知
      - 📊 状态查询：通过job_id查询任务状态
      - ⏱️ 无超时限制：避免HTTP超时问题

      ## 计费说明
      - 按照处理的页数计费
      - 计费信息通过 x-ti-app-id 和 x-ti-secret-code 进行关联
paths:
  /api/xparse/parse/async:
    post:
      tags:
        - XParse Parse
      summary: 创建异步解析任务
      description: |
        创建异步文档解析任务，立即返回job_id，通过job_id查询处理状态和结果。

        适用于处理大文件或批量文件，避免HTTP超时限制。
      operationId: createParseAsyncJob
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    需要处理的文档文件（支持
                    PDF、WORD、EXCEL、PPT、图片等[多种格式](/pipeline/sources/overview#支持的文件格式)）
                config:
                  type: string
                  description: |
                    Parse配置的 JSON 字符串（可选），与Pipeline Parse节点配置一致。

                    如果未提供，将使用默认配置（provider: "textin"）。

                    配置格式参考[文档解析 - Parse](/pipeline/parse)。
                  example: '{"provider": "textin", "parse_mode": "auto"}'
                webhook:
                  type: string
                  description: >
                    Webhook回调URL（可选），当任务完成或失败时会调用该URL。


                    Webhook请求格式：

                    - Method: POST

                    - Content-Type: application/json

                    - Body: {"job_id": "xxx", "status": "completed",
                    "result_url": "https://..."}
                  example: https://your-server.com/webhook
            encoding:
              config:
                contentType: application/json
      responses:
        '200':
          description: 任务创建成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/codemessage'
                  - $ref: '#/components/schemas/CreateJobResponse'
              examples:
                success:
                  summary: 成功示例
                  value:
                    code: 200
                    msg: success
                    data:
                      job_id: xxx
                error:
                  summary: 错误示例
                  value:
                    code: 40004
                    msg: Parameter error
                    data:
                      message: File not uploaded
components:
  schemas:
    codemessage:
      type: object
      required:
        - code
        - msg
      properties:
        code:
          type: integer
          default: 200
          description: |
            状态码
            - 200: Success
            - 40101: x-ti-app-id 或 x-ti-secret-code 为空
            - 40102: x-ti-app-id 或 x-ti-secret-code 无效，验证失败
            - 40004: 参数错误，请查看技术文档，检查传参
            - 500: 服务器内部错误

            更多详细错误信息参考[错误码说明](/pipeline/error)。
          enum:
            - 200
            - 40101
            - 40102
            - 40004
            - 500
        msg:
          type: string
          description: 错误信息
          example: success
    CreateJobResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/CreateJobData'
    CreateJobData:
      type: object
      required:
        - job_id
      properties:
        job_id:
          type: string
          description: 任务ID，用于查询任务状态
          example: xxx
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: x-ti-app-id
      description: >-
        请[登录Textin](https://www.textin.com/console/dashboard/setting)后前往
        "工作台-账号设置-开发者信息" 查看 x-ti-app-id
    SecretCodeAuth:
      type: apiKey
      in: header
      name: x-ti-secret-code
      description: >-
        请[登录Textin](https://www.textin.com/console/dashboard/setting)后前往
        "工作台-账号设置-开发者信息" 查看 x-ti-secret-code

````