Skip to main content

Submit a parsing task

Submit a document or audio/video parsing task, with support for online single-file and offline batch manifests; returns task IDs for async queries.

Online tasks submit a single file and return a biz_id; offline tasks submit a batch manifest and return a biz_id_list. Parsing is asynchronous: after submitting, use the task ID to call Query the parsing result to get the processing status and result.
Make sure you have obtained an API Key before calling. See Authentication.

Request parameters

ParameterTypeRequiredDescription
file_urlstringNoThe URL of the online file to parse. Mutually exclusive with batch_job_url. A single document supports PDF, Word, and similar files up to 15,000 pages and 1 GB, and single images up to 20 MB.
batch_job_urlstringNoThe URL of the offline batch manifest. Mutually exclusive with file_url. A JSON array where each item is a subtask: file_url/file_name/file_id, etc. An offline request supports up to 200 subtasks; requests with more than 200 subtasks are not processed. A single document supports PDF, Word, and similar files up to 15,000 pages and 1 GB, and single images up to 20 MB.
file_namestringNoThe online task file name. The protocol also provides file_name_extension; choose one of the two based on how you provide the file information.
file_name_extensionstringNoThe online task file type. Mutually exclusive with file_name.
config_idstringNoThe configuration ID, for example config_xxx. When passed together with inline parameters, the inline parameters take precedence.
processingobjectNoProcessing configuration.
processing.user_promptstringNoUser-defined prompt.
processing.doc_processing_configobjectNoDocument parsing processing configuration.
processing.doc_processing_config.page_indexstringNoThe page range to parse, for example 1-10.
processing.doc_processing_config.head_footbooleanNoWhether to parse headers and footers.
processing.doc_processing_config.layout_positionbooleanNoWhether to return coordinates.
processing.doc_processing_config.image_captionbooleanNoWhether to generate image descriptions.
processing.media_processing_configobjectNoAudio/video parsing processing configuration.
processing.media_processing_config.enable_diarizationbooleanNoWhether to perform speaker diarization.
processing.media_processing_config.enable_synopsis_parsebooleanNoWhether to perform synopsis parsing.
processing.media_processing_config.enable_synopsis_segmentsbooleanNoWhether to generate synopsis segments.
processing.media_processing_config.enable_synopsis_summarybooleanNoWhether to generate a synopsis summary.
processing.media_processing_config.frame_extractionobjectNoFrame extraction configuration.
processing.media_processing_config.frame_extraction.modestringNoFrame extraction mode. Valid values: auto, frame_rate
processing.media_processing_config.frame_extraction.frame_ratenumberNoFrame extraction rate, in the range 0.2–5
processing.media_processing_config.frame_extraction.output_image_widthintegerNoOutput frame image width. If not specified, the original resolution is used. Value range: [32, 4096]
processing.media_processing_config.frame_extraction.output_image_heightintegerNoOutput frame image height. If not specified, the original resolution is used. Value range: [32, 4096]
outputobjectNoOutput configuration.
output.output_file_formatstring[]NoArray of output format strings. Valid values: markdown
output.layout_table_formatstringNoOutput format of tables in Markdown. Valid values: markdown, html
output.oss_configobjectNoOSS output configuration.
output.oss_config.bucketstringNoManaged OSS bucket name.
output.oss_config.endpointstringNoManaged OSS endpoint.
output.oss_config.access_key_idstringNoManaged OSS AccessKey ID.
output.oss_config.access_key_secretstringNoManaged OSS AccessKey Secret.
output.oss_config.security_tokenstringNoManaged OSS Security Token.
  • Online and offline tasks:
    • Online tasks: real-time parsing and task return, suitable for fast-response scenarios.
    • Offline tasks: submit multiple subtasks at once, suitable for scenarios that can tolerate longer waits. Offline tasks are promised to complete within 7×24 hours after submission.
    • A single offline request supports up to 200 subtasks; each subtask is billed independently.
    • Online and offline tasks use different billing logic. See Billing.
  • Choose file_url or batch_job_url as the file source:
    • If file_url is non-empty, batch_job_url is ignored and the request is processed online.
    • If file_url is empty and batch_job_url is non-empty, batch_job_url takes effect and the request is processed as an offline batch.
  • batch_job_url points to a manifest in JSON array format. Each item is a subtask containing:
    • file_url: the subtask file URL.
    • file_name: the subtask file name.
    • file_id: a custom subtask ID.
  • The processing definition uses config_id or inline processing. All subtasks in an offline request share one configuration; per-subtask configuration within a single request is not supported.

Response

FieldTypeDescription
request_idstringThe request ID.
data.biz_idstringThe online task ID, used to call /parse/result.
data.biz_id_listarrayThe list of offline task IDs.
data.biz_id_list[].biz_idstringThe offline subtask ID, used to call /parse/result. Not returned if recognition fails.
data.biz_id_list[].file_idstringThe custom offline subtask ID.
data.biz_id_list[].codestringThe offline subtask error code. Not returned if recognition succeeds.
data.biz_id_list[].messagestringThe offline subtask error message. Not returned if recognition succeeds.
data.biz_id_list[].statusstringThe offline subtask status: success / fail, indicating whether the subtask was submitted successfully.

Document parsing code examples

The following examples show the two ways of defining processing. When config_id and processing are both present, processing takes precedence. The URLs, task IDs, and configuration IDs in the examples are desensitized placeholder values. Online tasks:
  • Use a saved configuration
  • Use inline configuration
Configure
curl -X POST 'https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/parse-x/parse/submit' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "file_url": "https://example.com/document.pdf",
    "file_name": "document.pdf",
    "config_id": "config_xxx"
}'
{
    "request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "data": {
        "biz_id": "parseX-2026xxxx-xxxxxxx"
    }
}
Offline tasks:
  • Use a saved configuration
  • Use inline configuration
Configure
curl -X POST 'https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/parse-x/parse/submit' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "batch_job_url": "https://example.com/manifest.json",
    "config_id": "config_xxx"
}'
{
    "request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "data": {
        "biz_id_list": [
            {
                "biz_id": "parseX-pre-2026xxxx-xxxxxxx",
                "file_id": "file_001",
                "status": "success"
            },
            {
                "file_id": "file_002",
                "code": "MissingFileUrl",
                "message": "FileUrl is mandatory.",
                "status": "fail"
            }
        ]
    }
}

Audio/video parsing code examples

  • Use a saved configuration
  • Use inline configuration
Configure
curl -X POST 'https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/parse-x/parse/submit' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "file_url": "https://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/static/Wan3.0模型创意视频.mp4",
    "file_name": "test.mp4",
    "config_id": "config_xxx"
}'
{
    "request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "data": {
        "biz_id": "parseX-Video-2026xxxx-xxxxxxx"
    }
}
For the formats and limits supported by the parsing endpoint, see Supported files and limits.
After submitting, use Query the parsing result to poll the task status and get the parsing result.