Submit a structured field extraction task; returns a biz_id for async queries
Submit a structured field extraction task and get a
The following examples show the two ways of defining processing. When
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
| Parameter | Type | Required | Description |
|---|---|---|---|
file_url | string | No | An accessible URL of the document to extract from. Mutually exclusive with parsed_file_biz_id. |
parsed_file_biz_id | string | No | The business task ID of a completed parsing task. Mutually exclusive with file_url. |
file_name | string | No | The file name. |
file_name_extension | string | No | The file type. |
config_id | string | No | A saved Extract configuration ID, for example config_xxx. |
processing | object | No | Inline processing configuration; takes precedence over config_id. |
processing.user_prompt | string | No | User prompt. |
processing.extract_processing_config | object | No | Inline extraction processing configuration. Required when using processing. |
processing.extract_processing_config.citation_required | boolean | No | Whether to return citation information; default true. |
processing.extract_processing_config.allow_inference | boolean | No | Whether to allow inference; default false. |
processing.extract_processing_config.extract_schema | object | No | The extraction schema, as a JSON object. Required when using inline processing configuration. |
output | object | No | Output configuration. |
output.oss_config | object | No | OSS output configuration. |
output.oss_config.bucket | string | No | OSS bucket name. |
output.oss_config.endpoint | string | No | OSS endpoint. |
output.oss_config.access_key_id | string | No | OSS AccessKey ID. |
output.oss_config.access_key_secret | string | No | OSS AccessKey Secret. |
output.oss_config.security_token | string | No | OSS 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
| Field | Type | Description |
|---|---|---|
request_id | string | The request ID |
data.biz_id | string | The 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
Extraction