Skip to main content

Submit an extraction task

Submit a structured field extraction task, with support for online single files, reusable parse results, and offline batch manifests; returns task IDs for async queries.

Submit a structured field extraction task. The input can be a file URL, the parsed_file_biz_id returned by a previous parsing task, or an offline batch manifest URL. Online tasks return a biz_id; offline tasks return a biz_id_list. After submitting, use the task ID to call Query the extraction result to get the processing status and structured result.
Make sure you have obtained an API Key before calling. See Authentication.

Request parameters

ParameterTypeRequiredDescription
file_urlstringNoAn accessible URL of the document to extract from. Mutually exclusive with parsed_file_biz_id and 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.
parsed_file_biz_idstringNoThe business task ID of a completed parsing task. Mutually exclusive with file_url and batch_job_url.
batch_job_urlstringNoThe URL of the offline batch manifest. Mutually exclusive with file_url and parsed_file_biz_id. A JSON array where each item is a subtask: file_url/file_name/file_id/parsed_file_biz_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_idstringNoA saved Extract configuration ID, for example config_xxx.
processingobjectNoInline processing configuration; takes precedence over config_id.
processing.user_promptstringNoUser prompt.
processing.extract_processing_configobjectNoInline extraction processing configuration. Required when using processing.
processing.extract_processing_config.citation_requiredbooleanNoWhether to return citation information; default true.
processing.extract_processing_config.allow_inferencebooleanNoWhether to allow inference; default false.
processing.extract_processing_config.extract_schemaobjectNoThe extraction schema, as a JSON object. Required when using inline processing configuration.
outputobjectNoOutput configuration.
output.oss_configobjectNoOSS output configuration.
output.oss_config.bucketstringNoOSS bucket name.
output.oss_config.endpointstringNoOSS endpoint.
output.oss_config.access_key_idstringNoOSS AccessKey ID.
output.oss_config.access_key_secretstringNoOSS AccessKey Secret.
output.oss_config.security_tokenstringNoOSS 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, parsed_file_biz_id, or batch_job_url as the file source:
    • If file_url or parsed_file_biz_id is non-empty, batch_job_url is ignored and the request is processed online.
    • If both file_url and parsed_file_biz_id are 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. Mutually exclusive with parsed_file_biz_id.
    • parsed_file_biz_id: the ID of a completed online or offline parsing task. Mutually exclusive with 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.
  • When reusing a parsing result, the result must still be within the 7-day retention period, and the input type must support reuse.

Response

FieldTypeDescription
request_idstringThe request ID.
data.biz_idstringThe online task ID, used to call /extract/result.
data.biz_id_listarrayThe list of offline task IDs.
data.biz_id_list[].biz_idstringThe offline subtask ID, used to call /extract/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.

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
Submit
curl -X POST 'https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/parse-x/extract/submit' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "file_url": "https://example.com/contracts/sample.pdf",
    "file_name": "sample.pdf",
    "config_id": "config_xxx"
  }'
Extraction
{
  "request_id": "request_xxx",
  "data": {
    "biz_id": "biz_xxx"
  }
}
Offline tasks:
  • Use a saved configuration
  • Use inline configuration
Submit
curl -X POST 'https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/parse-x/extract/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"
  }'
Offline
{
    "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"
            }
        ]
    }
}
Important notes
  • If a reused parsing result is beyond the 7-day retention period or its type does not match, the endpoint returns the corresponding error; see Error codes.
  • The schema size and long-document page count are planned only within engineering design boundaries; public quotas are subject to the official page. See Supported files and limits.
  • The extraction endpoint does not support audio/video input.
After submitting, use Query the extraction result to poll the task status and get the structured result.