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

# async conversion — Query result

> Query conversion status by task_id and receive the result file download URL

### Task statuses

| `status`     | Meaning                                                                |
| ------------ | ---------------------------------------------------------------------- |
| `parsing`    | The PDF is being parsed                                                |
| `queued`     | Parsing is complete and conversion is queued                           |
| `converting` | The Office file is being generated                                     |
| `succeeded`  | Conversion succeeded and the response includes `download_url`          |
| `failed`     | Parsing or conversion failed; inspect `error_code` and `error_message` |

Poll every **3–5 seconds**. `download_url` is a short-lived signed URL. If it expires, call this endpoint again to obtain a new URL.

If you do not have a `task_id`, call [Submit async task](/en/api-reference/endpoint/pdf2office-async-submit) first.


## OpenAPI

````yaml POST /pdf2office/async_check
openapi: 3.0.3
info:
  title: SoMark 文档智能 API
  description: SoMark 文档智能 API，支持 PDF、图片、Word、PPT 和 Excel 文件解析，以及 PDF 转 Word/PPT。
  version: 1.0.0
servers:
  - url: https://somark.cn/api/v1
security: []
paths:
  /pdf2office/async_check:
    post:
      summary: PDF 转 Office — 查询异步结果
      description: 根据 task_id 查询任务状态；转换成功时返回短期有效的 download_url。
      operationId: pdf2officeAsyncCheck
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - task_id
                - api_key
              properties:
                task_id:
                  type: string
                  description: 提交异步任务时返回的任务 ID
                  example: c5e6c983f28a4e6eb5d6c061343a8642
                api_key:
                  type: string
                  description: API 密钥，格式 sk-***
                  example: sk-***
      responses:
        '200':
          description: 查询成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pdf2OfficeResponse'
      x-codeSamples:
        - lang: python
          label: Python
          source: |-
            import time
            import requests

            url = "https://somark.cn/api/v1/pdf2office/async_check"
            task_id = "c5e6c983f28a4e6eb5d6c061343a8642"

            while True:
                response = requests.post(url, data={
                    "task_id": task_id,
                    "api_key": "sk-***",
                })
                result = response.json()["data"]
                if result["status"] == "succeeded":
                    print(result["download_url"])
                    break
                if result["status"] == "failed":
                    print(result["error_message"])
                    break
                time.sleep(3)
        - lang: bash
          label: cURL
          source: |-
            curl -X POST https://somark.cn/api/v1/pdf2office/async_check \
              -F "task_id=c5e6c983f28a4e6eb5d6c061343a8642" \
              -F "api_key=sk-***"
components:
  schemas:
    Pdf2OfficeResponse:
      type: object
      properties:
        code:
          type: integer
          description: 状态码，0 为成功，非 0 见错误码说明
          example: 0
        message:
          type: string
          example: 查询成功
        data:
          type: object
          properties:
            task_id:
              type: string
              description: 任务 ID
              example: c5e6c983f28a4e6eb5d6c061343a8642
            status:
              type: string
              description: 任务状态
              enum:
                - parsing
                - queued
                - converting
                - succeeded
                - failed
              example: succeeded
            target_type:
              type: string
              enum:
                - word
                - ppt
              example: word
            layout_mode:
              type: string
              enum:
                - flow
                - layout
              example: flow
            file_name:
              type: string
              description: 原始 PDF 文件名
              example: document.pdf
            page_num:
              type: integer
              description: PDF 页数
              example: 12
            result_file_name:
              type: string
              nullable: true
              description: 转换结果文件名
              example: document.docx
            error_code:
              type: integer
              nullable: true
              description: 任务失败错误码，成功时为 null
              example: null
            error_message:
              type: string
              nullable: true
              description: 任务失败原因，成功时为 null
              example: null
            created_at:
              type: string
              nullable: true
              description: 任务创建时间，ISO 8601 格式
            started_at:
              type: string
              nullable: true
              description: 转换开始时间，ISO 8601 格式
            finished_at:
              type: string
              nullable: true
              description: 任务完成时间，ISO 8601 格式
            download_url:
              type: string
              format: uri
              description: 结果文件的短期签名下载地址，仅 succeeded 状态返回
              example: https://example.com/result.docx?signature=***
            expires_in:
              type: integer
              description: download_url 有效期，单位为秒
              example: 1800
      example:
        code: 0
        message: 查询成功
        data:
          task_id: c5e6c983f28a4e6eb5d6c061343a8642
          status: succeeded
          target_type: word
          layout_mode: flow
          file_name: document.pdf
          page_num: 12
          result_file_name: document.docx
          error_code: null
          error_message: null
          created_at: '2026-08-24T10:00:00'
          started_at: '2026-08-24T10:00:10'
          finished_at: '2026-08-24T10:01:20'
          download_url: https://example.com/result.docx?signature=***
          expires_in: 1800

````