Skip to main content

Submit an extraction task

Submit a structured field extraction task; returns a biz_id for async queries

Submit a structured field extraction task and get a biz_id in return. The input can be a file URL or the parsed_file_biz_id returned by a previous parsing task. Field extraction is an async task: after submitting, use that 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.
parsed_file_biz_idstringNoThe business task ID of a completed parsing task. Mutually exclusive with file_url.
file_namestringNoThe file name.
file_name_extensionstringNoThe file type.
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.
The request requires two pairs of mutually exclusive choices: use file_url or parsed_file_biz_id as the file source, and use config_id or inline processing as the processing definition. 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 business task ID, used to call /extract/result

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.
  • 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"
  }
}
Extract does not support audio/video input. 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.
After submitting, use Query the extraction result to poll the task status and get the structured result.
Managed Agent API
Flow Agent API
Sandbox API
RAG API
Long-term Memory
Security API
Framework Integration